Doc*_*ger 29 ubuntu boot-loader grub2 busybox
最初发布到 AskUbuntu.com ...
AskUbuntu 采用了关闭有关 EOL(生命周期结束)版本问题的策略。还有一个声音队伍来删除它们。为了防止可能丢失这个热门问题(迄今为止有 342335 次浏览),我在此处放置了一个修订版。--- 文档打捞者
“经典”系统...
GRUB 2将许多*.mod文件(内核模块)放在/boot/grub. 删除这些文件(认为它们是放错位置的声音文件)导致重新启动失败并提示grub rescue>.
在这种情况下如何恢复?
小智 48
这个答案适用于 DocSalvager 的答案不适用的其他人。
ls来找到正确的硬盘分区。就我而言,它是(hd0,msdos5).然后我执行了以下命令以返回正常的 grub 引导加载程序屏幕。
grub rescue> set boot=(hd0,msdos5)
grub rescue> set prefix=(hd0,msdos5)/boot/grub
grub rescue> insmod normal
grub rescue> normal
Run Code Online (Sandbox Code Playgroud)启动到 Ubuntu 后,我使用终端中的以下命令修复了 grub 启动加载程序。
sudo grub-install /dev/sda
Run Code Online (Sandbox Code Playgroud)请参考此来源以直观地了解此过程。
Doc*_*ger 34
从grub救援崩溃中恢复......
grub rescue>不支持cd,cp或任何其他文件系统命令,除了它自己的变体ls实际上是一种find命令。所以首先,必须找到/boot包含vmlinuz和其他启动映像文件的目录的分区......
grub rescue> ls
(hd0,4) (hd0,3) (hd0,2) (hd0,1)
grub rescue> ls (hd0,4)/boot
... some kind of 'not found' message
grub rescue> ls (hd0,3)/boot
... some kind of 'not found' message
grub rescue> ls (hd0,2)/boot
... grub ... initrd.img-2.6.32-33-generic ... vmlinuz-2.6.32-33-generic
Run Code Online (Sandbox Code Playgroud)
ls 不带参数返回此系统上的四个分区。ls (hd0,4)/boot/boot在分区上找不到目录(hd0,4)。ls (hd0,3)/boot/boot在分区上找不到目录(hd0,3)。ls (hd0,2)/boot/boot在分区上找到一个目录(hd0,2),它包含vmlinuz我们想要的一个和其他启动映像文件。要从grub rescue>提示符手动引导...
grub rescue> set root=(hd0,2)/boot
grub rescue> insmod linux
grub rescue> linux (hd0,2)/boot/vmlinuz-2.6.32-33-generic
grub rescue> initrd (hd0,2)/boot/initrd.img-2.6.32-33-generic
grub rescue> boot
Run Code Online (Sandbox Code Playgroud)
root为使用/boot分区上的目录(hd0,2)。linux。vmlinuz-2.6.32-33-generic。initrd.img-2.6.32-33-generic。这将引导至BusyBox命令行提示符,其中包含所有基本文件系统命令(还有一些!)。
然后可以将*.mod文件移回/boot/grub目录...
busybox> cd /boot
busybox> mv mod/* grub
busybox> reboot
Run Code Online (Sandbox Code Playgroud)重启成功!
也可以看看 ...
| 归档时间: |
|
| 查看次数: |
349685 次 |
| 最近记录: |