Linux: How to backup hard disk partition table (MBR)
If you don't want to take any chances with your data, it is recommended that you backup hard disk partition table. Last Friday I was discussing some issues with one of our customer and he pointed out me dd command.
Backup MBR with dd command
dd the old good command which now backup partition tables even writes CDs ;). 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
dd command works with Solaris, HP-UX and all other UNIX like operating systems. Read man page of dd for more info.
You may also be interested in other helpful articles:
- Re-read the partition table without rebooting Linux system
- Linux Creating a Partition Size Larger than 2TB
- nixCraft FAQ roundup
- Download of the day: Super Grub Disk to fix Windows and Linux boot problems
- Knoppix Linux rescue: Four Tough Lessons of System Recovery
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: backup_hard_disk, dd_command, disk_partition, master_boot_record, mbr, partition_table



Recent Comments
Yesterday ~ 24 Comments
Yesterday ~ 24 Comments
Yesterday ~ 3 Comments
Yesterday ~ 2 Comments
09/05/2008 06:08 pm (2 days ago) ~ 16 Comments