[Hampshire] Grub brings up system system on wrong partition

Top Page

Reply to this message
Author: Victor Churchill
Date:  
To: Hampshire LUG Discussion List
Subject: [Hampshire] Grub brings up system system on wrong partition
Hi,
for reasons too obscure/embarrassing to go into I have two partitions
on my laptop with 'identical' Ubuntu 9.10 installations on them. I
have made a fresh install of 9.10 on /dev/sda7, and rsync'ed all of
'/' except /media onto /media/6e00709a-9c51-423e-9706-516f9583c4f0/
which is where /dev/sda6 is mounted.

When I boot, I am offered the current sda7 install as the first
option, and the sda6 install as an alternative as you would expect.
Selected lines from /boot/grub/grub.cfg are as follows

## BEGIN /etc/grub.d/00_header ...
set root=(hd0,7)
search --no-floppy --fs-uuid --set fb283df7-f811-489a-9f37-043ea4fc1b24
...
### END /etc/grub.d/00_header
### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-21-generic" {
...
    insmod ext2
        set root=(hd0,7)
        search --no-floppy --fs-uuid --set fb283df7-f811-489a-9f37-043ea4fc1b24
        linux   /boot/vmlinuz-2.6.31-21-generic
root=UUID=fb283df7-f811-489a-9f37-043ea4fc1b24 ro  splash vga=775
noquiet splash
    initrd  /boot/initrd.img-2.6.31-21-generic
}
...
### END /etc/grub.d/10_linux
...
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Professional (on /dev/sda1)" {
...
menuentry "Ubuntu, Linux 2.6.31-21-generic (on /dev/sda6)" {
        insmod ext2
        set root=(hd0,6)
        search --no-floppy --fs-uuid --set 6e00709a-9c51-423e-9706-516f9583c4f0
        linux /boot/vmlinuz-2.6.31-21-generic
root=UUID=fb283df7-f811-489a-9f37-043ea4fc1b24 ro quiet splash
        initrd /boot/initrd.img-2.6.31-21-generic
}


I have established that fb28....1b24 is the UUID for sda7, and
6e00...c4f0 is the UUID for sda6.

It appears that , when run from the system on sda7, update-grub is
correctly probing the disk and finding the installation on sda6 and is
putting its title in the menu as the entry under 30_os-prober. But in
the 'linux...' line it is saying
'root=UUID=fb283df7-f811-489a-9f37-043ea4fc1b24' which is sda7 not
sda6. The result is that whichever menu item I select I always get the
system on sda7.

I have put the correct UUID into /etc/fstab on the sda6 partition, so
my two fstabs have the following lines for '/':

sda7:
# / on /dev/sda7
UUID=fb283df7-f811-489a-9f37-043ea4fc1b24 / ext4    errors=remount-ro 0       1


sda6:
# / on /dev/sda6
UUID=6e00709a-9c51-423e-9706-516f9583c4f0 /  ext4    errors=remount-ro 0       1


I just looked in /var/log/messages and saw this:

May 14 14:19:07 Pan 40grub2: debug: parsing: menuentry "Ubuntu 9.10,
kernel 2.6.31-21-generic (on /dev/sda6)" {
May 14 14:19:07 Pan 40grub2: Skipping entry 'Ubuntu 9.10, kernel
2.6.31-21-generic (on /dev/sda6)':
May 14 14:19:07 Pan 40grub2: appears to be an automatic reference
taken from another menu.lst
May 14 14:19:07 Pan 40grub2: debug: parsing: insmod ext2
May 14 14:19:07 Pan 40grub2: debug: parsing: set root=(hd0,6)
May 14 14:19:07 Pan 40grub2: debug: parsing: search --no-floppy
--fs-uuid --set 6e00709a-9c51-423e-9706-516f9583c4f0
May 14 14:19:07 Pan 40grub2: debug: parsing: linux
/boot/vmlinuz-2.6.31-21-generic
root=UUID=6e00709a-9c51-423e-9706-516f9583c4f0 ro quiet splash
May 14 14:19:07 Pan 40grub2: debug: parsing: initrd
/boot/initrd.img-2.6.31-21-generic
May 14 14:19:07 Pan 40grub2: debug: parsing: }

Which looks as if it grub is trying to Do The Right Thing (the root
UUID is correct for sda6) but there is that 'Skipping entry'
message... as if it is reading the menu entry, doing its work but then
not writing it to the grub.cfg file. It is saying that for *all*
entries in the /etc/grub.d/30_os-prober section.

Any ideas on what is going on here?