Sta*_*arx 2 grub2 boot-failure
我有一个专用的 grub 分区,在尝试诊断此问题时,我决定将默认分区更改为 ubuntu 系统。
但它不起作用,所以,我从 live cd 启动,格式化旧的启动分区并重新安装 grub,我确实复制了grub.cfg它足以启动系统。
可是我错了,现在我的GRUB菜单,即显示出来,但我不知道的是vmlinuz,并intrd.img还需要引导系统。
哪个地方没有?我怎样才能摆脱这个愚蠢的麻烦
很抱歉听到您必须重新安装...但对于这个问题的未来读者,这是我的答案。
在我的情况下的原因:
我弄乱了我的靴子......以为我支持它:
# cd /
# tar czf boot.tgz boot
Run Code Online (Sandbox Code Playgroud)
然后删除并重新格式化我的启动分区。然后我打算把文件放回去,但没有 boot.tgz :/
# file /initrd.img /vmlinuz
/initrd.img: broken symbolic link to `/boot/initrd.img-3.2.0-23-generic'
/vmlinuz: broken symbolic link to `boot/vmlinuz-3.2.0-23-generic
Run Code Online (Sandbox Code Playgroud)
所以我和你有同样的问题。
和解决方案:
重新安装 initramfs 的东西(它在 /boot 中生成 initramfs 文件;不确定其中哪一个是重要的,所以我做了所有,很快):
# aptitude reinstall grub2-common grub-pc-bin grub-gfxpayload-lists grub-common
Run Code Online (Sandbox Code Playgroud)
仅供参考以获取我上面命令的软件包列表,我这样做了:
# aptitude search grub | grep -E "^i"
Run Code Online (Sandbox Code Playgroud)
重新安装内核内容(将内核放在 /boot 中;这需要很长时间;首先使用搜索找到正确的包名):
# aptitude reinstall linux-image-3.2.0-23-generic
Run Code Online (Sandbox Code Playgroud)
链接不再中断。:)
# file /initrd.img /vmlinuz
/initrd.img: symbolic link to `/boot/initrd.img-3.2.0-23-generic'
/vmlinuz: symbolic link to `boot/vmlinuz-3.2.0-23-generic'
Run Code Online (Sandbox Code Playgroud)
为了避免在运行 update-grub 时出现错误“cat: /boot/grub/video.lst: No such file or directory”,我运行了 grub-install。(因为我使用了raid,所以我不得不在多个磁盘上运行):
grub-install /dev/sda
grub-install /dev/sdb
...
Run Code Online (Sandbox Code Playgroud)
然后只是为了确定......再次更新grub(重新安装grub也应该完成,但没有video.lst,并且可能还需要内核文件或其他文件):
# update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-23-generic
Found initrd image: /boot/initrd.img-3.2.0-23-generic
done
Run Code Online (Sandbox Code Playgroud)
然后最后,我确保我的引导和 fstab 是正确的:
# umount /boot
# mount -a
# ls /boot
abi-3.2.0-23-generic config-3.2.0-23-generic grub initrd.img-3.2.0-23-generic lost+found System.map-3.2.0-23-generic vmlinuz-3.2.0-23-generic
Run Code Online (Sandbox Code Playgroud)
(不知道 abi-3.2.0-23-generic 是什么。我以前没有那个文件)
并再次生成 initramfs,以防它生成一些相关的错误消息(用系统上的正确文件名替换文件名)。
# mkinitramfs -o /boot/initrd.img-3.2.0-23-generic
(no output if it works)
Run Code Online (Sandbox Code Playgroud)
例如,在修复我的启动和设置我的 mdadm.conf 文件之前,我会收到以下消息:
grep: /boot/config-3.2.0-23-generic: No such file or directory
W: mdadm: the array /dev/md0 with UUID 656eb2a6:21526b55:a6f1834a:d3cc95e4
W: mdadm: is currently active, but it is not listed in mdadm.conf. if
W: mdadm: it is needed for boot, then YOUR SYSTEM IS NOW UNBOOTABLE!
W: mdadm: please inspect the output of /usr/share/mdadm/mkconf, compare
W: mdadm: it to /etc/mdadm/mdadm.conf, and make the necessary changes.
Run Code Online (Sandbox Code Playgroud)
在此之后,我测试了启动,并且成功了。:)
还有一些基本的背景信息......这是将上述解决方案放在一起所必需的:
所以这就是你需要所有这些文件的原因。
| 归档时间: |
|
| 查看次数: |
11722 次 |
| 最近记录: |