Quote:
Originally Posted by rknichols
Watch out! That saves only the layout of the primary partitions. If one of those is an extended partition, none of the info for the logical partitions within it will be saved.
|
Extended would be tricky as it appears to have varied offsets:
wiki:EBR:examples
This has a nice solution:
http://www.cyberciti.biz/faq/howto-copy-mbr/
Backup
Code:
# dd if=/dev/sda of=/tmp/backup-sda.mbr bs=512 count=1
# sfdisk -d /dev/sda > /tmp/backup-sda.sfdisk
Restore
Code:
# dd if=backup-sda.mbr of=/dev/sda
# sfdisk /dev/sda < backup-sda.sfdisk
Quote:
Originally Posted by rknichols
You have to calculate that from the fields in the GPT header.
|
This
blog gives the solution as:
Code:
# dd if=/dev/sda of=/etc/gpt.bak bs=512 count=34 conv=notrunc
GPT is 34 LBA... This assumes LBA is 512bytes...
parted /dev/sda print or
fdisk -l /dev/sda should list the
sector/physical size.