Backup and recover partition tables

assuming MBR and only primary partitions

backup both the boot-code AND the partition table

dd if=/dev/sda of=/tmp/sda-mbr.bin bs=512 count=1

restore only the boot-code

dd if=sda-mbr.bin of=/dev/sda bs=446 count=1

restore only the partition table

dd if=sda-mbr.bin of=/dev/sda bs=1 count=64 skip=446 seek=446

Resources

diy

https://www.cyberciti.biz/faq/howto-copy-mbr/

https://www.cyberciti.biz/tips/linux-how-to-backup-hard-disk-partition-table-mbr.html

tools

Top Data Recovery Tools for Linux File Systems – Ext4/3/2 https://habr.com/en/company/hetmansoftware/blog/553866/

Use of ddrescue - saving a failing EXT4 drive -fsck results in all data in to lost+found https://superuser.com/questions/1552307/use-of-ddrescue-saving-a-failing-ext4-drive-fsck-results-in-all-data-in-to-lo


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun