LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Boot loader woes (https://www.linuxquestions.org/questions/linux-software-2/boot-loader-woes-477134/)

yitzle 08-24-2006 09:31 PM

Boot loader woes
 
And again.
I got 2 hard drives.
#1: ext3 (grub?), fat32 (was Win98), ntfs (WinXP) - (in that order)
#2: ext3 (Ubuntu), ...

#2 is a recent addition and the (primary?) slave.
I installed Ubuntu. GRUB took over the MBR.
I want to move GRUB to #1 so I can pull #2 out.
So... I made the ext3 on #1 by moving over the fat32. Then I copied the /boot from Ubuntu (#2) to #1 ext3.
Then I ran grub-install /dev/hda3 (that's the ext3 as per the disk manager software)
Yet when I pull out the #2, I get GRUB 1.5 Error 21 (unexpected error).

Um... I want it to work!
Any advice (please)?

JZL240I-U 08-25-2006 04:41 AM

Could you please post the /boot/grub/menu.lst?

pixellany 08-25-2006 06:52 AM

You say that GRUB took over the mbr---In a normal install, GRUB would most likely have gone on the first disk--unless you told it to do something different.

You say you want to "pull out #2"---Are you going back to having just one drive?

I dont understand "grub-install /dev/hda3"---you want grub in the mbr--not a partition. Also it is better to install grub from the grub command prompt. See the grub manual.

Tailer 08-25-2006 07:21 AM

This case is very wired...
If you have a floppy drive you can try to install the loader on it, because the problem may be about windows. It can happened that windows destroyed my linux loader...

yitzle 08-25-2006 10:21 AM

menu.lst (without the commented lines)
Code:

default                4

hiddenmenu

title                Ubuntu, kernel 2.6.15-23-386
root                (hd1,0)
kernel                /boot/vmlinuz-2.6.15-23-386 root=/dev/hdb1 ro quiet splash
initrd                /boot/initrd.img-2.6.15-23-386
savedefault
boot

title                Ubuntu, kernel 2.6.15-23-386 (recovery mode)
root                (hd1,0)
kernel                /boot/vmlinuz-2.6.15-23-386 root=/dev/hdb1 ro single
initrd                /boot/initrd.img-2.6.15-23-386
boot

title                Ubuntu, memtest86+
root                (hd1,0)
kernel                /boot/memtest86+.bin
boot

title                Other operating systems:
root

title                Windows NT/2000/XP (loader)
root                (hd0,0)
savedefault
makeactive
chainloader        +1

Device Map:
Code:

(hd0)        /dev/hda
(hd1)        /dev/hdb

You say that GRUB took over the mbr---In a normal install, GRUB would most likely have gone on the first disk--unless you told it to do something different.
I originally installed Ubuntu to the second disk, so I would assume that is where GRUB got installed. Yet when I boot up the PC, GRUB is the active boot loader, so GRUB obviously is in the MBR.

I then created an ext3 on the first drive and copied the /boot to it and ran 'grub-install /dev/hda3', so GRUB is also installed to #1...

When I boot with #2 removed, I get "GRUB loading stage1.5. GRUB loading, please wait... Error 21", so GRUB stage 1 is on the first drive. Is it possible that stage 1.5 is not on the #1? Or is it possible that since some of the options from menu.lst are on #2 and #2 is unplugged is cuasing the problem? Or that the fact that the device map has a drive that's unplugged is the trouble?

Um, what is the MBR? Is it on the HD of in the CMOS?

You say you want to "pull out #2"---Are you going back to having just one drive?

I want to be able to use it an a removable drive - plug and unplug it at will.

I dont understand "grub-install /dev/hda3"---you want grub in the mbr--not a partition. Also it is better to install grub from the grub command prompt. See the grub manual.

grub-install requires a grub-device as the parameter... I thought that's where the /boot/grub is located, i.e. on the first partition of the first drive...
Am I supposed to run 'grub-install /dev/hda'?
I guess I'm gonna have to read the manual, eh? I didn't know there was a grub shell.

If you have a floppy drive you can try to install the loader on it, because the problem may be about windows. It can happened that windows destroyed my linux loader...
Erm... I'm looking for a long term solution. And I think its a problem with what I'm doing with GRUB, not WIndows.

lordtweety 08-26-2006 08:32 AM

Quote:

Um, what is the MBR? Is it on the HD of in the CMOS?
Master Boot Record, hidden sector of your hard drive, your computer reads this first and follows whatever instructions are there. Both of your hard drives will have one. The one the computer readss first is determined by the Pri/Slave Sec/Slave settings on the drives. Or the Cable positioning if you haven't set the jumpers on the different drives.

JZL240I-U 08-28-2006 01:37 AM

[the nonsense of my first shot deleted -- in case you were there fast]

You need to re-install the entire GRUB. Usually there is a repair function on the discs (at least SuSE does have one). So pop in #1 of your installation discs, choose repair -> repair boot loader. Install GRUB in /dev/hda3 and the loader in the MBR (don't worry, it will walk you though the steps just read attentively the explanations).

The reason is, that the first stage of any boot loader must reside in the MBR -- that's the way PCs function. And it gets during install the information "hard wired" (rather programmed in) where to find the rest of the boot loader software (i.e. GRUB now to be put into /dev/hda3).

When you pull #2 the entries pertaining to Ubuntu will be invalid.

yitzle 08-28-2006 08:32 AM

Ubuntu AFAIK doesn't have a repair... But I'll check.
I tried running 'grub-install /dev/hda3' but it didn't help.
I thought I could restore the Windows MBR (fdisk /mbr) and manually booting Ubuntu using the Boot Menu->HD#2, but HD#2 doesn't boot right.
It had some Novell booter, so I ran 'grub-install /dev/hdb' and 'grub-install /dev/hdb1' but when I try to boot that drive I get Error 17.

So... I'll check the LiveCD for a repair or maybe download SuSe just for the repair... I got Knoppix and SysRescue, so I'll try those too.

JZL240I-U 08-28-2006 08:41 AM

There should be no need for a live CD. The original should find an existing installation and offer to repair it. There woud also be an offer to repair the boot loader.

Please re-read my post: It is necessary to realign the MBR so that it points to /dev/hda3 for the next stage of GRUB.

yitzle 08-28-2006 09:18 AM

I got it solved thanks to Sander on GameDev (http://www.gamedev.net/community/for...opic_id=410911)
It appears when I tried grub-install it was using the second hard drive for stage 1.5 so throwing in --root-directory=HDA into the grub-install solved the problem.
Thanks for your help!


All times are GMT -5. The time now is 01:55 AM.