grub uses wrong bootparameters with sda after install

Bug #21186 reported by Janko Knops
86
This bug affects 2 people
Affects Status Importance Assigned to Milestone
grub (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

With my current systemconfig (3 sata disks and 4 ides) and ubuntu installed on
sda1, grub is configured by the ubuntu-installer to use hda1 instead. I did a
reinstall to make sure and it reproduced the error.

It states that the bootdisk is hd4,0 while it should be hd0,0, so seems like the
installer can't cope with sata / ide combination.

----------------
Added by Duncan-Lithgow so it can be edited:
These bugs all have probelms installing GRUB on a SATA disc. Some with PATA present, some without. I do not have enough technical understanding to find exact duplicates.
Bug #8497 bug #75676 bug #32357 bug #110292

Revision history for this message
Eric Butler (codebutler) wrote :

I am having the same problem. It appears that when the kernel package
reconfigures grub it sees IDE drives first, but when the system is booting it
sees SATA drives first.

The package configures grub as "hd3". For the system to boot I have to change
this to "hd0".

I have two SATA drives and two IDE drives.

This is a very serious bug, as a user that is not farmiliar with grub would have
no idea how to boot their system. Please mark this as blocking breezy.

Revision history for this message
Sander Marechal (s-marechal) wrote :

Such a user would be me. I am clueless about GRUB.

I have one SATA drive and one IDE drive. That IDE had some old warty partitions
on it that were to be mouted somewhere in /media. When the installer tried to
install GRUB I had to tell it where to put it. I picked /dev/sda guessing that
that would be the right place (I was trying to injsall breezy on the SATA. The
IDE was a remnant from my old PC). Upon reboot, it said "file not found" when
trying to load thekernel image.

Next, I reinstalled breezy but this time removed the old warty partitions from
the IDE, leaving just the partition with my personal files. the installer did
not ask me where to put GRUB this time, but upon reboot it tried "root (hd1,0)"
and said "partition not found".

I managed to install it on the 3rd try by yanking out the flatcable from my IDE
drive, leaving only my SATA drive.

Revision history for this message
Philip Warburton (ubuntu-anaserv) wrote :

I have also had this problem. I have one SATA and one IDE drive. Root partition was set to (1,0) instead of (0,0).

The "solution" is to hit "e" to edit the GRUB sequence on boot and change it to (0,0).
I have some clue about GRUB, but I didn't notice the problem right away, and ended up wasting too much time trying to get
the system to boot.

This should DEFINITELY be upgraded in severity. I can't be the only person who has a SATA drive for applications and
cheaper IDE drives for mass storage.

Revision history for this message
Joerg (joerg-archive) wrote :

Please upgrade this bug. It is rather serious. I am unsure if it's really a
bug in GRUB or whether GRUB is a victim of the BIOS. I will do more testing and
will report back more findings, but preliminary stuff follows:

HW Setup.
hda 400GB PATA
hdb 400GB PATA
hdc DVDRW
sda 80GB SATA
sdb 500GB SATA
sdc 400GB SATA
sdd 80GB SATA

I'm booting off of /dev/md0, a RAID1 Mirror of /dev/sda1 and /dev/sdb1, 100MB /boot

During installation, Grub was configured with hd2,0 as the boot device. I'm not
sure whether any of you received the "Error 15" during boot, maybe that's just a
RAID boot problem.

What I believe is happenening is a combination of BIOS renumbering and GRUB
insanity.

SATA appears to behave like SCSI. If you have 2 hard drives, and plug them into
port 1 and port 3, they will show up in linux as /dev/sda and /dev/sdb. If you
now go out and buy another drive and plug it into port 2. The new drive becomes
/dev/sdb and the old /dev/sdb becomes /dev/sdc.

I believe whatever drive, whether hda, sdb, or sdd, the BIOS decides to use as
the boot device, GRUB will see as hd0. After booting, running grub and doing
"find /vmlinuz" will return the hd2,0 again, even though during boot it is hd0,0.

In my setup. Grub insists on using hd2,0 as the boot device. Since I do RAID1,
I created another GRUB entry for hd5,0 so that in case something goes wrong with
/dev/sda, I have an entry that's bootable in menu.lst.

********
I may file this as a seperate bug... but after getting it to boot happily, I
decided to upgrade kernels. Well, in the infinite wisdom of the kernel package,
it wiped out my hd0,0 change as well as the hd5,0 entry I added by hand.
Wankers. :)
********

Revision history for this message
jstammi (johannes-stamminger) wrote :

IMHO this bug is more serious than "medium": my server (with ubuntu 6.0.6.1 server installed) now fails booting every time the grub menu is re-generated as the root directive is false. As a server in principle may be located elsewhere ... :-(.

My drives:
IDE:
hda (historical reasons, removal pending)
hdd (historical reasons, removal pending)

SATA:
md0 (sda1, sdb1; RAID1; mounted to /)
md1 (sda4, sdb4; RAID1; mounted to /home
md2 (sda5, sdb5; RAID1; mounted as swap)

grub is installed to the MBR of hda (historical reason; moving to sda+sdb pending).

SATA controler uses libata+sata_promisse modules.

The generated grub menu now insists on directive root=(hd0,0) for booting from md0.
If you forgot to correct after generation and this fails it can be corrected (if sitting in front of the server, else you "won" a journey) by hitting e and "convincing" him to use root=(hd2,0).

Revision history for this message
Eric Butler (codebutler) wrote :

This bug is a duplicate of #8497, but launchpad won't let me mark it as so.

Revision history for this message
h2os (t-waters-deactivatedaccount) wrote :
Download full text (4.0 KiB)

It seems I have found another issue which is related to this one:
I have 1 SATA and one PATA connected to the onboard controller.
Next to that I have a seperate SCSI controller with two additional disks.
When booting, Dmesg says the following:

[42949383.030000] SCSI device sda: 17773500 512-byte hdwr sectors (9100 MB)
[42949383.100000] SCSI device sda: drive cache: write back
[42949383.100000] sda: sda1
[42949383.100000] sd 0:0:1:0: Attached scsi disk sda
[42949383.160000] SCSI device sdb: 17773500 512-byte hdwr sectors (9100 MB)
[42949383.230000] SCSI device sdb: drive cache: write back
[42949383.270000] SCSI device sdb: 17773500 512-byte hdwr sectors (9100 MB)
[42949383.330000] SCSI device sdb: drive cache: write back
[42949383.330000] sdb: sdb1 sdb2 sdb4
[42949383.340000] sd 0:0:2:0: Attached scsi disk sdb

These are the disks that are connected to my SCSI controller.

[42949385.230000] ata2: PATA max UDMA/133 cmd 0x9800 ctl 0x9402 bmdma 0x9008 irq 177
[42949385.430000] ata1: dev 0 cfg 00:0040 49:2f00 82:7c6b 83:7f69 84:4773 85:7c69 86:3e01 87:4763 88:207f 93:0000
[42949385.430000] ata1: dev 0 ATA-7, max UDMA/133, 490234752 sectors: LBA48
[42949385.430000] sata_get_dev_handle: SATA dev addr=0x1f0002, handle=0xdffe5520
[42949385.430000] ata1: dev 0 configured for UDMA/133

This would be my PATA disk

[42949385.430000] sata_get_dev_handle: SATA dev addr=0x1f0002, handle=0xdffe5520
[42949385.430000] scsi1 : ata_piix
[42949386.610000] scsi2 : ata_piix
[42949386.610000] Vendor: ATA Model: Maxtor 6V250F0 Rev: VA11
[42949386.610000] Type: Direct-Access ANSI SCSI revision: 05
[42949386.610000] SCSI device sdc: 490234752 512-byte hdwr sectors (251000 MB)
[42949386.610000] SCSI device sdc: drive cache: write back
[42949386.610000] SCSI device sdc: 490234752 512-byte hdwr sectors (251000 MB)
[42949386.610000] SCSI device sdc: drive cache: write back
[42949386.610000] sdc: sdc1 sdc2 < sdc5 >
[42949386.650000] sd 1:0:0:0: Attached scsi disk sdc

And this is my SATA disk

Now, when i booted the first time it would just not boot, and I had to change the boot parameters
just like you guys. But now, after i booted there is something strange:

according to the mount command root is mounted to /dev/sda1 but ubuntu was installed at
my SATA disk ( /dev/sdc1)!
So mount mistakes /dev/sdc with /dev/sda. /dev/sdc1 fdisk shows:

Disk /dev/sdc: 251.0 GB, 251000193024 bytes
255 heads, 63 sectors/track, 30515 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot Start End Blocks Id System
/dev/sdc1 * 1 30141 242107551 83 Linux
/dev/sdc2 30142 30515 3004155 5 Extended
/dev/sdc5 30142 30515 3004123+ 82 Linux swap / Solaris

and /dev/sda

Disk /dev/sda: 9100 MB, 9100032000 bytes
255 heads, 63 sectors/track, 1106 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot Start End Blocks Id System
/dev/sda1 1 5 40131 12 Compaq diagnostics

mounts according to the MOUNT command:

/dev/sda1 on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw...

Read more...

Revision history for this message
David Corrales (davidcorrales) wrote :

I can confirm this bug on my system. I'm using an IDE drive and an additional SATA. Normally, grub-config wouldn't hose my system, but on the Dec 13th upgrade, it did.
My root line was changed from (0,4) to (1,4) and left me with an unbootable system for a while (since it was hard to diagnose because the error was #15, File not found).

Revision history for this message
Janko Knops (janko-knops) wrote : RE: [Bug 21186] Re: grub uses wrong bootparameters with sda after install

Well, the error is in it for some time already :/ I can still reproduce the
bugger time and time again.

I solved it by making the config file read only. It isn't a very decent way
of fixing the problem, but it seems that the grubdevelopers from Ubuntu
don't have any interests in solving this problem.

Hope it helps for you,

Cheers,

Janko

> -----Original Message-----
> From: <email address hidden> [mailto:<email address hidden>] On Behalf Of
> David Corrales
> Sent: Friday, December 15, 2006 3:12 AM
> To: <email address hidden>
> Subject: [Bug 21186] Re: grub uses wrong bootparameters with sda after
> install
>
> I can confirm this bug on my system. I'm using an IDE drive and an
> additional SATA. Normally, grub-config wouldn't hose my system, but on the
> Dec 13th upgrade, it did.
> My root line was changed from (0,4) to (1,4) and left me with an
> unbootable system for a while (since it was hard to diagnose because the
> error was #15, File not found).
>
> --
> grub uses wrong bootparameters with sda after install
> https://launchpad.net/bugs/21186
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.432 / Virus Database: 268.15.19/587 - Release Date:
> 12/14/2006 7:28 PM
>

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.15.19/587 - Release Date: 12/14/2006
7:28 PM

Revision history for this message
Manuel Zach (loogaroo) wrote :

The problem is that grub-install (or a other app?) guesses the "device.map" sometimes wrong and update-grub depends on it.
Read here about the device.map file: http://www.gnu.org/software/grub/manual/html_node/Device-map.html

To get update-grub working, do following:
1. Fix your /boot/grub/device.map
2. Delete /boot/grub/menu.lst
3. Run update-grub

update-grub uses "# groot=(hdx,x)" in menu.list for the root statement of the automatic added kernels, if you only fix this, update-grub should also work proper.

Perhaps a solution is also, to edit your bios settings, change boot priority of ide<=>sata/scsi.

Tollef Fog Heen (tfheen)
Changed in grub:
assignee: tfheen → nobody
description: updated
description: updated
Revision history for this message
Rafael Ávila Coya (ravila-edu) wrote :

I've had the same problem in a computer in my school. It has only a SATA drive, but when installing with life CD, when I am in a window that states which partitions will be formated, if I clic in the "advanced" button I see that he will install grub in (hd0), instead (sd0).

Serious, because I lost the window$ partition, and it took a time to realize about what was going wrong.

Revision history for this message
Sandy (sandyasolkar) wrote :

i too have faced a similar problem with both 7.04 and 7.10.
i have 160GB HDD (SATA) and 40gb HDD(IDE).
Installing ubuntu on IDE is no joy as it simply does not boot even when trying to boot with Super Grub bootable CD.
Installing Ubuntu on SATA overwrites MBR improperly leaving no bootable HDD.

An early fix to this "BUG" is essential so that Linux novices like me can convert easily from WIn to Ubuntu.

Revision history for this message
Joe Smith (yasumoto7) wrote :

Is this still an issue for anyone running Ubuntu 8.04?

Revision history for this message
sokycompnerd (whitefiredarksun) wrote :

For more information check out bug number: 32357
This is a duplicate entry for the same issues.

I changed boot priority and fixed this problem on my system...

Revision history for this message
Mad-Malc (mad-malc) wrote :

Gparted on install picks up the IDE drives as Sata, so where I expected Hda, Hdb, Sda, and Sdb, I got Sda, Sdb, Sdc, and Sdd. The last 2 are the IDE drives.

Then when the information is passed to Grub, it uses its own numbering system starting with Hd0, and as I installed on Sdc, Grub looks for the operating system on Hd2, the third hard drive. So it actually looks for the operating system on the first Sata Hard drive. I dare say if I installed on the first Sata Hard drive Sda, grub would be looking for the operating system on Hd0, the first IDE Drive.

So any newcomer to Kubuntu with an IDE and Sata Drive attached to their motherboard is likely to not have the best of experiences.

The chipset which controls both the IDE and Sata drives on the Motherboard in question is Via VT8237S. This chipset was okay under Kubuntu 7.10.

The error message is error 22 no operating system found.

Revision history for this message
Joe (js9986) wrote :

I am new to Ubuntu. I just installed Ubuntu version 8.04. I have the same issue. I have a SATA and an IDE drive. Ubuntu installed GRUB on the IDE, but my bios said to boot off of the SATA first. I was able to fix it by switching the BIOS setting to boot off of the IDE before the SATA.

/Joe

Gabriel Ruiz (anakron)
Changed in grub:
status: New → Confirmed
Revision history for this message
Magnes (magnesus2) wrote :

I have the same issue. Sorry I reported duplicate about it: https://bugs.launchpad.net/ubuntu/+source/grub/+bug/292333 - I found this bug later.

Revision history for this message
Robert Shaw (rshaw3) wrote :

Just encountered this bug myself after trying to boot into my WinXP install after an upgrade to 8.10. Grub had changed the disk for the windows install to hd4 but it was supposed to be hd0. I have 2 IDE HD's and 2 SATA HD's, with Windows installed on the first IDE drive.

Revision history for this message
Magnes (magnesus2) wrote :

I no longer have this issue, maybe it's fixed? I use Ubuntu 9.04.

Revision history for this message
LaPingvino (ikojba) wrote : Re: [Bug 21186] Re: grub uses wrong bootparameters with sda after install

it's fixed, it would have been a showstopper for Netbook Remix, so I'm
almost sure it's fixed now :)

2009/7/9 Magnes <email address hidden>

> I no longer have this issue, maybe it's fixed? I use Ubuntu 9.04.
>
> --
> grub uses wrong bootparameters with sda after install
> https://bugs.launchpad.net/bugs/21186
> You received this bug notification because you are a direct subscriber
> of a duplicate bug.
>

--
Communication is essential. So we need decent tools when communication is
lacking, when language capability is hard to acquire...

- http://esperanto.net - http://esperanto-jongeren.nl

Only those who attempt the absurd will achieve the impossible. I think it's
in my basement... let me go upstairs and check.
- M. C. Escher

Revision history for this message
rusivi2 (rusivi2-deactivatedaccount) wrote :

Thank you for posting this bug.

As per comments #19/20 this issue is fixed. Marking as such.

Changed in grub (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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