LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having 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).

Notices


Reply
  Search this Thread
Old 10-20-2005, 02:17 PM   #1
jeetasher
LQ Newbie
 
Registered: Jul 2004
Posts: 6

Rep: Reputation: 0
GRUB not loading / boot.ini file does not show Linux anymore


Hi,

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:

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(2)\WINXP
[operating systems]
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


My single disk is partitioned as follows:

Primary
31 MB FAT - Dell Utility
35 GB NTFS - C Drive
Extended
2 GB FAT - Common Win/Linux partition
2 GB (nknown) - Probably swap?
18 GB (unknown) - Probably Linux boot?

Can someone please help me reconstruct my boot.ini (and/or any other files needed), so I can get access to grub and linux again?

Thanks
Jeet
 
Old 10-20-2005, 02:27 PM   #2
Keruskerfuerst
Senior Member
 
Registered: Oct 2005
Location: Horgau, Germany
Distribution: Manjaro KDE, Win 10
Posts: 2,199

Rep: Reputation: 164Reputation: 164
Hello!

Just use your DVD or CD'1 to boot your installed linux.

Then repair grub.

Windows overwrites the MBR without asking the user.

Greetings
 
Old 10-20-2005, 04:57 PM   #3
jeetasher
LQ Newbie
 
Registered: Jul 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks.

I'm able to boot with the CD by typing 'linux rescue' but then I'm not sure what to do once it puts me in the command prompt. Can anyone outline the steps to fix the MBR and get GRUB going again?

Jeet
 
Old 10-20-2005, 05:57 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 20,756

Rep: Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973
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.
 
Old 10-20-2005, 06:45 PM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681
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.

Here is a sample BOOT.INI file:
Code:
[boot loader]
timeout=5
default=multi(0)disk(0)rdisk(0)partition(1)\WINNT
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Professional" /fastdetect
c:\linux.bin="Linux"
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.
 
Old 10-21-2005, 04:38 AM   #6
Dommy
Member
 
Registered: Jul 2004
Location: Canberra
Distribution: Mint 7
Posts: 204

Rep: Reputation: 30
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
 
Old 10-21-2005, 05:06 PM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681
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.
 
Old 10-21-2005, 09:28 PM   #8
jeetasher
LQ Newbie
 
Registered: Jul 2004
Posts: 6

Original Poster
Rep: Reputation: 0
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.

type: grub
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
type: quit

when I restarted, the familiar GRUB screen was back!
 
Old 10-21-2005, 09:36 PM   #9
jeetasher
LQ Newbie
 
Registered: Jul 2004
Posts: 6

Original Poster
Rep: Reputation: 0
More info available at

http://www.sorgonet.com/linux/grubrestore/
http://www.computing.net/linux/wwwbo...rum/26916.html
 
Old 10-22-2005, 03:09 AM   #10
Dommy
Member
 
Registered: Jul 2004
Location: Canberra
Distribution: Mint 7
Posts: 204

Rep: Reputation: 30
Quote:
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
 
Old 10-22-2005, 03:27 AM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 20,756

Rep: Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973
Damn, don't you hate it when you mis-read a request.
I thought you wanted to use ntldr - ooops.
 
Old 10-22-2005, 04:21 AM   #12
Dommy
Member
 
Registered: Jul 2004
Location: Canberra
Distribution: Mint 7
Posts: 204

Rep: Reputation: 30
Quote:
Originally posted by syg00
Damn, don't you hate it when you mis-read a request.
I thought you wanted to use ntldr - ooops.
Please Explain *said in screechy voice* who was this comment aimed at?
 
Old 10-22-2005, 04:32 AM   #13
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 20,756

Rep: Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973
Quote:
Originally posted by Dommy
who was this comment aimed at?
Me.
I thought the OP wanted to use ntldr, but (s)he obviously didn't.

Oh well - I'll have to stop posting (late) at night.
 
Old 10-23-2005, 02:45 AM   #14
Dommy
Member
 
Registered: Jul 2004
Location: Canberra
Distribution: Mint 7
Posts: 204

Rep: Reputation: 30
Fair enough, I get the same affect after a bottle of red
 
Old 10-23-2005, 06:50 PM   #15
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681
Quote:
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding GRUB to boot.ini help req shandy Linux - Software 12 10-18-2005 10:56 AM
Using dual boot with boot.ini and grub? Darrell22 Programming 1 12-07-2004 05:26 PM
dual boot system doesn't show anymore kyttycat Linux - General 4 04-13-2004 04:37 AM
grub.conf and boot.ini billygotee Linux - Newbie 2 11-26-2003 10:53 AM
problem booting via boot.ini and linux.bin file onlyhuman9 Linux - General 5 09-18-2002 07:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook

All times are GMT -5. The time now is 06:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration