grub choose wrong hdX on a fresh install

Bug #98757 reported by Olivier ak Ez on 2007-03-29
4
Affects Status Importance Assigned to Milestone
grub (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: grub

I was doing a fresh Install of Feisty Fawn.
I formated /boot, /home and /

I installed in on /dev/sda like this :
sda3 => /boot
sda5 => /
sda6 => /home
sda7 => swap

Install was successful. I rebooted my system, and after grub I get this error :
Error 22 : No such partition
I edited the launch line. It was using "(hd3,3").
I changed it with "(hd1,2") and it booted successfully.

I don't know why Grub used this mapping. Maybe this is related to "map", as I can see the following lines in /boot/grub/menu.lst in "windows block" :
title Microsoft Windows XP Professionnel
root (hd3,0)
savedefault
makeactive
map (hd0) (hd3)
map (hd3) (hd0)
chainloader +1

The original Linux block was :

title Ubuntu, kernel 2.6.20-12-generic
root (hd3,3)
kernel /vmlinuz-2.6.20-12-generic root=UUID=e4fee0bc-403c-4b2d-b92f-7da5edd05526 ro quiet splash locale=fr_FR
initrd /initrd.img-2.6.20-12-generic
quiet
savedefault

ProblemType: Bug
Architecture: amd64
Date: Thu Mar 29 23:01:09 2007
DistroRelease: Ubuntu 7.04
Uname: Linux sherlock 2.6.20-12-generic #2 SMP Wed Mar 21 19:34:23 UTC 2007 x86_64 GNU/Linux

dac922 (dac922) wrote :
Download full text (7.9 KiB)

Hi, I have a similar issue: Ubuntu is installed on /dev/hda10, but when updater updates grub/menu.lst it uses the UUID of /dev/hda9 (where debian unstable) is installed.

Here my fstab, menu.lst and the output of blkid. I hope this will help.

########################
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda10
UUID=dcb27ef8-f2db-48b0-a701-326a33d777bc / ext3 defaults,errors=remount-ro 0 1
# /dev/sda1
UUID=4664CF3F64CF310B /media/sda1 ntfs defaults,nls=utf8,umask=007,gid=46 0 1
# /dev/sda5
UUID=0A0CD1B60CD19D4F /media/sda5 ntfs defaults,nls=utf8,umask=007,gid=46 0 1
# /dev/sda6
UUID=8d360ab6-29ad-4a20-852e-5bce779fb660 /media/sda6 ext3 defaults 0 2
# /dev/sda8
UUID=bbb17398-320e-4920-aa2e-fb1f92a36161 /media/sda8 ext3 defaults 0 2
# /dev/sda9
UUID=5e0b2840-d37e-4e69-842c-3be3bd16819c /media/sda9 ext3 defaults 0 2
# /dev/sda7
UUID=9f28e9d7-5017-45bb-a3a2-77fd4eafc4b2 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/scd1 /media/cdrom1 udf,iso9660 user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0

###########################
###########################
# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
default saved

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 5

# Pretty colours
color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can ...

Read more...

dac922 (dac922) wrote :

if i remove menu.lst and run update-grub manually, then the right UUID will be used

Tormod Volden (tormodvolden) wrote :

fKn, this is because of your line that says:
# kopt=root=UUID=5e0b2840-d37e-4e69-842c-3be3bd16819c ro
If you change this line back to:
# kopt=root=/dev/sda10
and run "sudo update-grub", it is set back to the same UUID?

Olivier, do you have other hard drives on your computer?

Changed in grub:
status: Unconfirmed → Needs Info
Olivier ak Ez (olivier-reagi) wrote :

Yes, I have many hard drives :

1- 80Go SATA2
2- 120Go SATA2
3- 120Go IDE
4- 80Go IDE (the one I use both for Linux and Windows main partition)
5- 160Go IDE
6- 200Go USB

Tormod Volden (tormodvolden) wrote :

Olivier, the problem is that during installation, the SATA drives were detected (by the kernel) first (hd0, hd1) and your IDE drives became hd2, hd3, hd4, hd5. The Linux drive hd3 (the 4th) was therefore stored in menu.lst. Now when grub is starting up, reading hd3 from menu.lst, it asks the BIOS for the 4th hard drive, but the BIOS starts with the IDE disks, so your Linux disk is the 2nd drive now.

It's difficult for the installer (only seeing drives through the kernel, without using BIOS) to guess in what order the BIOS will present the drives.

Changed in grub:
status: Needs Info → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers