Power loss on partition move - btrfs file system

long story short, i was having to move some data and partitions around on larger storage drive (12TB). While using gparted to move the last partition to the begining of the drive and expand it to fill the drive, i lost power (i know i know, UPS… but thats money i dont have)

I am running CachyOS. when coming back to the pc after the power loss, the drive coulnt be mounted.

opened Gparted back up, and used it check feature (there was a warning that said to), it gave an error that i coulnt read tree root.

btrfd inspect and restore both return errors, as well as btrfs-find-root.

the person that was helping me suggested this page

(apparently cannot post links… the program is btrfs-rec)

but im kinna out of my depth here. i also have no where to make a copy of this drive. so, ideally, any recovery should happen on the drive itself if possible… this is where i kept basicly all my data… photos, backups…. D&D stuff…

A lot depends on the exact operation & size & by which order gparted moved things for that combination of factors.

If you are very lucky, gparted didn’t move any of the original partition’s blocks (it’s most likely going to be all copied, until something starts overwriting it). and if the power failed before it hit the ‘zero’ point of where the partition used to be it may still all be there in the same place on the disk.

If so, testdisk can scan to try to recover the old partition boundaries, allowing you to recreate that as it was and then all of btrfs would be as it was.

But if btrfs has been split in half at effectively a random place, it seems likely even btrfs tools will have a hard time with this. I’ve used PhotoRec (same site) before but it predates btrfs. If so plan on finding another disk. Any writes on the disk at all could be eliminating any chances of recovery.