Comment 32 for bug 703009

For the specific case of upgrading the kernel packages on a live system, I have found a trick that seems to work for me. I can't be sure it won't break something, though.

The problem in this case cannot be solved by manually running the grub utilities, as the package manager will always attempt to run grub-update by itself. This runs grub-probe on /, which is the aufs and cannot apparently be probed. If grub-probe is instead run on the /cdrom path, which contains the actual USB disk, then it runs through without errors.

My workaround involved modifying the three grub-probe lines in the /usr/sbin/grub-mkconfig script to use /cdrom instead of /. The script then ran successfully and generated what looks like the correct grub.cfg.

Basically, this changeset:

@@ -136,16 +129,16 @@ fi
 mkdir -p ${GRUB_PREFIX}

 # Device containing our userland. Typically used for root= parameter.
-GRUB_DEVICE="`${grub_probe} --target=device /`"
+GRUB_DEVICE="`${grub_probe} --target=device /cdrom`"
 GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true

 # Device containing our /boot partition. Usually the same as GRUB_DEVICE.
-GRUB_DEVICE_BOOT="`${grub_probe} --target=device /boot`"
+GRUB_DEVICE_BOOT="`${grub_probe} --target=device /cdrom/boot`"
 GRUB_DEVICE_BOOT_UUID="`${grub_probe} --device ${GRUB_DEVICE_BOOT} --target=fs_uuid 2> /dev/null`" || true

 # Filesystem for the device containing our userland. Used for stuff like
 # choosing Hurd filesystem module.
-GRUB_FS="`${grub_probe} --target=fs / 2> /dev/null || echo unknown`"
+GRUB_FS="`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2> /dev/null || echo unknown`"

 if test -f ${sysconfdir}/default/grub ; then
   . ${sysconfdir}/default/grub