Help on potential loss of the MBR by an OS re-install!!
FedoraThis forum is for the discussion of the Fedora Project.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Help on potential loss of the MBR by an OS re-install!!
Hi to all,
I have Win XP, FC5 with default kernel, and FC5 with a kernel of 220.127.116.11 my machine in my grub menu. The MBR is installed on the Win XP partition.
I'm having problems to boot in my Win XP but I can boot in my 2 Linux options. I will have to reinstall WinXP on the WinXP partiton and this will surely overwrite the current MBR. Then after I boot the PC, I will no longer find the Linux partitions.
How can I prevent this from happening? Do I have to backup the MBR before re-installing WinXP? how do we do the backup? Or do I overwrite the MBR and then use Linux rescure mode to retrieve the Linux partitions?
Can s.o please detail a procedure which I can follow to get this done?
My understanding is that the MBR is the very first sector on the hard drive (i.e. track 0, head 0, sector 1). The typical method that I use to retrieve and save that sector is using debug on a bootable MSDOS floppy disk. However, what I sense that you want to backup is a whole lot more than just the MBR.
Unless you deleted the partition that had XP on it, you don't need to reinstall.
title openSUSE 10.3 - 18.104.22.168-0.3
kernel /boot/vmlinuz-22.214.171.124-0.3-default root=/dev/disk/by-id/scsi-SATA_FUJITSU_MHU2100_NQ07T4825B7P-part6 vga=0x317 nolapic resume=/dev/sda2 splash=silent showopts
###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 10.3 - 126.96.36.199-0.3
kernel /boot/vmlinuz-188.8.131.52-0.3-default root=/dev/disk/by-id/scsi-SATA_FUJITSU_MHU2100_NQ07T4825B7P-part6 vga=normal showopts ide=nodma apm=off acpi=off noresume edd=off 3
###Don't change this comment - YaST2 identifier: Original name: windows###
Here is an example of my laptop's /boot/grub/menu.lst file. The last stanza is for booting windows. The device after "rootnoverify" may be different in your case. Look at the root (hdX,X) entry in your Linux stanza and use the same value for the Windows stanza. You can also enter these lines in the grub shell when you boot to test if it will work.
# grub.conf generated by anaconda
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,2)
# kernel /boot/vmlinuz-version ro root=/dev/hda3
# initrd /boot/initrd-version.img
title Fedora Core (184.108.40.206)
kernel /boot/vmlinuz-220.127.116.11 ro root=LABEL=/1 rhgb quiet
title Fedora Core (2.6.15-1.2054_FC5smp)
kernel /boot/vmlinuz-2.6.15-1.2054_FC5smp ro root=LABEL=/1 rhgb quiet
I dont want to lose the grub menu that I get upon booting, nor my Linux partitions.
If I re-install Win XP on my primary partition, I will lose the grub menu, and hence I wont be able to see and boot into my Linux partitions. How can I prevent that from happening?
If you are making no changes to partition structure on the drive, and no changes to your Linux installation, then the quickest and easiest thing to do is to make a copy of your MBR using the dd command.
Then after reinstalling Windows (why do you want to do that anyway? It is seldom necessary) you write the saved copy of the MBR back to the master boot record of the disk using dd. You will have to run a Linux Live CD or a Linux repair disk to do this, of course.
To copy the MBR, assuming your drive is sda, do this:
dd if=/dev/sda of=mybootimg.img bs=512 count=1
Then, to restore the mbr after reinstalling windows, do this:
I no longer get the grub menu from which we can choose the we want to boot in. So I booted from my FC5 installation disk (disk 1) and then pressed F5 (rescue mode). Then I types "linux rescue" at the prompt.
I choose the options for language and keyboard, and didnt install networking.
At the prompt, I issue
I get the following error:
chroot: cannot change root directory to /mnt/sysimage: No such file or directory
your rescue disk needs to be told to mount your drives and partitions. Otherwise it won't do it, and configures itself with a RAM-only installation. Alternatively, you mount your own drive using the mount command.
After you get your drives mounted, if you have more than one drive you will have to poke around a bit to make sure you know which drive is which in the rescue system. If you only have one drive, this point is moot.