Incorrect paths in menu.lst with separate boot partition

Bug #317085 reported by Peter Clifton on 2009-01-14
Affects Status Importance Assigned to Milestone
grub (Ubuntu)
Colin Watson

Bug Description

Binary package hint: grub

I've got an ext4 setup before any Ubuntu support for this, and hence needed to create a separate boot partition (since Grub didn't know how to boot from an ext4 partition).

This means that the correct paths to kernel etc.. in my menu.lst file begin with /<foo> rather than /boot/<foo>

update-grub sometimes wants to replace my menu.lst with one having /boot/ prefixing each filename.

Specifically, when I edit any non-default options in the menu.lst, such as adding options to the kernel command line, the next run of update-grub will prompt to ask if I want to replace the menu.lst file with that of the package maintainer.

Doing so doesn't actually delete my edited options, just re-writes the paths with /boot in front of them. I can then happily hand-edit the /boot part of the paths out, and update-grub seems happy enough with them - not prompting to replace the config file this time.

Related branches

Steve Langasek (vorlon) wrote :

Thank you for taking the time to report this bug and help to improve Ubuntu.

This is altogether unreproducible here. Using a separate partition for /boot is a common configuration (the system I'm typing from is set up this way), and update-grub has long supported it.

Is your /boot filesystem not mounted at /boot, or is it not listed in /etc/fstab? update-grub calls boot_device=$(find_device "/boot") to determine whether /boot is a separate filesystem, and find_device is a function that looks up the mount in /etc/fstab. The only way I can see this failing is if one of the above two conditions aren't satisfied.

Changed in grub:
status: New → Incomplete
Peter Clifton (pcjc2) wrote :

less /etc/fstab | grep boot
UUID=ed910c93-d465-4fad-a95f-ea7361326f57 /boot/ ext3 defaults,errors=remount-ro,relatime 0 1

Checking the UUID:

ls /dev/disk/by-uuid/ed910c93-d465-4fad-a95f-ea7361326f57 -l
lrwxrwxrwx 1 root root 10 2009-01-14 12:17 /dev/disk/by-uuid/ed910c93-d465-4fad-a95f-ea7361326f57 -> ../../sda4

It is also mounted:
mount | grep boot
/dev/sda4 on /boot type ext3 (rw,relatime,errors=remount-ro)

Most of the time update-grub writes the path-names correctly, it is only after editing (for example), the default kernel command line when I get the prompt running update-grub.

On Wed, Jan 14, 2009 at 05:33:06PM -0000, Peter Clifton wrote:

> less /etc/fstab | grep boot
> UUID=ed910c93-d465-4fad-a95f-ea7361326f57 /boot/ ext3 defaults,errors=remount-ro,relatime 0 1

Does this problem go away if you remove the trailing / on "/boot/"?

The installer never uses a trailing slash, and it looks like update-grub
isn't set up to check for that.

Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer
<email address hidden> <email address hidden>

Peter Clifton (pcjc2) wrote :

Thanks Steve!

Dropping the "/" did indeed cure the problm. I'd never have spotted / thought to try that in a million years.

Thanks once again!

Steve Langasek (vorlon) wrote :

Ok, marking as triaged then, thanks.

Changed in grub:
importance: Undecided → Low
status: Incomplete → Triaged
Colin Watson (cjwatson) on 2009-02-12
Changed in grub:
assignee: nobody → kamion
status: Triaged → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub - 0.97-29ubuntu50

grub (0.97-29ubuntu50) jaunty; urgency=low

  * debian/update-grub: Strip trailing slashes from mountpoints in fstab
    before comparing them (LP: #317085).
  * debian/kernel-prerm.d-last-good-boot: Don't fail if grub has been
    removed but not purged (LP: #272885).
  * Depend on grub-common for grub-probe, needed to check whether XFS is in
    use (LP: #328633).

 -- Colin Watson <email address hidden> Mon, 23 Feb 2009 09:52:50 +0000

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

Other bug subscribers