Error in installation of GRUB

Bug #19026 reported by Scott Armitage on 2005-07-17
8
Affects Status Importance Assigned to Milestone
grub-installer (Ubuntu)
Medium
Unassigned

Bug Description

After making enough free space on my SATA drive (which also had WinXP), I
installed Ubuntu. Great.
Asked if I wanted to install GRUB into the MBR. I said "Yes".
Rebooted, got the error message "Error loading operating system." The only way
to fix my problem was to load a LiveCD and use QtParted to set my XP's NTFS
partition to "Active", at which point XP would boot fine but I couldn't get into
Ubuntu.

Played around with it for a long time, aksed for help on the forums etc., got
nowhere.

Eventually I got fed up (I just wanted to get used to Linux) and installed SuSE
9.1 Personal. Installed it into the same free space, it set itself as the active
partition, asked for info about the GRUB (which I specified "Overwrite MBR" and
"Make MBR partition active", finished install, rebooted and everything worked
fine. I could choose SuSE or XP and both booted no problem.

So I thought "Maybe this will work if I reinstall Ubuntu now." So, I did.
And... GRUB worked! Well, kind of.

GRUB loaded now, giving me a menu. If I chose XP, then XP would boot no problem.
If I chose any of the three default Ubuntu options, I got "Error 22: No such
partition".

My solution:
I removed my IDE storage drive (i.e. now there is ust my SATA OS drive) and
reinstalled Ubuntu. This time, it worked no problems whatsoever. Put my IDE
drive back in and it still worked. Both Ubuntu and XP boot fine now.

The problem:
The installer had set my menu.lst file to something like (please note: I've
re-ordered stuff to look better):

/*
title Microsoft Windows XP Professional
root (hd1,0)
savedefault
makeactive
chainloader +1

title Ubuntu 5.04 Hoary Hedgehog
root (hd1,1)
kernel /boot/vmlinuz-2.6.10-5-k7 root=/dev/sda2 ro quiet splash
initrd /boot/initrd.img-2.6.10-5-k7
savedefault
boot

title Ubuntu 5.04 (recovery mode)
root (hd1,1)
kernel /boot/vmlinuz-2.6.10-5-k7 root=/dev/sda2 ro single
initrd /boot/initrd.img-2.6.10-5-k7
savedefault
boot

title Ubuntu 5.04, memtest86+
root (hd1,1)
kernel /boot/memtest86+.bin
savedefault
boot
*/

when the WORKING version looks like this (same modifications.. not the "root"
commands):
/*
title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1

title Ubuntu 5.04 Hoary Hedgehog
root (hd0,1)
kernel /boot/vmlinuz-2.6.10-5-k7 root=/dev/sda2 ro quiet splash
initrd /boot/initrd.img-2.6.10-5-k7
savedefault
boot

title Ubuntu 5.04 (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.10-5-k7 root=/dev/sda2 ro single
initrd /boot/initrd.img-2.6.10-5-k7
savedefault
boot

title Ubuntu 5.04, memtest86+
root (hd0,1)
kernel /boot/memtest86+.bin
savedefault
boot
*/

SuSE worked fine but Ubuntu did not. That is the only reason I am posting this
here; if both installers had messed up because of my extra IDE storage drive,
then I would have said "oops, guess you just can't do it that way", but since
SuSE didn't have any problems, then neither should Ubuntu. Also, SuSE gave me
the specific options for overwriting the MBR and settings its "bootable" status,
which Ubuntu did not.. that was the fix to the original problem I was having.

Scott Armitage (scott-armitage) wrote :

Ubuntu 5.04 downloaded from site mirrors on July 12, 2005.

Hardware configuration:

Motherboard: ABIT NF7-S rev 2.0
Memory: 768MB Kingmax DDR400
Processor: AthlonXP 2500+
Video card: Sapphire ATI Radeon 9600XT
Disk Drives: 1xDVD-ROM + 1xDVD+-RW on onboard ATA 1
                 1xCD-RW on onboard ATA 2
Hard Drives: 1xMaxtor 40GB DiamondMax on onboard Silicon Image Sil 3112
SATARaid Controller (using the PATA to SATA converter that came with my mobo)
                 1xWestern Digital 120GB ATA133 on Promise SATA150 TX2Plus addon
card (has 2xSATA connectors and 1xATA133 connector)

Please contact if more information is required.

Janne Kalliomäki (jokalli2) wrote :

I can confirm the bug using 5.10 Breezy Preview. Steps to reproduce:
1. Install
2. When asked if you want to install grub to MBR, answer yes
3. In the reboot, system hangs in boot and displays "Error loading operating
system."

Note: I found a funny workaround to the problem. When I put a Windows XP
installation CD in my drive and boot but don't press any key when prompted, grub
is loaded and I'm able to boot into Ubuntu.

After this bug has happened, only way I have been able to get the computer to
boot is by formatting /dev/hda1 (where my Windows XP is) and delete partition
/hdb2 (where I tried to install ubuntu). I could not even install Hoary (which
worked previously fine) after the computer is in an unbootable state.

I can provide more information if needed.

Jonathan Carter (jonathan) wrote :

Does this problem persist with Ubuntu 6.06 LTS? SATA support should be greatly improved since Hoary.

Scott Armitage (scott-armitage) wrote :

Unfortunately I will not be able to test to see if I can reproduce this problem for some time. It will require a reformat and re-partitioning of my system drive, which I haven't the time to complete at the moment. When I am able to I will see if I still receive the error.

Scott Armitage (scott-armitage) wrote :

The problem persists with Ubuntu 6.06 LTS. As before, GRUB listed my Linux partition as (hd1,1) and my Windows partition as (hd1,0) when the should in fact be (hd0,1) and (hd0,0) respectively.

Once again, I manually edited GRUB in order to boot Linux, modified menu.lst to reflect these changes, and now it works fine.

Scott Armitage (scott-armitage) wrote :

A further note: There have been two kernel upgrades since I've been using 6.06. When Synaptic updates the kernel, it re-writes the list of auto-generated boot options in GRUB's menu.lst file (leaving intact anything below the line '### END DEBIAN AUTOMAGIC KERNELS LIST').

On each kernel upgrade, the updated menu.lst file refered to (hd1,1) for all new Linux kernel entries. I've moved all of my options below the automagic kernels line to prevent them from being overwritten in the future, however when I upgrade my kernel I now have to open menu.lst to make whatever changes Synaptic made without changing (hd0,1) to (hd1,1).

Timo Aaltonen (tjaalton) wrote :

scott: there's a "groot=" line in menu.lst.. you should modify it to reflect the correct situation (ie. "#groot=(hd0,0)")

the situation you are describing can happen if you first install the system with two disks attached and then remove the other.. they could then be ordered differently.

aSkreet (skreet) wrote :

I can confirm a simliar issue, if not identical. I'm using Ubuntu 6.10, whenever I install a kernel package on my laptop it sets root (hd0,0) when it really means (0,1). In my case it seems that it's hung up on an unformatted partition of 100mb

sda layout:
100 mb - unformatted
48gb - ntfs
8 gb - ext3 (6.10 install)

- skreet

Changed in grub-installer:
status: Unconfirmed → Confirmed
Colin Watson (cjwatson) on 2007-04-19
Changed in grub-installer:
assignee: kamion → nobody
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.