Search This Blog

Sunday, March 22, 2009

Back up your MBR

Backup MBR with dd command

Backing up partition is nothing but actually backing up MBR (master boot record). The

command is as follows for backing up MBR stored on /dev/sdX or /dev/hdX :
# dd if=/dev/sdX of=/tmp/sda-mbr.bin bs=512 count=1

Replace X with actual device name such as /dev/sda.

Now to restore partition table to disk, all you need to do is use dd command:
# dd if= sda-mbr.bin of=/dev/sdX bs=1 count=64 skip=446 seek=446

NJOI:)