Friday, July 10, 2009

backup and restore MBR

Partition Table backup

Perform the following command to backup the partition table:
sfdisk -d /dev/hdx > /part/to/pt_info.sfdisk



Partition Table restore

Perform the following command to restore the partition table:
sfdisk -d /dev/hdx < /part/to/pt_info.sfdisk



MBR backup

Perform the following command to backup the MBR:
dd if=/dev/hdx of=/path/to/image count=1 bs=512



MBR restore

Perform the following command to restore the MBR:
dd if=/path/to/image of=/dev/hdx count=1 bs=446

Notice that you need to include the option "count=1 bs=446", otherwise your partition table will be overwritten.

No comments:

Post a Comment