grub2 installer modifies grub 0.97 menu.lst incorrectly and fails to chainload grub2

Bug #376879 reported by Colin Ian King on 2009-05-15
110
This bug affects 13 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Medium
Andy Whitcroft
Jaunty
Medium
Unassigned

Bug Description

Binary package hint: grub2

Discovered on Jaunty and Karmic. After installing grub2, it modifies the currently installed grub 0.97 menu.lst configuration file to chainload grub2 to allow one to test grub2 before committing to it as the default boot loader.

However, grub2 modifies the menu.lst entry and adds the incorrect command to select the partition to boot from to chain load grub2. It uses:

root 7cce46fe-4883-44bb-939b-58b9483f2739

and should be:

uuid 7cce46fe-4883-44bb-939b-58b9483f2739

I suspect it was originally correct before grub 0.97 has UUID support added.

Attached: png of the failed boot, and a png showing the erroneous partition selection command.

===

SRU Justification for Jaunty

Impact: when upgrading from grub to grub2 selecting the chainload mode (the default) the user ends up with an unbootable legacy configuration. They can edit their entries and get booted but the fix is not at all obvious to the naieve user.

Fix Description: Correctly use the uuid or root keywords based on the current type of the 'groot' specified. We pick up the selector directly from grub to ensure it behaves in the same manner.

Patch: http://launchpadlibrarian.net/26764672/grub2-karmic-fix-legacy-use-uuid

Risks: we do modify the legacy configuration script converter, which might introduce other errors. However the current output is completly unbootable.

TEST CASE: install grub2 selecting chainload on a system which uses 'groot <uuid>', reboot and find entries have 'root <uuid>' and will not boot producing 'Unknown device specifier' errors.

Colin Ian King (colin-king) wrote :
summary: - grub2 installer modifies grub 0.97 menu.lst incorrectly and failes to
+ grub2 installer modifies grub 0.97 menu.lst incorrectly and fails to
chainload grub2
Andy Whitcroft (apw) wrote :

As this will scare the living daylights out of someone migrating to grub2 this is pretty important.

Changed in grub2 (Ubuntu):
assignee: nobody → Andy Whitcroft (apw)
status: New → In Progress
importance: Undecided → Medium
Andy Whitcroft (apw) wrote :

Note that in reality we are incorrectly converting the uuid to root in all legacy entries. This prevents any entry from booting from the initial menu in all cases. Bad. The user is going to be very worried. Will pull back the selector we use in grub for the same purpose.

Andy Whitcroft (apw) wrote :

Ok the attached debdiff fixed up all root options output by the conversion script to use root or uuid as appropriate for the current groot specifier. This has been tested in my PPA on several systems fixing the boot issues there.

Andy Whitcroft (apw) wrote :

@ubuntu-main-sponsors -- i am looking to get this firstly uploaded to karmic to fix conversion failures for the legacy configuration file. These failures lead the user to get total boot failues; they are trivial work around by editing the entries, but this is not obvious for the nieve user. I also want to upload this under sru this to Jaunty, sru justification to follow.

Andy Whitcroft (apw) on 2009-05-15
description: updated
Changed in grub2 (Ubuntu Jaunty):
assignee: nobody → Andy Whitcroft (apw)
status: New → In Progress
Andy Whitcroft (apw) on 2009-05-15
Changed in grub2 (Ubuntu Jaunty):
importance: Undecided → Medium
Launchpad Janitor (janitor) wrote :
Download full text (11.5 KiB)

This bug was fixed in the package grub2 - 1.96+20090523-1ubuntu1

---------------
grub2 (1.96+20090523-1ubuntu1) karmic; urgency=low

  [ Colin Watson ]
  * Resynchronise with Debian. Remaining changes:
    + debian/control:
      - Depend on rather than Suggest os-prober; Ubuntu version does not
        suffer from the mount problem that prevents Debian from marking this
       Depends.
    + debian/default/grub
      - Adjust for default Ubuntu boot options.
      - Use new GRUB_CMDLINE_LINUX_DEFAULT option to set "quiet splash" for
        default items only. These options won't be set in single user mode.
    + debian/patches/03_ubuntu_grub_standards
      - Remove GNU/Linux from default string.
  * debian/legacy/update-grub: Apply Ubuntu branding: title, recovery mode,
    quiet option, and tweak how memtest86+ is displayed.

  [ Andy Whitcroft ]
  * debian/legacy/update-grub: fix generation to use the uuid command for
    the root specifier when the groot is a UUID. Use the same test as is
    used in the 'grub' package. LP: #376879

