Linux Backup Restore Destroy and Install MBR - Master Boot Record
Last Updated on Friday, 09 April 2010 08:41
| Article Index |
|---|
| 1. BACKUP MBR |
| 2. RESTORE MBR |
| 3. DESTROY MBR |
| 4. INSTALL MBR |
Here are some usefull hints on how to Backup Restore Destroy and Install MBR on linux. If the need comes to backup, restore and destroy your MBR you can use a dd command to do that job. First we need to find find our storage device to backup MBR. To do that use a command:
fdisk -l
Let's assume that the storage device we want to work with is /dev/hdb.
WARNING: DO NOT COPY AND PASTE COMMANDS FROM THIS PAGE UNLESS YOUR DEVICE IS ALSO /dev/sdb !!
1. BACKUP MBR
To backup Master Boot Record ( MBR ):
# dd if=/dev/sdb of=my.mbr bs=466 count=1
where my.mbr is a file where we would like to store our MBR backup.
2. RESTORE MBR
To restore a MBR we need to just switch the order of input and output files.
# dd if=my.mbr of=/dev/sdb bs=466 count=1
3. DESTROY MBR
If you from any reason want to destroy your MBR us as a input file /dev/zero:
# dd if=/dev/zero of=/dev/sdb bs=466 count=1
4. INSTALL MBR
Installing MBR can be very useful especially when creating linux USB boot sticks. To install MBR from scratch we can use install-mbr command found in mbr package:
# install-mbr /dev/sdb















