grub-probe fails on lvm-encrypted install with btrfs

Bug #757631 reported by Martin Erik Werner on 2011-04-11
46
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Release Notes for Ubuntu
Undecided
Colin Watson
grub2 (Ubuntu)
High
Colin Watson
Natty
Wishlist
Unassigned
Oneiric
High
Colin Watson
partman-btrfs (Ubuntu)
High
Colin Watson
Natty
Medium
Colin Watson
Oneiric
High
Colin Watson

Bug Description

Binary package hint: grub2

Install was done using the "Setup encrypted LVM" option, simply changing ext4->btrfs

Grub fails to add the "rootflags=subvol=@" to the kernel boot options, making the system stop at initramfs on boot, unless added manually, at which point it seems to boot fine.

When booted grub-probe seems not to work, which I assume is the core issue:
arand@nnb:~$ sudo grub-probe /
grub-probe: error: no such disk.

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: grub-pc 1.99~rc1-11ubuntu1
ProcVersionSignature: Ubuntu 2.6.38-8.41-generic 2.6.38.2
Uname: Linux 2.6.38-8-generic x86_64
Architecture: amd64
Date: Mon Apr 11 15:44:50 2011
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Beta amd64 (20110410)
ProcEnviron:
 LANGUAGE=en_GB:en
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: grub2
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Martin Erik Werner (arand) wrote :
Colin Watson (cjwatson) wrote :

This is because GRUB doesn't yet have its own LUKS support, so can't detect that the filesystem is btrfs and doesn't know to add rootflags=subvol=@.

This isn't likely to be fixed for natty.

Changed in grub2 (Ubuntu):
importance: Undecided → Wishlist
status: New → Triaged
Colin Watson (cjwatson) wrote :

We should release-note that this is not a supported configuration.

Changed in partman-btrfs (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Changed in grub2 (Ubuntu Natty):
status: Triaged → Won't Fix
Changed in partman-btrfs (Ubuntu Natty):
milestone: none → ubuntu-11.04
Colin Watson (cjwatson) wrote :

Perhaps partman-btrfs ought to warn during installation, too.

Colin Watson (cjwatson) wrote :

Release-noted:

  GRUB cannot detect a btrfs installation within an encrypted disk, and fails to set up the correct kernel parameters. (757631)

Changed in ubuntu-release-notes:
assignee: nobody → Colin Watson (cjwatson)
status: New → Fix Released
Changed in grub2 (Ubuntu Oneiric):
importance: Wishlist → High
Changed in partman-btrfs (Ubuntu Natty):
milestone: ubuntu-11.04 → natty-updates
Changed in grub2 (Ubuntu Oneiric):
assignee: nobody → Canonical Foundations Team (canonical-foundations)
Changed in partman-btrfs (Ubuntu Natty):
assignee: nobody → Canonical Foundations Team (canonical-foundations)
Changed in partman-btrfs (Ubuntu Oneiric):
assignee: nobody → Canonical Foundations Team (canonical-foundations)
importance: Medium → High
milestone: ubuntu-11.04 → ubuntu-11.10-beta-1
alexeagar (alexeagar) wrote :

I believe this patch fixes one of the kernel parameters.

https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/776850

Colin Watson (cjwatson) wrote :

The suggestion in bug 776850 is incorrect, I'm afraid. I've left more detailed feedback there.

alexeagar (alexeagar) wrote :

Thanks for the feedback Colin. Here's another workaround that works better. Perhaps it can help somebody to put together a proper fix.

In /etc/grub.d/10_linux, replace this line:

if [ "x`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`" = xbtrfs ]; then

with these two lines:

#if [ "x`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`" = xbtrfs ]; then
if [ "x`stat -f --printf=%T /`" = xbtrfs ]; then

alexeagar (alexeagar) wrote :

Oh, I forgot to mention that after replacing the line mentioned in comment #8, you've then got to run 'sudo update-grub2'.

Sorry for the double post.

Colin Watson (cjwatson) on 2011-06-14
Changed in grub2 (Ubuntu Oneiric):
assignee: Canonical Foundations Team (canonical-foundations) → Colin Watson (cjwatson)
Changed in partman-btrfs (Ubuntu Natty):
assignee: Canonical Foundations Team (canonical-foundations) → Colin Watson (cjwatson)
Changed in partman-btrfs (Ubuntu Oneiric):
assignee: Canonical Foundations Team (canonical-foundations) → Colin Watson (cjwatson)
Colin Watson (cjwatson) wrote :

Committed to the Debian branch, thanks.

Changed in grub2 (Ubuntu Oneiric):
status: Triaged → In Progress
Launchpad Janitor (janitor) wrote :
Download full text (3.3 KiB)

This bug was fixed in the package grub2 - 1.99-7ubuntu1

---------------
grub2 (1.99-7ubuntu1) oneiric; 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 appropriate background for Ubuntu.
    - Apply Ubuntu GRUB Legacy changes to legacy update-grub script.
    - 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.
    - 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.
    - Build-depend on qemu-kvm rather than qemu-system for grub-pc tests.
    - Check hardware support before using gfxpayload=keep.
    - 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.
    - Update default/grub.md5sum to include maverick's default md5sum.
    - Add nomodeset to Linux kernel arguments in recovery mode.

grub2 (1.99-7) unstable; urgency=low

  [ Debconf translations ]
  * Basque (Iñaki Larrañaga Murgoitio). Closes: #628716
  * Swedish (Martin Bagge / brother). Closes: #628866
  * Czech (Miroslav Kure). Closes: #628978
  * Brazilian Portuguese (Flamarion Jorge). Closes: #629135
  * Spanish (Francisco Javier Cuadrado). Closes: #629633

  [ Colin Watson ]
  * Cope with btrfs / inside an encrypted block device (thanks, alexeagar;
    LP: #757631).
  * Merge from Ubuntu:
    - Give up scanning partitions after ten consecutive open failures
      (LP: #787461).

grub2 (1.99-6) unstable; urgency=low

  [ Colin Watson ]
  * Update Vcs-* fields for Alioth changes.
  * Backport from upstream, removing the need for Breaks: udev (<< 168-1):
    - Don't stat devices unless we have to.

  [ Debconf translations ]
  * Catalan (Jordi Mallach).
  * Farsi (Behrad Eslamifar). Closes: #628648

grub2 (1.99-5) unstable; urgency=low

  [ Colin Watson ]
  * Change grub2/linux_cmdline and grub2/kfreebsd_cmdline descriptions to
    indicate that the command line is allowed to be empty, since this is a
    common source of confusion (thanks, Jordan Uggla).
  * On non-Ubuntu-derived systems, add Breaks: udev (<< 168-1) to
    grub-common, for the sake of (some?) users without initrds (closes:
    #627587).

  [ Debconf translations ]
  * French (Christian Perrier)
  * Russian (Yuri Kozlov). Closes: #628196
  * S...

Read more...

Changed in grub2 (Ubuntu Oneiric):
status: In Progress → Fix Released
Colin Watson (cjwatson) on 2011-08-24
Changed in partman-btrfs (Ubuntu Oneiric):
milestone: ubuntu-11.10-beta-1 → ubuntu-11.10-beta-2
tags: added: rls-mgr-o-tracking
Colin Watson (cjwatson) wrote :

I think my addition of the partman-btrfs task here was a mistake. The grub2 fix should be enough, and partman-crypto is already supposed to warn about the case where /boot is encrypted as well.

Changed in partman-btrfs (Ubuntu Oneiric):
status: Triaged → Invalid
Changed in partman-btrfs (Ubuntu Natty):
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers