[EDIT]
I now only have that painful little “what if?” ember of hope left.
I think the writing is kind of on the wall at this point but in the hopes that my experience isn’t a total loss, I’d just like to share a few thoughts.
The first thing I want to say is that I didn’t lose my data because I made a mistake. I lost it because I made several mistakes, over the space of days, months, and even years. There’s only one person to blame for the lack of a backup… but I do find myself with renewed hope.
If there’s one thing I hope that comes out of this whole affair, it’s that I can serve as a cautionary tale. If you’re reading this and you don’t have your data backed up… I implore you to not put off setting up some form of backup! Even if it’s just an external HDD that you don’t backup to as often as you should!.. there’s a big difference between losing a month’s worth of data, and losing pretty much everything.
The thing that makes this whole thing doubly ironic is that literally just two days ago, the thought popped into my head that I really should sort out a backup for my boot disk. It wasn’t the first time that thought had popped into my head but I’m determined that it will be the last time.
After what I hope is a good night’s sleep, I’ll be creating a fresh install tomorrow. I’ll be writing a checklist of what needs installing and configuring. And right at the top, after I’ve created mirrored vdev (which if I had done with my now past install, probably would have saved my bacon), there will be setting up replication to my server.
Long story short… I have a Debian 12 install with root on ZFS, on a single disk (nvme0). The install was creating by following the OpenZFS documentation. I’m about 90% sure I followed the partitioning instructions exactly as they’re written but it is possible that I doubled the size of the UEFI and boot partitions.
I wanted to mirror this disk to another disk (nvme1) but have the second disk also be capable of booting. So I used the sgdisk --replicate= command to copy the EFI partition from one disk to the other… only I reversed the source and destinations in the sgdisk command. Which has rendered the system unbootable.
I’ve booted into a Debian 12 Live ISO and checked the nvme0 disk using gparted and there are no partitions present. I then started to scan nvme0 with testdisk, which did show an EFI partition but it also showed what it thought was NTFS partitions with the wrong cylinder (?) count. I stopped the testdisk scan and I am currently making dd images of both nvme0 and nvme1, to .ddimg files on a new (but tested) HDD.
I’ve read that testdisk doesn’t really support ZFS. I’ve also wondered whether there’s a way I could just recreate the partition table without destroying any data on my zpool… but I’m far too stupid to tackle this issue on my own.
So L1Ters, how screwed am I? How should I recover my data?