Unable to install GRUB2 to the same device as contains aufs in natty

Bug #700910 reported by Mario Limonciello on 2011-01-10
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: grub2

version: 1.99~20110106-1ubuntu1

I'm attempting to install GRUB2 to the same device that contains AUFS. Eg the entire ISO image is placed on a partition, and i'm trying to install GRUB to that same partition while booted into an environment that has that AUFS image loaded.

Here's what the mount layout looks like:
---------------------------
# mount
aufs on / type aufs (rw)
none on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
/dev/sda2 on /cdrom type vfat (rw,noatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/loop0 on /rofs type squashfs (ro,noatime)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)

---------------------------
Here's the GRUB install command I am using:
---------------------------
# sudo grub-install --force --root-directory=/cdrom /dev/sda2
/usr/sbin/grub-probe: error: cannot stat `aufs'.
Auto-detection of a filesystem of aufs failed.
Please report this together with the output of "/usr/sbin/grub-probe --device-map="/cdrom/boot/grub/device.map" --target=fs -v /cdrom/boot/grub" to <email address hidden>

---------------------------
Here's a rather simple GRUB probe line that is failing. It should return /dev/sda2 (as that's where /cdrom is actually mounted)
---------------------------
# grub-probe --verbose --target=device /cdrom/boot/grub/
aufs

---------------------------
Here's the GRUB probe that grub-install requested in bugs
---------------------------
# /usr/sbin/grub-probe --device-map="/cdrom/boot/grub/device.map" --target=fs -v /cdrom/boot/grub
/usr/sbin/grub-probe: info: scanning hd0 for LVM.
/usr/sbin/grub-probe: info: scanning hd0 for LVM.
/usr/sbin/grub-probe: error: cannot find a GRUB drive for aufs. Check your device.map.

---------------------------
This is a regression from grub2 1.99~20110104-2ubuntu1.

Mario Limonciello (superm1) wrote :

And actually this is a very recent regression. In the live env I downgraded grub-common and grub-pc to 1.99~20110104-2ubuntu1 and the probe command returns correctly:

#grub-probe --verbose --target=device /cdrom/boot/grub
/dev/sda2

description: updated
Mario Limonciello (superm1) wrote :

Reverting r3022 from upstream fixes the problem.

Colin Watson (cjwatson) wrote :

Can you try 1.99~20110112-1ubuntu1, once it builds? I think that may well fix it (see bug 700147).

If this still doesn't work, I'd like to see /proc/self/mountinfo.

Mario Limonciello (superm1) wrote :

I just grabbed the debs from Launchpad and tested in a live environment. It appears to fix the problem, thanks. I'll mark this as a duplicate accordingly.

Changed in grub2 (Ubuntu):
status: New → Fix Released
Mario Limonciello (superm1) wrote :

It appears that this only resolved problems when grub was being installed to another partition. There is still some breakage when trying to install it to the same one as booted. Here's /proc/self/mountinfo from a failing system with an ISO built on 1/18 (Grub2 1.99~20110112-1ubuntu1).

14 22 0:14 / /sys rw,nosuid,nodev,noexec,relatime - sysfs none rw
15 22 0:3 / /proc rw,nosuid,nodev,noexec,relatime - proc none rw
16 22 0:5 / /dev rw,relatime - devtmpfs none rw,size=375128k,nr_inodes=93782,mode=755
17 16 0:11 / /dev/pts rw,nosuid,noexec,relatime - devpts none rw,gid=5,mode=620,ptmxmode=000
18 14 0:15 / /sys/fs/fuse/connections rw,relatime - fusectl fusectl rw
19 22 8:2 / /cdrom rw,noatime - vfat /dev/sda2 rw,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro
20 22 7:0 / /rofs ro,noatime - squashfs /dev/loop0 ro
22 1 0:17 / / rw,noatime - aufs aufs rw,si=f7804fb4
23 14 0:7 / /sys/kernel/debug rw,relatime - debugfs none rw
24 14 0:10 / /sys/kernel/security rw,relatime - securityfs none rw
25 16 0:18 / /dev/shm rw,nosuid,nodev,relatime - tmpfs none rw
26 22 0:19 / /tmp rw,nosuid,nodev,relatime - tmpfs tmpfs rw
27 22 0:20 / /var/run rw,nosuid,relatime - tmpfs none rw,mode=755
28 22 0:21 / /var/lock rw,nosuid,nodev,noexec,relatime - tmpfs none rw
29 15 0:22 / /proc/sys/fs/binfmt_misc rw,nosuid,nodev,noexec,relatime - binfmt_misc binfmt_misc rw

Changed in grub2 (Ubuntu):
status: Fix Released → New
Colin Watson (cjwatson) wrote :

I tried to reproduce this with a current desktop CD image and failed. I created /dev/sda1 (vfat, 2G), /dev/sda2 (ext3, 7G), /dev/sda3 (swap, 1G); rsynced the contents of the CD image to /dev/sda1; rebooted with 'LIVEMEDIA=/dev/sda1 ubiquity/partman-skip-unmount=true'; applied ubiquity r4687 to prevent an unrelated crash; and installed to /dev/sda2 and /dev/sda3, telling it to install GRUB to /dev/sda1. The installation completed successfully.

If this is still happening to you on current Natty images, could you please describe how to reproduce it, and attach full logs? Thanks in advance.

Changed in grub2 (Ubuntu):
status: New → Incomplete
AciD (acid-linuxfr) wrote :

I downloaded a natty daily build yesterday the 26th of april, then tried to install it today the 27th.
Everything went fine until the installer tried to `grub-install`. It died with the "/usr/sbin/grub-probe: error: cannot stat `aufs'."

So here is what I did :
1/ Format a 15GB partition with btrfs
2/ Install the whole Natty (/) in that partition, no other partition for /home
3/ Create mount points for my 2 others distrib and 1 big /home in /mnt
4/ Select encrypted /home
5/ Hit "install" -> Error

For information, I installed Debian 6 previously, so it already had grub2 installed.

AciD (acid-linuxfr) wrote :

I forgot to add the following informations :
root@ubuntu:~# dpkg -l|grep grub
ii grub-common 1.99~rc1-13ubuntu3 GRand Unified Bootloader, version 2 (common files)
ii grub-gfxpayload-lists 0.2 GRUB gfxpayload blacklist
ii grub-pc 1.99~rc1-13ubuntu3 GRand Unified Bootloader, version 2 (PC/BIOS version)

Also, I tried to fix the unbootable netbook problem with chroot :
root@ubuntu:~# mount -o bind /proc /mnt/linux/proc/
root@ubuntu:~# mount -o bind /dev /mnt/linux/dev/
root@ubuntu:~# chroot /mnt/linux/ /bin/bash
ubuntu:/# update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.38-020638-generic
Found initrd image: /boot/initrd.img-2.6.38-020638-generic
Found linux image: /boot/vmlinuz-2.6.35-28-generic
Found initrd image: /boot/initrd.img-2.6.35-28-generic
Found memtest86+ image: /boot/memtest86+.bin
Cannot find list of partitions!
done

I'll reboot to see if this worked.

Launchpad Janitor (janitor) wrote :

[Expired for grub2 (Ubuntu) because there has been no activity for 60 days.]

Changed in grub2 (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers