Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Linux and Unix
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory modem monitor motherboard network printer problem ram registry router security slow software sound toshiba trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > Linux and Unix >
Restore Windows XP MBR...

Reply  
Thread Tools
helpneeded!'s Avatar
Junior Member with 18 posts.
 
Join Date: Jun 2006
03-Jul-2006, 04:29 PM #1
Restore Windows XP MBR...
OK, I know that you can boot from XP and use fix mbr to restore the orignal boot record.

But say, for example, you have:

1 XP, 3 Linux OS's
and you want to remove the 2nd Linux one; if you use fix mbr - that will only recognise the windows partition... so u lost the other 2 Linux distros you wanted to keep!

so how do you go about removing 1 Linux distro from the MBR whilst mainting integrity of it!?


I think you have to do it from Linux distro before u delete it by:

lilo -u
grub -u

?


Advice is apprecaited

Thanks
Squashman's Avatar
Trusted Advisor with 18,706 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: Bocks of Rox
03-Jul-2006, 06:34 PM #2
Is your bootloader Grub or Lilo. Just edit the appropriate Conf file for either one of them.
helpneeded!'s Avatar
Junior Member with 18 posts.
 
Join Date: Jun 2006
03-Jul-2006, 07:11 PM #3
grub -

cool - so if I edit the .conf file I can choose what OS's to show at the boot!?

Is this the normal method of doing it in Linux (noooooooob )
saikee's Avatar
Senior Member with 3,409 posts.
 
Join Date: Jun 2004
Location: Newcastle
Experience: A Linux user gone nuts on multi-boot
04-Jul-2006, 07:26 AM #4
Edit /boot/grub/menu.lst of the Linux you have selected to take over the MBR.

Just put "#" in front of the relevant lines for the Linux you don't want to see.

A cooler method is to install a new distro on the unwanted partition.

My last link of the signature documents the restoration of Windows MBR, Lilo or Grub.

Last edited by saikee; 04-Jul-2006 at 09:12 AM..
lotuseclat79's Avatar
Distinguished Member with 21,345 posts.
 
Join Date: Sep 2003
Location: -71.45091, 42.27841
08-Jul-2006, 12:57 PM #5
Hi saikee,

I have saved the MBRs of my dual-boot Linux and WinXP Pro SP2 (each on separate disks) with the use of the dd command on my Linux machine as follows:

dd if=/dev/sdb of=sdbmbr bs=512 count=1 # to save the Linux disk MBR
dd if=/dev/sda of=sdambr bs=512 count=1 # to save the WinXP Pro SP2 MBR

Since the grub boot loader is contained in the WinXP Pro SP2 disk (hd0), when I attempt a WinXP Pro SP2 Repair Install from the orginal OEM CD and then reinstall the Windows updates applied since the initial installation - will the Linux MBR or grub boot loader be lost? How can I insure that it will not be touched?

If either the Linux MBR or grub boot loader were lost because of the WinXP Repair install, if I write the saved original MBR files to a CD-RW disc from Linux before attempting the Repair Install - and only the WinXP Pro SP2 were bootable after the Repair Install is there a way to write back the original MBRs to both disks from WinXP Pro SP2 to correct the situation? Would that correct the situation as posed or would it not work?

Case 1: If grub boot loader is lost (on the WinXP Pro SP2 disk) as a consequence of the XP Repair Install, how do I get it back without mucking up the XP Repair Install, or insure that it is not mucked up by the XP Repair Install?

Case 2: If the grub boot loader is not lost, but the Linux MBR boot information (hd1) is munged for some reason, how do I repair it from WinXP Pro SP2?

Note: I only have a 56k dial-up so download of a 700MB Live CD from Knoppix or Ubuntu is not practical. I have seen the Ubuntu will send you a Live CD for free, but it takes 4-6 weeks which is longer than I really want to wait. Also, my WinXP Pro SP2 is NTFS formatted, and I will not be changing it so I don't lose any data otherwise during the Repair Install.

Tia,

-- Tom
__________________
The independence created by philosophical insight is - in my opinion - the mark of distinction
between a mere artisan or specialist and a real seeker after truth. - Einstein 1944
Imagination is more important than knowledge. - Einstein
saikee's Avatar
Senior Member with 3,409 posts.
 
Join Date: Jun 2004
Location: Newcastle
Experience: A Linux user gone nuts on multi-boot
09-Jul-2006, 10:53 AM #6
lotuseclat79,

Linux is a lot easier to be rescued and so its boot loader too, be it a Grub or a Lilo.

For both Case 1 & 2 you can boot up any Live CD, say one you pick up from a Linux magazine, make a temporary directory in its /mnt, mount the Linux you want to rescue and change root into it. Thereafter you will be inside that Linux.

To restore its boot loader back into the MBR just issue at the root terminal the command
Code:
grub-install /dev/sda
Let say the Linux in sdb1 has been lost after you restore Windows MBR and yopu want it back. The step in root terminal (type su first to become the superuser or root first as you need root privilege for altering the system files) after booting to a Live Cd are
Code:
mkdir /mnt/temp
mount /dev/sdb1 /mnt/temp
chroot /mnt/temp
grub-install /dev/sda
exit
reboot
In place of the grub-install command you can also achieve the same result by activating a Grub shell by
Code:
grub
root (hd1,0)
setup (hd0)
The idea being you tell Grub what is the "root" of the Linux first and instruct Grub to install that boot loader into the first bootable disk, which is sda in Linux term or (hd0) in Grub term.

The Grub shell is more robust and seldom fails whereas the "grub-install" Linux command can be temperamental in some situations.

If you have not restore the Windows MBR yet and still have the Linux working then you can also save the boot loader into a floppy by
Code:
grub-install /dev/fd0
Equally in a Grub shell you do the setup with device fd0
Code:
setup (fd0)
This floppy provide a full HD-version of the boot loader and has more than just the first 512 bytes of the MBR you have saved in your post #5
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 10:31 PM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.