Backup and Restore Master Boot Record (MBR)
This document (7014702) is provided subject to the disclaimer at the end of this document.
Environment
Situation
A master boot record (MBR) is a special type of boot sector at the very beginning of partitioned computer mass storage devices like fixed disks or removable drives. It is the first sector of the computer hard drive that tells the computer how to load the operating system, and how the hard drive is partitioned.
Resolution
Backing up the MBR:
dd if=/dev/sda2 >/backup/mbr bs=512 count=1
Restore backup MBR:
If the system will not boot up saying that there is "No operating system found"
then
1) Reboot with the SLES11 SP2 rescue (installation) disk.
2) Choose "rescue system"
3) login as root
4) Mount the /backup disk:
mount /dev/sdb1 /mnt
5) Make a new mount point:
mkdir /old_boot
6) Mount the old root/boot partition:
mount /dev/sda2 /old_boot
7) Copy the backed up MBR into the same spot as the old MBR:
dd if=/mnt/mbr of=/dev/sda2 bs=512 count=1
the screen will show:
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.000393389 s, 1.1 MB/s
(the speed will be different)
Then reboot the machine
init 6
System boots up correctly
Additional Information
A test can be made on a test system to see how it works. Do not run it on a production system.
After making the backup but before restoring run:
dd if=/dev/zero of=/dev/sda2 bs=512 count=1
to effectively overwrite the MBR. Then reboot the system.
The system comes up and says "Error No operating system found"
Then follow the steps to restore the MBR.
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:7014702
- Creation Date: 05-Mar-2014
- Modified Date:03-Mar-2020
-
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com