Recover a disk accidentally wiped from UI

Dear fat fingered colleague,

If you, like me, wiped a btrfs disk (whole disk as btrfs, NO PARTITIONS!!!) with loved data in it, you may find this instructions pretty helpful. Taken from btrfs Wiki, this link explains the process:

https://btrfs.wiki.kernel.org/index.php/Problem_FAQ#What_if_I_don.27t_have_wipefs_at_hand.3F

and the single instruction to recover your drive is (replace sdXXX with whatever disk you screwed):

If you want to restore the superblocks magic string, 
# echo "_BHRfS_M" | dd bs=1 count=8 of=/dev/sdXXX seek=$((64*1024+64))

Regards, Angel

2 Likes

This is a nice one @AngeleToR, Thank you!