grub2:update-grub无法获得“无”的规范路径

$ sudo update-grub /usr/sbin/grub-probe: error: failed to get canonical path of `none'. 

这是我在从生动到狡猾的升级中断之后的情况

[编辑]

进一步深入研究grub源代码,第二个命令可能是失败的:

 $ grub-probe --target=device / /dev/md2 $ grub-probe --target=device /boot grub-probe: error: failed to get canonical path of `none'. 

以下还给出了错误:

 $ sudo grub-probe -t device /boot/grub grub-probe: error: failed to get canonical path of `none'. $ sudo grub-probe -t fs_uuid /boot/grub grub-probe: error: failed to get canonical path of `none'. 

[/编辑]

我没有/boot/grub/grub.cfg存在(或更老的/boot/grub/menu.lst)

在grub配置期间无法安装引导加载程序:

Can’t install grub

Grub无法安装在可用选项上( /dev/sda /dev/sdb/dev/md2

md1没有作为选项提供,即使它当前安装在/ boot:

 $ cat /etc/fstab proc /proc proc defaults 0 0 /dev/md/0 none swap sw 0 0 /dev/md/1 /boot ext3 defaults 0 0 /dev/md/2 / ext4 defaults 0 0 

无论如何我用/ dev / sda和/ dev / sdb进行raid设置:

 $ sudo fdisk -l Disk /dev/sda: 447.1 GiB, 480103981056 bytes, 937703088 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x00032e61 Device Boot Start End Sectors Size Id Type /dev/sda1 2048 8390656 8388609 4G fd Linux raid autodetect /dev/sda2 8392704 9441280 1048577 512M fd Linux raid autodetect /dev/sda3 9443328 937701040 928257713 442.6G fd Linux raid autodetect Disk /dev/sdb: 447.1 GiB, 480103981056 bytes, 937703088 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x00074c3d Device Boot Start End Sectors Size Id Type /dev/sdb1 2048 8390656 8388609 4G fd Linux raid autodetect /dev/sdb2 8392704 9441280 1048577 512M fd Linux raid autodetect /dev/sdb3 9443328 937701040 928257713 442.6G fd Linux raid autodetect Disk /dev/md2: 442.5 GiB, 475133575168 bytes, 927995264 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/md0: 4 GiB, 4292804608 bytes, 8384384 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/md1: 511.7 MiB, 536543232 bytes, 1047936 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes 

Grub似乎已安装(从serverfault的另一个答案中检测到):

 $ sudo dd bs=512 count=1 if=/dev/sda 2>/dev/null | strings ZRr= `|f \|f1 GRUB Geom Hard Disk Read Error 

当我运行grub-emu时,我得到一个空白提示:

在此处输入图像描述

 $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 15.10 Release: 15.10 Codename: wily 

这是在只有ssh访问权限的服务器上,所以如果grub失败,我就无法访问live CD!

[编辑] df -h输出:

 $ df -h Filesystem Size Used Avail Use% Mounted on udev 63G 0 63G 0% /dev tmpfs 13G 714M 12G 6% /run /dev/md2 436G 178G 236G 44% / tmpfs 63G 8.0K 63G 1% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 63G 0 63G 0% /sys/fs/cgroup none 436G 178G 236G 44% /boot tmpfs 13G 0 13G 0% /run/user/0 tmpfs 13G 0 13G 0% /run/user/1002 /dev/md2 436G 178G 236G 44% /var/cache/apt/archives none 436G 178G 236G 44% /bin none 436G 178G 236G 44% /etc none 436G 178G 236G 44% /initrd none 436G 178G 236G 44% /lib none 436G 178G 236G 44% /lib32 none 436G 178G 236G 44% /lib64 none 436G 178G 236G 44% /sbin none 436G 178G 236G 44% /usr none 436G 178G 236G 44% /var 

[进一步编辑]上面的命令似乎报告/ boot挂载为none 。 我想这可能是none grub-probe抱怨的。 这是mount -l的输出,它显示了两个独立的mount’条目’; 现在调查如何删除第二个。

 mount -l |grep boot /dev/md1 on /boot type ext3 (rw,relatime,data=ordered) none on /boot type aufs (rw,relatime,si=6ea5aad590be877d) 

好吧,我似乎已经得到了以下内容(回想起来一切都很简单):

 $ umount /boot 

我试过这个,因为我注意到/ boot有两个’坐骑’:

 $ mount -l |grep boot /dev/md1 on /boot type ext3 (rw,relatime,data=ordered) none on /boot type aufs (rw,relatime,si=6ea5aad590be877d) 

后者超越了前者:

 $ df -h |grep boot none 436G 178G 236G 44% /boot 

卸载后,相同的命令如下所示:

 $ mount -l |grep boot /dev/md1 on /boot type ext3 (rw,relatime,data=ordered) $ df -h |grep boot /dev/md1 488M 75M 388M 17% /boot 

(不知道第二次发生是怎么发生的)

然后我能够重新安装grub如下(我raid1这就是为什么sda和sdb有两个命令):

 $ grub-install /dev/sda Installing for i386-pc platform. Installation finished. No error reported. $ grub-install /dev/sdb Installing for i386-pc platform. Installation finished. No error reported. $ update-grub Generating grub configuration file ... Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported. Found linux image: /boot/vmlinuz-3.19.0-30-generic Found initrd image: /boot/initrd.img-3.19.0-30-generic Found linux image: /boot/vmlinuz-3.19.0-25-generic Found initrd image: /boot/initrd.img-3.19.0-25-generic done 

后记

重新启动后,服务器重新启动(可以ping通),但我发现我无法进入。这与/ dev / null(可能同时被破坏)有关。 我能够使用单独的救援系统并应用此修复程序: http : //thesystemadministrator.net/linux-administration/sshd-deamon-failing-to-start

你试过grub-install吗?

如果你不能使用它那么……

我看到你可以在系统中运行一个终端:

 apt-get -f install 

作为超级用户。

如果它没有要求安装任何东西,那么什么都没有打破。

考虑:

 apt-get upgrade //To finish upgrading 

持续

 apt-get install -y aptitude && aptitude reinstall grub 

现在再试一次grub-install

注意:

对于grub-install用法:

 man grub-install 

不要费心去修理它。 使用boot-repair连接到Internet,然后使用Ctrl + Alt + t打开终端,粘贴以下命令并按Enter键运行它们:

 sudo add-apt-repository -y ppa:yannubuntu/boot-repair; \ sudo apt-get update; \ sudo apt-get install -y boot-repair && boot-repair 

如果启动修复不起作用,你可以做的下一个(危险)事情是尝试重新安装,这是不会让你。 所以选择别的东西。 创建相同的一切,并使用相同的密码和用户名。 据说这可以作为修理工作。

如果引导修复不起作用,则更好的替代方法是备份数据和全新安装。 您可以使用实时磁盘进行备份。 我记得我在Lubuntu做过一些微不足道的事情,只是弄乱了一些设置。 有人建议备份和全新安装。 有人告诉我这需要一个小时的时间,而不是花费数小时试图解决这个问题。 在尝试了其他一些事情后,我最终得到了这个建议。 他是对的。

您也可以尝试使用此链接从现场usb https://community.linuxmint.com/tutorial/view/245修复grub。当内核升级失败时,我尝试了类似的东西(但不是相同的链接)。 我搜索了“如何在Linux升级失败后修复grub”并获得了各种各样的页面。 您可以尝试搜索“grub repair usb live”。 试试这个有终端和图形答案。 http://www.howtogeek.com/114884/how-to-repair-grub2-when-ubuntu-wont-boot/

在启用网络后,这对于恢复模式下的root就足够了:

sudo apt-get install –reinstall grub *

sudo grub-install / dev / partition

对于分区,您可以键入您非常安全的引导分区,例如/ dev / sda

然后执行以下操作:

有拼写检查错误但只是轻微的? 你可以试试这个:

sudo update-grub2

并不是

sudo update-grub