grub2 fails to install on md0

Bug #743136 reported by Kees van Vloten
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Fix Released
High
Colin Watson
Natty
Fix Released
High
Colin Watson

Bug Description

Binary package hint: grub-pc

During installation of Natty I get the error below, this error did not occur in Maverick.
/dev/md0 is a raid0 device.
I have tried the filesystems ext2 and ext4 for /boot but both result in the same error.

Mar 26 14:14:26 debconf: --> PROGRESS INFO grub-installer/progress/step_install_loader
Mar 26 14:14:26 debconf: <-- 0 OK
Mar 26 14:14:26 grub-installer: info: Installing grub on '/dev/sda /dev/sdb'
Mar 26 14:14:26 grub-installer: info: grub-install supports --no-floppy
Mar 26 14:14:26 grub-installer: info: Running chroot /target grub-install --no-floppy --force "/dev/sda"
Mar 26 14:14:27 grub-installer: /usr/sbin/grub-probe: error: no such disk.
Mar 26 14:14:27 grub-installer: Auto-detection of a filesystem of /dev/md0 failed.
Mar 26 14:14:27 grub-installer: Please report this together with the output of "/usr/sbin/grub-probe --device-map="/boot/grub/device.map" --target=fs -v /boot/grub" to <email address hidden>
Mar 26 14:14:27 grub-installer: error: Running 'grub-install --no-floppy --force "/dev/sda"' failed.
Mar 26 14:14:27 debconf: --> SUBST grub-installer/grub-install-failed BOOTDEV /dev/sda
Mar 26 14:14:27 debconf: Adding [BOOTDEV] -> [/dev/sda]
Mar 26 14:14:27 debconf: <-- 0
Mar 26 14:14:27 debconf: --> INPUT critical grub-installer/grub-install-failed

Tags: patch natty

Related branches

Kees van Vloten (kvv)
tags: added: natty
Revision history for this message
Colin Watson (cjwatson) wrote :

This is not the same as bug 733116. Looking at debug output, grub-probe appears to think that the RAID0 device has zero sectors, which is distinct from the problem in bug 733116.

Colin Watson (cjwatson)
Changed in grub2 (Ubuntu):
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Colin Watson (cjwatson)
Colin Watson (cjwatson)
Changed in grub2 (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Colin Watson (cjwatson) wrote :

I've forwarded a patch for this upstream.

Colin Watson (cjwatson)
Changed in grub2 (Ubuntu Natty):
milestone: none → ubuntu-11.04-beta-2
Colin Watson (cjwatson)
Changed in grub2 (Ubuntu Natty):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.2 KiB)

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

