Skip to content

Instantly share code, notes, and snippets.

@h3xxx
Created December 1, 2014 09:01
Show Gist options
  • Save h3xxx/32dc16b87dadd45a8bd4 to your computer and use it in GitHub Desktop.
Save h3xxx/32dc16b87dadd45a8bd4 to your computer and use it in GitHub Desktop.
Linux disk recovery tools
https://www.raymond.cc/blog/5-free-tools-to-backup-and-restore-master-boot-record-mbr/2/
http://www.rodsbooks.com/gdisk/repairing.html
parted / gparted
gpart
gdisk
fdisk
sfdisk
BOOTREC /FIXMBR
Save partition table:
sfdisk -d /dev/sda > backup.txt
Restore partition table:
sfdisk -f /dev/sda < backup.txt
Save MBR:
dd if=/dev/sda of=backup.mbr bs=512 count=1
Restore MBR: (446 = bootloader, above 446 is partition table)
dd if=backup.mbr of=/dev/sda bs=446 count=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment