Difference between revisions of "HowTo Backup And Restore The Master Boot Record (MBR)"

From NST Wiki
Jump to navigationJump to search
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
This '''HowTo''' shows how to use the '''[http://en.wikipedia.org/wiki/Dd_%28Unix%29 dd]''' utility to '''backup''' and '''restore''' the '''[http://en.wikipedia.org/wiki/Master_boot_record Master Boot Record (MBR)]'''.
 
This '''HowTo''' shows how to use the '''[http://en.wikipedia.org/wiki/Dd_%28Unix%29 dd]''' utility to '''backup''' and '''restore''' the '''[http://en.wikipedia.org/wiki/Master_boot_record Master Boot Record (MBR)]'''.
  
* '''Note:''' This '''HowTo''' assumes that the '''[http://en.wikipedia.org/wiki/Master_boot_record MBR]''' to '''backup''' and '''restore''' is located on: "'''sda'''".
+
* '''Note:''' This '''HowTo''' assumes that the '''[http://en.wikipedia.org/wiki/Master_boot_record MBR]''' to '''backup''' and '''restore''' is located on disk: "'''sda'''".
  
  
* '''Backup the '''[http://en.wikipedia.org/wiki/Master_boot_record MBR]''' to "'''/var/nst/backup/mbrbackup'''":
+
* '''Backup''' the '''[http://en.wikipedia.org/wiki/Master_boot_record MBR]''' on disk: "'''sda'''" to file: "'''/var/nst/backup/mbrbackup'''"  
 
<div class="screen">
 
<div class="screen">
 +
<div class="userInput"><span class="prompt">[root@probe ~]# </span>mkdir -p /var/nst/backup</div>
 
<div class="userInput"><span class="prompt">[root@probe ~]# </span>dd if=/dev/sda of=/var/nst/backup/mbrbackup bs=512 count=1</div>
 
<div class="userInput"><span class="prompt">[root@probe ~]# </span>dd if=/dev/sda of=/var/nst/backup/mbrbackup bs=512 count=1</div>
 
  <pre class="computerOutput">
 
  <pre class="computerOutput">
Line 14: Line 15:
 
</pre>
 
</pre>
 
</div>
 
</div>
 +
 +
 +
 +
* '''Restore''' the '''[http://en.wikipedia.org/wiki/Master_boot_record MBR]''' from file: "'''/var/nst/backup/mbrbackup'''" on to disk: "'''sda'''"
 +
<div class="screen">
 +
<div class="userInput"><span class="prompt">[root@probe ~]# </span>dd if=/var/nst/backup/mbrbackup of=/dev/sda bs=512 count=1</div>
 +
<pre class="computerOutput">
 +
1+0 records in
 +
1+0 records out
 +
512 bytes (512 B) copied, 4.6066e-05 s, 11.1 MB/s
 +
[root@probe ~]#
 +
</pre>
 +
</div>
 +
 +
It is a good idea to save the backed up '''[http://en.wikipedia.org/wiki/Master_boot_record MBR]''' file to removable storage like a '''USB''' flash drive.

Latest revision as of 11:02, 26 October 2009

This HowTo shows how to use the dd utility to backup and restore the Master Boot Record (MBR).

  • Note: This HowTo assumes that the MBR to backup and restore is located on disk: "sda".


  • Backup the MBR on disk: "sda" to file: "/var/nst/backup/mbrbackup"
[root@probe ~]# mkdir -p /var/nst/backup
[root@probe ~]# dd if=/dev/sda of=/var/nst/backup/mbrbackup bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 5.6701e-05 s, 9.0 MB/s
[root@probe ~]#


  • Restore the MBR from file: "/var/nst/backup/mbrbackup" on to disk: "sda"
[root@probe ~]# dd if=/var/nst/backup/mbrbackup of=/dev/sda bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 4.6066e-05 s, 11.1 MB/s
[root@probe ~]#

It is a good idea to save the backed up MBR file to removable storage like a USB flash drive.