---------------
grub2 (1.99~rc1-8ubuntu1) 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.
    - Build-depend on qemu-kvm rather than qemu-system for grub-pc tests.
    - 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.
    - 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.
  * Drop patch to use qemu rather than qemu-system-i386, now that qemu-kvm
    ships a symlink.
  * Rewrite hwmatch.lua in C. Drop lua grub-extras module.
  * Update ubuntu_vbe_autodetect.patch, bringing GRUB_GFXMODE documentation
    up to date.
  * Fix use of freed memory when replacing existing loopback device
    (LP: #742967).

grub2 (1.99~rc1-8) unstable; urgency=low

  * Cherry-pick from upstream:
    - Fix FreeBSD compilation problem.

grub2 (1.99~rc1-7) unstable; urgency=low

  * Add /proc/mdstat, LVM information, and listings of /dev/disk/by-id/ and
    /dev/disk/by-uuid/ to bug reports, by request of upstream.
  * Cherry-pick from upstream:
    - Use libgeom on FreeBSD to detect partitions (closes: #612128).
    - Copy the partition table zone if floppy support is disabled, even if
      no partition table is found (LP: #741867).
    - Fix an ext2 overflow affecting inodes past 2TiB.
    - Fix RAID-0 disk size calculation for metadata 1.x (LP: #743136).
  * Merge from Ubuntu:
    - Build with gcc-4.5 on ppc64.
    - Add apport hook for ProblemType = 'Package', thanks to...

Read more...

Changed in grub2 (Ubuntu Natty):
status: Fix Committed → Fix Released
Revision history for this message
Kees van Vloten (kvv) wrote :

The problem seems to be unresolved:

dpkg -l | grep grub
ii grub-common 1.99~rc1-8ubuntu1 GRand Unified Bootloader, version 2 (common files)
ii grub-pc 1.99~rc1-8ubuntu1 GRand Unified Bootloader, version 2 (PC/BIOS version)

cat /var/log/syslog

Apr 4 18:59:06 debconf: --> GET cdrom-detect/hybrid
Apr 4 18:59:06 debconf: <-- 10 cdrom-detect/hybrid doesn't exist
Apr 4 18:59:06 debconf: --> SET grub-installer/bootdev /dev/sda /dev/sdb
Apr 4 18:59:06 debconf: <-- 0 value set
Apr 4 18:59:06 debconf: --> PROGRESS STEP 1
Apr 4 18:59:06 debconf: <-- 0 OK
Apr 4 18:59:06 debconf: --> PROGRESS INFO grub-installer/progress/step_bootdev
Apr 4 18:59:06 debconf: <-- 0 OK
Apr 4 18:59:06 debconf: --> INPUT high grub-installer/only_debian
Apr 4 18:59:06 debconf: <-- 30 question skipped
Apr 4 18:59:06 debconf: --> GO
Apr 4 18:59:06 debconf: <-- 0 ok
Apr 4 18:59:06 debconf: --> GET grub-installer/only_debian
Apr 4 18:59:06 debconf: <-- 0 true
Apr 4 18:59:06 debconf: --> GET grub-installer/bootdev_directory
Apr 4 18:59:06 debconf: <-- 0
Apr 4 18:59:06 debconf: --> PROGRESS STEP 1
Apr 4 18:59:06 debconf: <-- 0 OK
Apr 4 18:59:06 debconf: --> SUBST grub-installer/progress/step_install_loader BOOTDEV /dev/sda /dev/sdb
Apr 4 18:59:06 debconf: Adding [BOOTDEV] -> [/dev/sda /dev/sdb]
Apr 4 18:59:06 debconf: <-- 0
Apr 4 18:59:06 debconf: --> PROGRESS INFO grub-installer/progress/step_install_loader
Apr 4 18:59:06 debconf: <-- 0 OK
Apr 4 18:59:06 grub-installer: info: Installing grub on '/dev/sda /dev/sdb'
Apr 4 18:59:06 grub-installer: info: grub-install supports --no-floppy
Apr 4 18:59:06 grub-installer: info: Running chroot /target grub-install --no-floppy --force "/dev/sda"
Apr 4 18:59:06 grub-installer: /usr/sbin/grub-probe: error: no such disk.
Apr 4 18:59:06 grub-installer: Auto-detection of a filesystem of /dev/md0 failed.
Apr 4 18:59:06 grub-installer: Please report this together with the output of "/usr/sbin/grub-probe --device-map="/boot/grub/device.map" --target=fs -v /boot/grub" to <email address hidden>
Apr 4 18:59:06 grub-installer: error: Running 'grub-install --no-floppy --force "/dev/sda"' failed.
Apr 4 18:59:06 debconf: --> SUBST grub-installer/grub-install-failed BOOTDEV /dev/sda
Apr 4 18:59:06 debconf: Adding [BOOTDEV] -> [/dev/sda]
Apr 4 18:59:06 debconf: <-- 0
Apr 4 18:59:06 debconf: --> INPUT critical grub-installer/grub-install-failed
Apr 4 18:59:06 debconf: <-- 0 question will be asked

Revision history for this message
Kees van Vloten (kvv) wrote :

Unfortunately this bug is still unresolved in Grub version 1.99~rc1-8ubuntu1

Changed in grub2 (Ubuntu Natty):
status: Fix Released → Confirmed
Revision history for this message
Colin Watson (cjwatson) wrote :

kvv, can you please give me a recipe for reproducing this problem, and ideally also full installation logs of your latest test? I tried the simple case of two 10GiB disks in kvm with a single RAID-0 array spanning them both, and an ext4 filesystem on that; GRUB installed and booted with no problems.

It will be a great deal easier for me to fix your problem if I can reproduce it.

Revision history for this message
Kees van Vloten (kvv) wrote :

Colin,
Attached is a tar file with preseed.cfg and other files to reproduce the test. It also contains (install-) syslogs for Maverick and Natty as well additional tars with all log files.

Regards, Kees van Vloten

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

Thanks. I've reproduced this and am debugging now.

Changed in grub2 (Ubuntu Natty):
status: Confirmed → In Progress
Revision history for this message
Colin Watson (cjwatson) wrote :

I think this would actually be best fixed in your custom-partitioner udeb, although it was triggered by a change in mdadm in natty. Compare the corresponding fixes that we made to our standard partitioner:

  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=591917
  http://bazaar.launchpad.net/~ubuntu-installer/partman-md/master/revision/1016

Could you try the attached patch, which should work in older releases as well as in natty?

tags: added: patch
Revision history for this message
Kees van Vloten (kvv) wrote :

Colin,
It works with Maverick as well as with Natty.
Many thanks !

Kees.

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

Excellent. Thanks for confirming.

Changed in grub2 (Ubuntu Natty):
status: In Progress → Fix Released
Revision history for this message
Youssef Eldakar (youssefeldakar) wrote :

Is this supposed to be fixed in Natty? I am using a standard partman-auto-raid/recipe in a preseeded Natty install and am running into the same issue:

d-i partman-auto-raid/recipe string \
                1 2 0 jfs / \
                        /dev/sda5#/dev/sdc5 \
                        . \
                0 4 0 swap - \
                        /dev/sda6#/dev/sdb6#/dev/sdc6#/dev/sdd6 \
                        . \
                1 2 0 jfs /usr \
                        /dev/sda7#/dev/sdc7 \
                        . \
                5 4 0 jfs /var \
                        /dev/sda8#/dev/sdb8#/dev/sdc8#/dev/sdd8 \
                        . \
                0 4 0 jfs /tmp \
                        /dev/sda9#/dev/sdb9#/dev/sdc9#/dev/sdd9 \
                        . \
                5 4 0 jfs /srv \
                        /dev/sda1#/dev/sdb1#/dev/sdc1#/dev/sdd1 \
                        .

Symlinking /dev/md0 to /dev/md/0 before running the grub-install seems to get it to succeed.

I am sorry if this is not the appropriate place for this comment.

Revision history for this message
Youssef Eldakar (youssefeldakar) wrote :

The simplest workaround I could come up with for getting grub-installer to succeed with RAID devices on Natty was:

d-i grub-installer/skip boolean true
d-i lilo-installer/skip boolean true

d-i preseed/late_command string ln -s ../md0 /dev/md/0; grub-installer /target

Revision history for this message
Xiaoning Li (xxnnli) wrote :

Dear debain-installer maintainer:

I found the same bug in partman-auto-raid. I could not preseed lvm over raid on Ubuntu 11.04 and 11.10.

in /bin/auto-raidcfg
.... ....
mdadm --create /dev/md$MD_NUM --auto=yes --force -R -l raid$RAID_TYPE \
        -n $DEV_COUNT $MDADM_PARAMS
... ...

Could you please also fix this? thank you!

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.