Link to home
Start Free TrialLog in
Avatar of richardwilkins
richardwilkins

asked on

After removal of Linux hard drive, XP will not boot

I'm new to Linux and after installing CentOS on a second hard drive, grub.conf allows me to boot from either drive.  But when I removed the Linux HD, I got a message when trying to reboot with XP : "GRUB hard disk error" and it died.  Returning the HD brought back both OSes.

Can anyone help me to fix this?  Isn't there a way to temporarily alter the XP files to skip Grub?

Avatar of richardwilkins
richardwilkins

ASKER

And rebooting in XP I notice that there's nothing in autoexec.bat and boot.ini has only the XP system.  Where is the Grub coming from when booting?
Avatar of Cyclops3590
you have to do a
fdisk /mbr
but that would overwrite the grub loader so you wouldn't be able to get to the CenOS installation after that.
As far as I understand it, the system will only go to one hard drive (i'm sure there are system out there that can look at multiple hard drives, but most PCs don't do that; not that i'm aware of anyway) for the boot sector on the primary hard drive.  This record is most likely pointing to the second hard drive looking for the rest of the grub loader and cannot see it.

why do you want to remove the hard drive anyway if you already have dual boot configured.
Got to go to the office tomorrow, but what is the fdisk/mbr command in XP?  I've tried it and it doesn't work at all.  In answer to your question,  I need to know how to do this as we don't have that many computers to play with.

Sincerely, we want to know how to do these things.
In Windows XP, you can uninstall GRUB as follows:

Boot from the Windows XP CD and press the "R" key during the setup in order to start the Recovery Console. Select your Windows XP installation from the list and enter the administrator password. At the input prompt, enter the command "FIXMBR" and confirm the query with "y". The MBR will be rewritten and GRUB will be uninstalled. Press "exit" to reboot the computer.

This is from:

http://portal.suse.com/sdb/en/2002/09/fhassel_deinstall_grub.html


Just noticed, you wrote something about "temporarily skipping GRUB".
Well if you remove your second harddisk,
the GRUB as it has been set up for booting
both harddisks won't be usable any longer
anyway. If for any reason you'd like to
use GRUB as it was, again, at a later time
then I recommend to put GRUB with it's recent
configuration onto a floppy before you fix your
master boot record (which is the place on first HD where
your GRUB resides at the moment).

By the way, the error message, that you get
after having removed the second HD, is simply
because GRUB needs to load 1.5 & 2.0 stage
loader information from the Linux OS on second HD.
So, since GRUB can't determine second HD, it
generates that error message.


i could be wrong but what i said about "fdisk /mbr" and xberry said about "fixmbr" are the same thing.  It just has XP overwrite the boot sectore with XP's boot loader. but you do this by going to the recovery console the same way like xberry described.  

Also, you can't uninstall a boot record, you can only overwrite it.  Kinda like you can't uninstall the formatting of a partition.  You can only overwrite the formatting with new formatting.
Hi Cyplops,

> i could be wrong but what i said about "fdisk /mbr"

as you pointed, did the same thing (Rewriting mbr)
using the 'good old' DOS tools. ; ))
However as far as I know
you can USE the DOS fdisk /mbr command only with older Windows OS versions, but
not with Windows XP or Windows 2000, since
they format the HD in a way which can't be modified by DOS fdisk,
at least I've never heard that possible. So with XP & 2000
he should try the way suggested. (By the way, similiar problem has been solved before, I only
had to copy/paste from my own answering history (Hehehe ;)) :

https://www.experts-exchange.com/questions/21067077/Removed-Red-Hat-but-Grub-still-resident.html
SOLUTION
Avatar of Cyclops3590
Cyclops3590
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Adding here:
So, before ending up with possible conflicts
when having master boot on two HD's, to overcome possible MBR conflicts or
avoiding the update business
then why not simply migrate the GRUB boot loader completely on to one single
boot floppy & have booting your system from it until you decide which configuration
to keep.  
Well, I certainly appreciate the advice you all are giving.  It will be a while before I can go back and try some of these things, but I have one very basic question:  I have successfully formated a couple of floppies in Linux, but simply do not know exactly how to copy GRUB and its current configuration to one.  Can any of you help me, maybe in baby talk?
I just now gave a try to booting with, first XP, and got the same message rich got.  Then I connected the Linux HD and got a similar message, "missing operating system".    Reconnectisng both was OK.

So I'm wondering, why you want to do this anyway, particularlysince is seems so difficult to recover both operating systems.   And after reading xberry's comment,  "why not simply migrate the GRUB loader completely on to one single boot floppy" would you tell us how to create a bootable floppy on which to migrate Grub boot loader to?

For the GRUB-floppy:

Login as superuser

Then simply:

# grub-install /dev/fd0

which puts GRUB on your floppy drive, using the grub shell.

BEWARE: This is only saving you from using GRUB from the master boot record on harddisk, so after GRUB won't exist on MBR of harddisk any longer
(let's say for your purpose of removing one HD and booting XP in standard mode) then you'll later still be able to boot your original configuration
(dual boot on two disks) as was. THOUGH, IF you would modify your Linux System on second HD in a way that GRUB won't be able to locate
and read root system/boot information any longer (changing filesystem partitions, reinstalling, . . .) then you won't get anywhere with your GRUB floppy.
. . . So if you do need to do any boot modifications in your Linux while logged in (for instance modifying your grub/menu.lst) then it would be a good idea
to rerun the grub-installer for your floppy.

You may get more info about GRUB from your Linux console:

# info grub


 
This is what I get:

Wonder why!

[root@localhost ~]# grub-install /dev/fd0
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

# this device map was generated by anaconda
(fd0)     /dev/fd0
(hd0)     /dev/hda
Try if it works
Sorry jbfstplk,

was a bit in a hurry yesterday, so only did look at your posting in a flick of a moment,
what I actually thought was you could simply see if booting from your GRUB floppy works already.
ONE thing I did miss though:  in the device map generated, there is only one harddisk recognized
(hda), but of course you do have two HD's, so that can't be right then.

When it says "unknown partition table signature" I strongly assume that it does refer to
your second harddisk, that's why it isn't mentioned in the device map any more.

So I wonder what you actually did change ? Did you only remove your HD from IDE slot & put it back exactly as it was
or did you do anything else to it or your operating system ? Hopefully you didn't swap the IDE position physically,
cos that's what Windows wouldn't like: Windows & Linux only cooperate together as dual boot, if Windows can have the
IDE one (Windows on hda, first disk) . . .  
xberry, I certainly appreciate your efforts to assist me and richard, too.  But it is so complicated that I'm going to leave both drives in the test machine, and continue to research and study Linux.

And I notice that richard has not responded, making me recommend that, unless he has been successful that he do the same.  My machine works in both OSes just fine.  When I get more familiar with Linux, I will post my own questions.

Joe
> But it is so complicated

Well, we certainly should have left it with the original issue . . .  Cyclops3590 and I tried to give some more
insight & additional ideas   . . . but -  this is my experience - anything around the boot process
needs just lots of knowledge & understanding starting form hardware involved, including the BIOS, up to the levels where
the OS related issues fit into the whole puzzle -

i recommend - if you like and have some time then read anything about GRUB . . . !

 
. . .  
I'm just too new to Linux to really get deep into these things, but I did appreciate the work of you three.  The issues between xberry and jbfstplk were helpful to me and have resulted in my stopping my current effort to remove either of the two drives.

Thanks much!