[GLLUG] Backing up the MBR with DD

Lachniet, Mark mlachniet at sequoianet.com
Fri Sep 19 14:12:04 EDT 2003


I don't recall anyone pointing this out explicitly, but you can back up your MBR by using DD to grab the first 512 bytes of your HD.  This is what Lilo does when it makes a backup.  you can restore it the same way..  I found the following to cut-n-paste below.  I believe it is correct.  If you can find the original MBR backup (a 512 byte funny file in your /boot or lilo directory probably) you might be able to restore it that way.
 
Once you have Linux running you can save the boot record with the
command:

  dd if=/dev/hda of=/boot/boot.MBR bs=512 count=1

It can then be restored with:

  dd if=/boot/boot.MBR of=/dev/hda bs=512 count=1

or if you do not want/need to overwrite the partition table with:

  dd if=/boot/boot.MBR of=/dev/hda bs=446 count=1

as the partition table is kept in the last 66 bytes of the MBR.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 4026 bytes
Desc: not available
Url : http://www.egr.msu.edu/archives/public/linux-user/attachments/20030919/28d11ccc/attachment.bin


More information about the linux-user mailing list