1

I'm diagnosing some hardware issues using a USB stick installation of Ubuntu 11.10.

The USB stick was set up with the 11.10 image and the pendrivelinux.com method as recommended from the Ubuntu website. The USB stick is 8 GB.

My notebook allows me to boot from USB directly, so the HDD still has a Micro$oft-style boot structure (Windows 7).

After playing with the O/S a bit (and learning that my HDD has 15000 reallocated sectors) the update manager prompted me to install some updates. Everything updated correctly except for the kernel update (3.0.0.14).

There seems to be a grub error:

ubuntu@ubuntu:/dev$ sudo apt-get install
Reading package lists... Done  
Building dependency tree   
Reading state information... Done  
0 upgraded, 0 newly installed, 0 to remove and 21 not upgraded.  
3 not fully installed or removed.  
After this operation, 0 B of additional disk space will be used.  
Setting up linux-image-3.0.0-14-generic (3.0.0-14.23) ...  
Running depmod.  
update-initramfs: deferring update (hook will be called later)  
Examining /etc/kernel/postinst.d.  
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.0.0-14-generic /boot/vmlinuz-3.0.0-14-generic  
update-initramfs: Generating /boot/initrd.img-3.0.0-14-generic  
cryptsetup: WARNING: failed to detect canonical device of overlayfs  
cryptsetup: WARNING: could not determine root device from /etc/fstab  
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.0.0-14-generic /boot/vmlinuz-3.0.0-14-generic  
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.0.0-14-generic /boot/vmlinuz-3.0.0-14-generic  
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.0.0-14-generic /boot/vmlinuz-3.0.0-14-generic  
/usr/sbin/grub-probe: error: cannot find a device for / (is /dev mounted?).  
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 1

which persists any time I try to repeat the installation. Fortunately, the system is always left in a bootable state despite the failure.

Do I have to take some special steps to update the kernel? Do I have a subtle installation issue that I need to manually address to get past this?

At least one other has had the same issue on an older version of the O/S. I will provide the output of mount (as was requested in the previous question) when I get access to the laptop again.

Edit: the results of mount:

/cow on / type overlayfs (rw)   
proc on /proc type proc (rw,noexec,nosuid,nodev  
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)  
fusectl on /sys/fs/fuse/connections type fusectl (rw)  
udev on /dev type devtmpfs (rw,mode=0755)  
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)  
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)  
/dev/sdb1 on /cdrom type vfat  (rw,relatime,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)  
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)  
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)  
none on /run/shm type tmpfs (rw,nosuid,nodev)  
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)  
gvfs-fuse-daemon on /home/ubuntu/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=ubuntu)

Edit #2: I've determined that the pendrivelinux.com flash drive utility may be playing a role in this. The USB stick containing my Ubuntu distribution gets formatted as FAT32, and the boot loader that's being installed is not actually GRUB but SYSLINUX, as per the boot_info_script script.

It makes sense that grub-probe can't figure out what to do considering that grub is not involved whatsoever in the boot process.

(This leads me to wonder why doesn't apt-get check for a grub bootloader as a dependency before attempting a kernel update?)

I suppose the next step is to try and overwrite SYSLINUX with GRUB and try to get the stick bootable that way, then see if updates work.

My first stab at this led to an unbootable system - grub was loading, I could load the kernel OK but couldn't figure out what to mount as root. I had to wipe and reinstall on the flash drive to get going again.

2 Answers 2

5

I see that you fixed your problem (using Windows 7... not really a solution but anyway). I found a solution. I'm posting it here, for other users that may come across the problem.

I found how to fix this. The line that breaks the installation is:

run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.0.0-15-generic /boot/vmlinuz-3.0.0-15-generic

(The kernel version may be different on your installation)

Edit the problematic file to comment the line that update Grub. It's a very small file so it's not too difficult.

NOTE: If you want to backup the file first (it's usually a wise idea), copy it in an other directory (/root is a good one, /tmp is not since it wont survive a reboot). If you make a backup in the same folder (/etc/kernel/postinst.d/), it will be call as well, and it will fail.

Edit /etc/kernel/postinst.d/zz-update-grub to comment out line 15.

BEFORE:

    */postinst.d/*:|*/postinst.d/*:configure|*/postrm.d/*:|*/postrm.d/*:remove)
        exec update-grub
        ;;

AFTER:

    */postinst.d/*:|*/postinst.d/*:configure|*/postrm.d/*:|*/postrm.d/*:remove)
#       exec update-grub
        ;;

Run the configuration script:

sudo dpkg --configure -a

You should see a lot of debugging, and NOT the error line at the end.

To be sure, re-run the configuration. It should end immediately without any logs:

sudo dpkg --configure -a

Now, you can restore the zz-update-grub file, just in case you want to install an other kernel later and grub start to work with overlayfs.

1
  • This helped me out on Ubuntu 12.04 several years after the fact, so... thanks.
    – Novak
    Jun 26, 2015 at 3:39
0

Did you fix your problem? I have the same error here. I don't really need to fix it, I can easily re-install the system on the USB stick, but I like the challenge :)

The clever way to fix this would be to instruct Grub how to understand overlayfs, but I don't know the package I have to install for this (if any). Since my USB stick is still bootable, I want to force apt-get to ignore this warning. I.E. Consider this package as installed, even if it's not completely true. Well, technically, it has been install properly, only Grub fail to update the MBR. It's not a big deal since it's booting the latest version of the kernel.

Every attempt takes a while because it try to configure the package but Grub fail, than it try to rollback and Grub fail again...

I tried the following without success:

(apt-get -f is for fixing problems)
sudo apt-get -f install
sudo apt-get -f --force-yes install
sudo apt-get --force-yes install linux-image-3.0.0-15-generic
sudo apt-get install --force-yes linux-image-3.0.0-15-generic
sudo dpkg --force-all -i linux-image-3.0.0-15-generic
sudo apt-mark manual linux-image-3.0.0-15-generic
(the following command is the one that trigger the bug)
sudo dpkg --configure -a
sudo dpkg --configure --force-all -a
(I think the next one need the .deb file)
sudo dpkg --force-confmiss -i linux-image-3.0.0-15-generic
sudo dpkg --force-confold -i linux-image-3.0.0-15-generic
sudo dpkg --no-triggers -i linux-image-3.0.0-15-generic

... and many more...

1
  • Unfortunately no. The Mrs. wanted her computer back so I simply got a new HDD and infected it with Win7. Jan 24, 2012 at 12:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .