USB记忆棒安装上的内核更新因grub-probe错误而失败

我正在使用Ubuntu 11.10的USB记忆棒安装来诊断一些硬件问题。

根据Ubuntu网站的建议,使用11.10映像和pendrivelinux.com方法设置了USB记忆棒。 USB记忆棒为8 GB。

我的笔记本允许我直接从USB启动,因此硬盘仍然具有Micro $ oft风格的启动结构(Windows 7)。

在稍微使用O / S(并且知道我的HDD有15000个重新分配的扇区)后,更新管理器提示我安装一些更新。 除了内核更新(3.0.0.14)之外,所有内容都已正确更新。

似乎有一个grub错误:

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 

我试图重复安装时会持续存在。 幸运的是,尽管出现故障,系统始终处于可引导状态。

我是否必须采取一些特殊步骤来更新内核? 我是否有一个微妙的安装问题,我需要手动解决此问题?

至少有一个人在旧版本的操作系统上遇到了同样的问题 。 当我再次访问笔记本电脑时,我将提供mount的输出(如前一个问题中所要求的)。

编辑: 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) 

编辑#2:我已经确定pendrivelinux.com闪存驱动器实用程序可能正在发挥作用。 包含我的Ubuntu发行版的USB记忆棒被格式化为FAT32,并且根据boot_info_script脚本,正在安装的引导加载程序实际上不是GRUB而是SYSLINUX。

考虑到grub在引导过程中不涉及任何问题,grub-probe无法弄清楚该做什么是有意义的。

(这让我想知道为什么在尝试内核更新之前没有apt-get检查grub引导程序作为依赖项?)

我想下一步是尝试用GRUB覆盖SYSLINUX并尝试以这种方式启动Stick,然后查看更新是否有效。

我对此的第一次尝试导致了一个无法启动的系统 – grub正在加载,我可以加载内核,但无法找出以root身份挂载的内容。 我不得不擦拭并重新安装在闪存驱动器上再次开始。

我看到你修复了你的问题(使用Windows 7 ……不是真正的解决方案,但无论如何)。 我找到了解决方案。 我在这里发布,对于可能遇到问题的其他用户。

我找到了解决这个问题的方法。 打破安装的行是:

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

(内核版本可能与您的安装不同)

编辑有问题的文件以注释更新Grub的行。 这是一个非常小的文件,所以它并不太难。

注意 :如果你想首先备份文件(这通常是一个明智的想法),将它复制到另一个目录中( /root是一个好的, /tmp不是因为它不会在重新启动后存活)。 如果您在同一个文件夹( /etc/kernel/postinst.d/ )中进行备份,它也将被调用,并且它将失败。

编辑/etc/kernel/postinst.d/zz-update-grub以评论第15行。

之前:

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

后:

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

运行配置脚本:

 sudo dpkg --configure -a 

你应该看到很多调试,而不是最后的错误行。

确保重新运行配置。 它应该立即结束,没有任何日志:

 sudo dpkg --configure -a 

现在,您可以恢复zz-update-grub文件,以防您以后想要安装其他内核并且grub开始使用overlayfs

你有没有解决问题? 我在这里有同样的错误。 我真的不需要修复它,我可以轻松地在USB记忆棒上重新安装系统,但我喜欢挑战:)

解决这个问题的聪明方法是指示Grub如何理解overlayfs,但我不知道我必须为此安装的软件包(如果有的话)。 由于我的USB记忆棒仍然可以启动,我想强制apt-get忽略这个警告。 IE认为这个软件包已安装,即使它不完全正确。 嗯,从技术上讲,它已经正确安装,只有Grub无法更新MBR。 这不是什么大问题,因为它启动了最新版本的内核。

每次尝试都需要一段时间,因为它尝试配置包但Grub失败,而不是尝试回滚和Grub再次失败…

我尝试了以下但没有成功:

 (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 

… 还有很多…