2015-10-16

[SOLVED]Back up the MBR (Master Boot Record)

#10:41 17/09/2015
#http://www.inference.phy.cam.ac.uk/saw27/notes/backup-hard-disk-partitions.html

#Backing up the MBR (Master Boot Record)
#######################################

#If you save copies of some or all of your partitions individually, and want to be able to use them to restore a working system, you'll also need to backup and restore the MBR and partition table. (The same caveats apply as discussed above about whether partition tables can be restored onto a disk of a different size).
#Backing up the MBR:'
root@fw /opt/bk-data# dd if=/dev/sda of=backup-of-sda-mbr count=1 bs=512



#This stores the first 512 bytes of the disk (contianing the MBR and the primary partition info - i.e. the first four primary entries) into the file "bcakup-of-hda-mbr" which you can then copy to somewhere safe.

#To restore (be careful - this could destroy your existing partition table and with it access to all data on the disk):
dd if=backup-of-sda-mbr of=/dev/sda


#If you only want to restore the actual MBR code and not the primary partition table entires, just restore the first 446 bytes: dd of=/dev/hda if=backup-of-hda-mbr bs=446 count=1. (Those first 512 bytes are 446 bytes of MBR, then 64 bytes of primary partition table).

#END

No comments:

Post a Comment