update-grub generates an incorrect entry

Bug #442631 reported by vedoham
4
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: grub2

sda1 swap
sda2 extended
sda5 Karmic beta

Installed Fedora 11 on sda6 (/) and sda7 (/boot) [because, by default, sda6 is an ext4 partition and F11 assumes grub 0.x and requires /boot on an ext3 partition).

Skipped the bootloader setup when installing F11 so as to stick to Karmic's grub2.

Booted into Karmic and ran update-grub, which generated the following entry ("GRUB_DISABLE_LINUX_UUID=true" set in order to file the bug):

menuentry "Fedora release 11 (Leonidas) (on /dev/sda6)" {
       insmod ext2
       set root=(hd0,6)
       search --no-floppy --fs-uuid --set 4c6e1491-1374-40d4-be8b-2647c714685e
       linux /boot/vmlinuz-2.6.30.8-64.fc11.i586 root=/dev/sda6
}

Was unable to boot into F11 and had to make three changes:
3rd line: (hd0,6) to (hd0,7)
4th line: deleted (had no idea what the UUID of sda7 was at the grub menu)
5th line: /boot/vmlinuz-2.6.30.8-64.fc11.i586 to /vmlinuz-2.6.30.8-64.fc11.i586

# lsb_release -rd
Description: Ubuntu karmic (development branch)
Release: 9.10

# apt-cache policy grub-common
grub-common:
 Installed: 1.97~beta3-1ubuntu6
 Candidate: 1.97~beta3-1ubuntu6
 Version table:
 *** 1.97~beta3-1ubuntu6 0
       500 http://us.archive.ubuntu.com karmic/main Packages
       100 /var/lib/dpkg/status

# apt-cache policy grub-pc
grub-pc:
 Installed: 1.97~beta3-1ubuntu6
 Candidate: 1.97~beta3-1ubuntu6
 Version table:
 *** 1.97~beta3-1ubuntu6 0
       500 http://us.archive.ubuntu.com karmic/main Packages
       100 /var/lib/dpkg/status

Revision history for this message
HankB (hbarta) wrote :

Please see my thread at http://ubuntuforums.org/showthread.php?p=8063611#post8063611 to determine if this is the same bug. It caught my eye because I was running Jaunty with a /boot partition and installation of the Karmic beta with grub2 left my Jaunty install unbootable. (I have not figured out what to change to fix it.)

thanks,
hank

Revision history for this message
vedoham (vedoham) wrote : Re: [Bug 442631] Re: update-grub generates an incorrect entry

> Please see my thread at
> http://ubuntuforums.org/showthread.php?p=8063611#post8063611 to
> determine if this is the same bug. It caught my eye because I was
> running Jaunty with a /boot partition and installation of the Karmic
> beta with grub2 left my Jaunty install unbootable. (I have not figured
> out what to change to fix it.)

Please add an entry to /etc/grub.d/40_custom by using a modified 9.04
/boot/grub/grub.cfg entry.

Change:
menuentry "Ubuntu 9.04, kernel 2.6.28-15-generic (on /dev/sda6)" {
        insmod ext2
        set root=(hd0,6)
        search --no-floppy --fs-uuid --set 7f69072f-cea2-4ec3-bde9-81dd16744034
        linux /boot/vmlinuz-2.6.28-15-generic
root=UUID=7f69072f-cea2-4ec3-bde9-81dd16744034 ro quiet splash
        initrd /boot/initrd.img-2.6.28-15-generic
}

To:
menuentry "Ubuntu 9.04 (from 40_custom)" {
        insmod ext2
        set root=(hd0,5)
        search --no-floppy --fs-uuid --set 9bdeb391-8fd9-48b1-9316-c4a00b7fa7a2
        linux /vmlinuz-2.6.28-15-generic
root=UUID=7f69072f-cea2-4ec3-bde9-81dd16744034 ro quiet splash
        initrd /initrd.img-2.6.28-15-generic
}

Then run update-grub and reboot. You should be able to choose

Revision history for this message
vedoham (vedoham) wrote :

Just checking this report and noticed that my email to HankB was cut off.

End of email: "Ubuntu 9.04 (from 40_custom)" and boot from Jaunty on /dev/sda6.

One more thought (if you have enough space on /dev/sda6).

You could boot into Karmic, mount the two Jaunty partitions to, eg, /mnt/sda5 and /mnt/sda6, cp -a the files and directories in /mnt/sda5 to /mnt/sda6/boot, and comment out/remove the entry of /boot in /mnt/sda6/etc/fstab.

When you run update-grub, 30_osprober should create a correct entry for Jaunty; and you will not need the entry in 40_custom (it would not longer work anyway).

Revision history for this message
Felix Zielcke (fzielcke) wrote :

Please check if this still happens with newest grub2.
At least that it still appends /boot/ if you have a seperate /boot partition should be fixed now in karmic.

Revision history for this message
vedoham (vedoham) wrote :

Just tested.

Karmic on sda5 with /boot/grub/grub.cfg
F12 on sda6 with /boot on sda9

update-grub created for F12:
set root=(hd0,9)
search ... UUID_of_sda9
linux /vmlinuz... root=/dev/sda6

Problem solved. Thanks.

However, the initrd line is not created. I also have CentOS on this box and its menuentry does not have an initrd line either. Could it be because Fedora and CentOS' initrd names are "initramfs-<kernel>.img" and "initrd-<kernel>.img" respectively as opposed to those of Debian and Ubuntu, which are "initrd.img-<kernel>"?

Should I open a separate report for the initrd issue?

Revision history for this message
Bryan Quigley (bryanquigley) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. We are sorry that we do not always have the capacity to look at all reported bugs in a timely manner.

This was reported against a very old release so I'm going to close it. If you still have the issue please reopen.

Changed in grub2 (Ubuntu):
status: New → Invalid
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.