grub2 (1.96+20090523-1) unstable; urgency=low

  * New SVN snapshot.
    - Add drivemap command, similar to grub-legacy's map command.
      (Closes: 503630)
    - Export GRUB_TERMINAL_INPUT in grub-mkconfig. (Closes: #526741)

  [ Robert Millan ]
  * rules: Set GRUB_ASSUME_LINUX_HAS_FB_SUPPORT=1 in CFLAGS.
  * patches/905_setup_force.diff: Relax blocklist warnings.
  * patches/906_revert_to_linux16.diff: Keep using linux16 for now.

  [ Felix Zielcke ]
  * patches/07_core_in_fs.diff: Updated.
  * Remove /etc/grub.d/10_hurd on non-Hurd systems in the grub-common
    preinst. Likewise for 10_freebsd for non kFreebsd and 10_linux on
    kFreebsd and Hurd. (Closes: #523777)

grub2 (1.96+20090504-1) experimental; urgency=low

  * New SVN snapshot.
    - Add support for parttool command, which can be used to hide partitions.
      (Closes: #505905)
    - Fix a segfault with LVM on RAID. (Closes: #520637)
    - Add support for char devices on (k)FreeBSD. (Closes: #521292)
    - patches/08_powerpc-ieee1275_build_fix.patch: Remove (merged).

  [ Updated translations ]
  * Basque (eu.po) by Piarres Beobide. (Closes: #522457)
  * German (de.po) by Helge Kreutzmann. (Closes: #522815)

  [ Robert Millan ]
  * Update my email address.
  * Remove 04_uuids_and_abstraction_dont_play_along_nicely.diff now that
    bugs #435983 and #455746 in mdadm and dmsetup have been fixed.

  [ Felix Zielcke ]
  * Place new grub-dumpbios in grub-common.
  * Add lpia to the archictectures to reduce the ubuntu delta.
  * Add a manpage for the update-grub and update-grub2 stubs, written by
    me. (Closes: #523876)
  * Suggest genisoimage on grub-pc and grub-ieee1275, because grub-mkrescue
    needs it to create a cd image. (Closes: #525845)
  * Add a dependency on $(AUTOGEN_FILES) for the configure/grub-common target,
    this is needed now that upstream removed the autogenerated files from SVN.
  * Add `--enable-efiemu to' `./configure' flags.
  * Add a build dependency on gcc-multilib for i386.
  * Drop alternate build dependency on gcc-4.1 (<< 4.1.2).

grub2 (1.96+20090402-1) experimental; urgency=low

  * New SVN snapshot.
    - Fix...

Changed in grub2 (Ubuntu):
status: In Progress → Fix Released

If you install grub2 on Jaunty you still run into this problem (at least I did).

Damien Cassou (cassou) wrote :

Christian Stöveken: I confirm.

Then can this fix also be released for Jaunty?
I think this is quite important, since a package in the normal repositories should not make your system unbootable.

Endolith (endolith) wrote :

Thanks for making my machine unbootable! At least I can still boot into Windows...

gregh747 (gregh7470) wrote :

Still receiving ERROR 11 when using the chainload option. Had to replace the menu.lst with the backup in order to boot without error. Purged grub2 and reinstalled and did not opt for chainload - worked.

Colin Watson (cjwatson) wrote :

Endolith: grub2 was released in jaunty for testing only, with warnings all over it - anyone testing it should have taken care to have another way to boot their machine. (A live CD should do fine.)

Narusegawa (naru-lovehina) wrote :

I ran this on Jaunty and found this problem, and I changed root to uuid as I was aware of the bug beforehand.

However when choosing the option to load Grub2 from Grub-Legacy, I just get a "Welcome to grub!" message, followed by "error: no such disk". I get a grub recovery prompt then, and when using the "ls" command I only get hd0 in the list, no hd1, hd2 at all. But gives a "error: out of disk" after that. i.e.

"(hd0) (hd0,1) (hd0,2)
error: out of disk"

FYI Grub-Legacy is in the MBR of (hd0), /boot is (hd1,1) and / is (hd1,3). (hd0) is purely a vista only drive and (hd1) is ubuntu.

I'm now sure if this is a new bug or an extension to this one. If more information is needed let me know what to do. I've been suggested to "integrate pc or gpt" into Grub2 modules but wasn't told how by the person. Sorry, not a major linux user but trying to learn :)

Felix Zielcke (fzielcke) wrote :

@Narusegawa
This is a new bug.
pc module should be already included by grub-install else you wouldn't even see the partitions of your vista disk.
But do you maybe use GPT for your Ubuntu one?
Maybe grub-probe detected it wrong.
In that case use grub-install --modules="gpt" --setup=/bin/true '(hd0)' to update grub2 (core.img) without writing to MBR
But make sure your device.map has the drives in right order, hd0 is mostly the disk grub is loaded from. If you chainload from grub-legacy that means grub-legacy not grub2.

Dominik (dominik.k) wrote :

I can confirm there are all entries with "root UUID" instead of "uuid UUID" on Jaunty, but only with the first install of grub-pc. If you've installed grub-pc before, you have to delete the files "core.img" and "grub.cfg" from /boot/grub to check this out. If not, you will be neither asked for chainloading nor will be created an entry in menu.lst.

I think it is very important to update also the Jaunty package because if you want a new installation of Karmic from a live cd-partition [1]. It seems that GRUB Legacy can't read out initrd.lz (steps I took > [2]), therefore you first need to install GRUB 2.

By the way, the existing entries are replaced from "Ubuntu 9.04" to "Debian GNU/Linux".

[1] http://kagashe.blogspot.com/2009/10/how-to-boot-ubuntu-from-desktop-iso.html
[2] https://help.ubuntu.com/community/Installation/FromLinux

Pompom0551 (pjstegmaier) wrote :

Andy,

     I need to use this patch but I've never done this before. Could you give me step by step rules to apply the patch? Right now I'm using my CD to get into the pc because of the grub bug with Error 15.

Thanks
Pamela

Tom Metro (tmetro+ubuntu) wrote :

Colin Watson wrote:
> grub2 was released in jaunty for testing only...

The instructions for upgrading to Ubuntu 9.10 warns that there are problems with some systems when identifying the root partition via UUID. The instructions imply that although this impacts both grub legacy and grub2, the workaround appears far cleaner in grub2. Therefore it is a logical preparation step for a 9.10 upgrade to start by first upgrading to grub2, then applying the setting not to use UUID, and confirming that all works before doing the dist upgrade.

Given this, I was surprised when I found this known bug to still be present in 9.04. Fortunately I had already read about the workaround in these grub2 upgrade guides:
http://www.howtoforge.com/how-to-install-grub-2-on-ubuntu-9.04
http://www.ubuntu-inside.me/2009/06/howto-upgrade-to-grub2-on-ubuntu-jaunty.html

So I'll add another vote for getting this resolved on 9.04.

LinuxTAd (linuxtad) wrote :

This is still a bug on Jaunty as of Mar. 28/2010.

 Regardless of why it was released on Jaunty, you should support it, or remove it from the repos. I agree with Tom Metro in that before jumping to the 9.10 upgrade I want to make sure it "will work" and what I have found out is that NO it does not because it is not receiving any support, or at least not the same support as has be given to Karmic. I am sure you will end up with more frustrated users as they see more and more "how to's" on the internet about moving to grub 2. I fell into this "trap" thinking that the bugs would have had to be corrected by now... I was wrong.

 Aside from the Bug, with the uuid/root I needed to test to make sure (legacy grub map commands) drivemap module, and (legacy grubs makeactive) parttool module will allow my system to boot as did their counterparts in grub legacy. I see that Karmic, from the information above, received these "essential tools" while Jaunty did not.

http://grub.enbug.org/CommandList

I have already written way to much, and I apologize for my frustration if it comes across that I am indeed frustrated. I am just of the opinion if it is left in the Jaunty repos, then update it and bug fix it. Otherwise pull it because I can tell you that when I went into Synaptic package manager and typed in Grub 2, there were no warnings about it being a "test" or warnings stating that it would render me a bootless machine, or that modules were missing that are needed to match the toolset found in Grub legacy.

Please see attached screenshot from the Synaptic Package Manger.

Sincerely,
Tom Adams

Andy Whitcroft (apw) on 2010-06-18
Changed in grub2 (Ubuntu Jaunty):
status: In Progress → Triaged
assignee: Andy Whitcroft (apw) → nobody
Benjamin Drung (bdrung) wrote :

I took the patch from comment #5, changed the version from 1.96+20080724-12ubuntu3 to 1.96+20080724-12ubuntu2.1, the release from jaunty to jaunty-proposed and uploaded it.

Accepted grub2 into jaunty-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in grub2 (Ubuntu Jaunty):
status: Triaged → Fix Committed
tags: added: verification-needed
Martin Pitt (pitti) wrote :

Anyone who can test the update in jaunty-proposed?

Colin Ian King (colin-king) wrote :

Installed Jaunty in VirtualBox, pulled in proposed grub changes, tested, hand verified that it's using uuid and not root. Works correctly for me. Thanks.

Martin Pitt (pitti) on 2010-07-28
tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 1.96+20080724-12ubuntu2.1

---------------
grub2 (1.96+20080724-12ubuntu2.1) jaunty-proposed; urgency=low

  * debian/legacy/update-grub: fix generation to use select uuid for the
    root specifier when the groot is a UUID. Use the same test as is used
    in the 'grub' package. LP: #376879
 -- Andy Whitcroft <email address hidden> Fri, 15 May 2009 12:01:11 +0100

Changed in grub2 (Ubuntu Jaunty):
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