Grub update fails ("hideously") on usb-creator images

Bug #591202 reported by Mark Shuttleworth
30
This bug affects 4 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Fix Released
High
Colin Watson
Lucid
Fix Released
High
Colin Watson
Maverick
Invalid
High
Colin Watson

Bug Description

Binary package hint: grub2

When dist-upgrading a usb-creator USB system, grub gives very bad advice about where to install the updated grub, and then fails when the USB partitions are specified.

SRU justification:

Impact: Significant confusion. It's (probably) possible to get this upgrade to do the right thing, but it's certainly not obvious.

Development branch: Fixed in grub2 1.99~rc1-1ubuntu1 with a pair of fixes, both straightforwardly backportable:

  * If we're upgrading and /boot/grub/core.img doesn't exist, then don't ask
    where to install GRUB, since it probably means we're in some kind of
    specialised environment such as a live USB stick (LP: #591202).
  * Drop the default priority of grub2/linux_cmdline to medium. We only
    need to ask it if we're upgrading from GRUB Legacy and found an empty
    kopt in menu.lst (LP: #591202).

Patch:
 http://bazaar.launchpad.net/~ubuntu-core-dev/ubuntu/lucid/grub2/lucid/revision/1981?compare_revid=1978
 http://bazaar.launchpad.net/~ubuntu-core-dev/ubuntu/maverick/grub2/maverick/revision/2050?compare_revid=2047

TEST CASE: Create a live USB stick from 10.04.1 or 10.10 as released. Upgrade the grub-pc package to the current version. The version currently in lucid-updates (1.98-1ubuntu9) and the version currently in maverick-updates (1.98+20100804-5ubuntu3) should ask confusing questions as described in the original report; the new version should install noninteractively, should not generate /boot/grub/core.img, and should not affect the system's current boot loader arrangements.

Regression potential: It would be worth testing normal system upgrades (not on a live USB stick) to ensure that they still work properly. In particular, the timestamp of /boot/grub/core.img should be updated when upgrading the grub-pc package.

Colin Watson (cjwatson)
Changed in grub2 (Ubuntu):
status: New → Triaged
importance: Undecided → High
assignee: nobody → Colin Watson (cjwatson)
Revision history for this message
rupert (r-plumridge) wrote :

This seems like the same bug that I've noticed when using the Maverick mini.iso. If you install Ubuntu via a flash drive (created with Unetbootin or Ubuntu Startup Disk Creator) grub2 installs to /dev/sda which is the flash drive that you are installing FROM, not the drive you are installing TO. This then makes the system unbootable and could leave lots of inexperienced users very disenfranchised.

Ideally, grub should give you the option of what drive to install it to during the Ubuntu installation process.

To fix this in the short term, leave the flash drive you installed FROM in the PC and once Ubuntu and been installed when the PC reboots, choose to boot from the flash drive, this will then boot the newly installed Ubuntu installation. Then, login and type sudo fdisk -l to find out the name of the hardrive you need grub2 installed to. Finally install grub2 by issuing sudo grub-install /dev/sdX where /dev/sdX is the name of the drive that the fdisk command gave you.

Revision history for this message
Colin Watson (cjwatson) wrote :

@rupert: No, that's not the same problem as I asked Mark to report here. Please report it separately with full logs (there may well already be a bug report about it, probably on the grub-installer package).

Changed in grub2 (Ubuntu Lucid):
importance: Undecided → High
milestone: none → ubuntu-10.04.2
status: New → Triaged
Changed in grub2 (Ubuntu Maverick):
importance: Undecided → High
status: New → Triaged
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.9 KiB)

This bug was fixed in the package grub2 - 1.99~rc1-1ubuntu1

---------------
grub2 (1.99~rc1-1ubuntu1) natty; urgency=low

  * Resynchronise with Debian. Remaining changes:
    - Adjust for default Ubuntu boot options ("quiet splash").
    - Default to hiding the menu; holding down Shift at boot will show it.
    - Set a monochromatic theme and an aubergine background for Ubuntu.
    - Apply Ubuntu GRUB Legacy changes to legacy update-grub script: title,
      recovery mode, quiet option, tweak how memtest86+ is displayed, and
      use UUIDs where appropriate.
    - Fix backslash-escaping in merge_debconf_into_conf.
    - Remove "GNU/Linux" from default distributor string.
    - Add crashkernel option.
    - Bypass menu unless other OSes are installed or Shift is pressed.
    - Allow Shift to interrupt 'sleep --interruptible'.
    - Reduce visual clutter in normal mode.
    - Remove verbose messages printed before reading configuration.
    - Suppress kernel/initrd progress messages, except in recovery mode.
    - Handle filesystems loop-mounted on file images.
    - Ignore devices loop-mounted from files in Linux grub.d scripts.
    - Show the boot menu if the previous boot failed.
    - Don't generate device.map during grub-install or grub-mkconfig.
    - Adjust upgrade version checks for Ubuntu.
    - Suppress "GRUB loading" message unless Shift is held down.
    - Adjust versions of grub-doc and grub-legacy-doc conflicts.
    - Fix LVM/RAID probing in the absence of /boot/grub/device.map.
    - Look for .mo files in /usr/share/locale-langpack first.
    - Make sure GRUB_TIMEOUT isn't quoted unnecessarily.
    - Build-depend on qemu-kvm rather than qemu-system for grub-pc tests.
    - Use qemu rather than qemu-system-i386.
    - Add a grub-rescue-efi-amd64 package.
    - On Wubi, don't ask for an install device, but just update wubildr
      using the diverted grub-install.
    - Enable lua from grub-extras.
    - Incorporate the bitop library into lua.
    - Add enum_pci function to grub module in lua.
    - Check hardware support before using gfxpayload=keep.
    - Build part_msdos and vfat into EFI boot images.
    - Put second and subsequent Linux menu entries in a submenu.
    - Preferred resolution detection for VBE.
    - Set vt.handoff=7 for smooth handoff to kernel graphical mode.
  * Fix logic error in VBE resolution detection that meant EDID information
    was never used (LP: #693093).
  * Export linux_gfx_mode so that it's usable in submenus (LP: #702594).
  * Restore grub_mkdevicemap and associated options to grub-install, since
    it's needed when doing EFI installs (thanks, Jason Gunthorpe;
    LP: #702707).
  * Don't fail when there are no *.lua files in $pkglibdir (thanks, Jason
    Gunthorpe; LP: #702707).
  * If we're upgrading and /boot/grub/core.img doesn't exist, then don't ask
    where to install GRUB, since it probably means we're in some kind of
    specialised environment such as a live USB stick (LP: #591202).
  * Drop the default priority of grub2/linux_cmdline to medium. We only
    need to ask it if we're upgrading from GRUB Legacy and found an empty
    kopt in menu.lst (LP: #591202).

grub2 (1.99~rc1-1...

Read more...

Changed in grub2 (Ubuntu):
status: Triaged → Fix Released
Colin Watson (cjwatson)
description: updated
Colin Watson (cjwatson)
Changed in grub2 (Ubuntu Lucid):
status: Triaged → In Progress
Changed in grub2 (Ubuntu Maverick):
status: Triaged → In Progress
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted grub2 into lucid-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 Lucid):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Colin Watson (cjwatson) wrote :

BTW, on maverick, this may run into bug 667578. You might want to remove /etc/kernel/postinst.d/zz-update-grub to work around this for the purposes of validating this bug; the two are more or less independent.

(Bug 667578 doesn't affect lucid.)

Changed in grub2 (Ubuntu Lucid):
assignee: nobody → Colin Watson (cjwatson)
Changed in grub2 (Ubuntu Maverick):
assignee: nobody → Colin Watson (cjwatson)
Revision history for this message
Martin Pitt (pitti) wrote :

Accepted grub2 into maverick-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 Maverick):
status: In Progress → Fix Committed
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

SRU verification for Lucid:
I have reproduced the problem with grub2 1.98-1ubuntu9 in lucid-updates and have verified that the version of grub2 1.98-1ubuntu10 in -proposed fixes the issue.

Marking as verification-done

tags: added: verification-done
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 1.98-1ubuntu10

---------------
grub2 (1.98-1ubuntu10) lucid-proposed; urgency=low

  * If we're upgrading and /boot/grub/core.img doesn't exist, then don't ask
    where to install GRUB, since it probably means we're in some kind of
    specialised environment such as a live USB stick (LP: #591202).
  * Drop the default priority of grub2/linux_cmdline to medium. We only
    need to ask it if we're upgrading from GRUB Legacy and found an empty
    kopt in menu.lst (LP: #591202).
 -- Colin Watson <email address hidden> Thu, 20 Jan 2011 15:43:48 +0000

Changed in grub2 (Ubuntu Lucid):
status: Fix Committed → Fix Released
Martin Pitt (pitti)
tags: removed: verification-done
Revision history for this message
Martin Pitt (pitti) wrote :

Any testers for maverick? This is currently blocking another SRU which waits in the queue.

Revision history for this message
Mark Shuttleworth (sabdfl) wrote : Re: [Bug 591202] Re: Grub update fails ("hideously") on usb-creator images

So, to test this, am I right in saying that I should be able to:

 - make a USB stick with a maverick ISO
 - boot off it
 - do updates (whoa, lots :-))
 - then boot off it and see the updates have been applied
 - then install from it and have the updates installed already?

Mark

tags: added: testcase
Revision history for this message
JC Hulce (soaringsky) wrote :

This bug affects Ubuntu 10.10, Maverick Meerkat. Maverick has reached end-of-life and is no longer supported, so I am closing the bugtask for Maverick. Please upgrade to a newer version of Ubuntu.
More information here: https://lists.ubuntu.com/archives/ubuntu-announce/2012-April/000158.html

Changed in grub2 (Ubuntu Maverick):
status: Fix Committed → 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.