I've been setting up a new system, and recovering backups from my formatted external hard drive. I was able to get most of what I needed from it, but the btrfs partition was somehow reformatted as swap. In an attempt to fix the issue, I reformatted it again as btrfs (using gparted), but this did not recover any of the old data. As I have not written to the drive (beyond the format changes), I assume all of the information is still there, but inaccessible.Is there a way I can recover this data? In other words, is there a way to latch on to the old metadata (and root) of the original btrfs partition?What could have caused the partition to be reformatted to swap in the first place?Note: this whole situation could have been due to error on my own part, as I was trying to fix some swap issues. However, I was unable to find the command that would have formatted the partition as swap (mkswap /dev/sdb1) in my bash history.
Recover the contents of a formatted disk?
partition;btrfs;gparted