GRUB not loading / boot.ini file does not show Linux anymore
Linux - Laptop and NetbookHaving a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).
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.
GRUB not loading / boot.ini file does not show Linux anymore
I have a dell laptop that was configured with WinXP and Redhat Linux 9.0 and working fine until recently. My windows registry got corrupted, so I had to reinstall a parallel copy of windows on the C drive. It worked fine, and I could still see grub during startup to choose between Linux and Windows, and then could choose from the 2 different Windows installations on the next screen.
However, during automatic updates (Probably SP2) of the new Windows, my boot.ini file changed and now grub does not load during startup anymore. It goes straight to Windows, and only allows me to choose from the 2 XP installations. My boot.ini file has a recent timestamp (I didn't change anything), so I'm guessing something in Windows changed that file. Here's what it looks like right now:
multi(0)disk(0)rdisk(0)partition(2)\WINXP="Microsoft Windows XP Home Edition" /fastdetect /NoExecute=OptIn
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Home Edition" /fastdetect
Simply a matter of chroot'ing into /mnt/sysimage (???) and running the grub-install again I would think.
Rescue mode in RH might even have an option to do it for you - don't know.
With what you want to achieve, you'd need to install to the (root) partition and copy of the boot sector record again as you obviously did previously.
And you'll have to do it after every Windows upgrade/update/restore.
Spend some time using "Search" - has been covered heaps of times.
Since you mentioned the BOOT.INI file, I assume that you would have a windows menu when booting, One item referring to Linux. In other words, you are using NTLDR to chainload linux, rather than writing the Grug bootstrap loader to the MBR.
The BOOT.INI file is only a text file. You could re-enter the line that selects the grub bootsrap image file (around 240 bytes long, but the file name is arbitrary) using edit. You need to temporarily reset the System, Hidden properties to edit it.
Like I said, the filename might be different than "linux.bin", but if your old files weren't completely wiped out, the name will luckily be similar.
Otherwise, you will need to boot up with a rescue disk or a live disk and examine your old configuration to see which partition the loader was saved to, the resave the bootstrap to a file, and copy it to the C:\ partition.
I think jschiwal is only half right, you were using GRUB to boot and now thats been nuked. What you can do is get a copy of Knoppix or similar live cd and boot it, mount your / partition then go to the boot directory and copy the kernel file , looks something like vmlinuz-2.6something, copy it to the 2GB FAT file and name it linux.bin.
Now reboot into XP copy the linux.bin file to the C drive then right click on My Computer open properties->advanced->Startup and Recovery->settings->edit
This will open boot.ini for edit then add the line that from jschiwal post above save the changes and reboot, you should now be able to boot into linux and if you wish do a grub-install and you are back to were you started from with a backup incase GRUB gets nuked again
I have never heard of having the kernel reside on the windows C:\ drive. The linux.bin file would simply load the first part of the grub boot loader. The actual grub loader is probably located on the root drive or the boot partition. The information to boot the computer is probably located in /boot/grub/menu.lst and other files in /boot.
Using grub has an advantage. Once grub is loaded, even if it should be reinstalled because of repartitioning, you can enter the grub command mode and use auto completion to finish booting up to linux. Then reinstall grub so it works properly the next time.
Thanks to all who helped. After a lot of searching and asking around, I have it working again, and am posting this message from Linux
Since I used to have GRUB on the MBR which got overwritten when Windows was installed again, it was simply a matter of repairing GRUB and installing it on the MBR. The rest of the settings were already in place, including the menu.lst file which gave me the options of Windows & Linux. So I booted using the Linux cd in rescue mode, and typed the following commands - worked like a charm.
to start grub shell
type: find /boot/grub/stage1
to find the boot partition, use output of this command as input to the next one
type: root (hd0,6)
to tell grub where the boot partition is. Note: substitute (hd0,6) with output of previous command
type: setup (hd0)
to install GRUB on MBR of hd0
when I restarted, the familiar GRUB screen was back!
Originally posted by jschiwal I have never heard of having the kernel reside on the windows C:\ drive. The linux.bin file would simply load the first part of the grub boot loader.
In this case the file linux.bin IS the linux kernal you want to boot rather than GRUB. It has the useful feature that you don't have to overwrite your MBR and all the booting is done thru Windows. You can have both setups if you wish, have GRUB in the MBR and boot from it, then if you boot into windows you will see the option to boot linux so if GRUB ever gets nuked again you have a backdoor to linux already
I used this particular setup on a work's Windows2000 setup where I didn't want to mess with the MBR but wanted to dual boot a Mandrake distro
quote from Donny
It has the useful feature that you don't have to overwrite your MBR
The chain loading technique with the 240 byte linux.bin file also doesn't change the MBR. The NTLDR transfers control to the Lilo/Grub loader. The Lilo/Grub loader is installed on a Linux partition. The windows MBR is not touched.
I don't know if the kernel can load itself from an NTFS file system. Also, if you update the kernel, you need to copy to the file to the C:\ directory on an ntfs file system. For a file as large as the kernel, when Linux doesn't have write access to the C:\ drive, and Windows XP doesn't read the Linux partitions, this isn't the easiest task. A common fat32 partition is needed.
Also, the configuration of the system, such as the /sbin/mkinitrd script, probably assumes that the kernel is located in the /boot partition. I find that it is usually best to work with a system rather than fighting it.
There really wouldn't be any additional benefit gained by doing it this way.