And*_*rej 5 linux boot debian grub kernel
我正在运行 Debian Wheezy。更新管理器建议安装内核更新。更新后,我重新启动系统,但没有列出所有内核(引导加载程序),而是给了我一个 GRUB 命令提示符:
grub>
Run Code Online (Sandbox Code Playgroud)
我该怎么办?在此先感谢您的指点。
PS也许它会很有用:
grub> ls
(hd0) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1) (hd1)
Run Code Online (Sandbox Code Playgroud)
我的解决方案
使用 Live CD 启动。打开终端并挂载根分区(仔细检查您是否挂载了正确的分区):
mount /dev/sda1 /mnt
Run Code Online (Sandbox Code Playgroud)
还挂载:
mount -o bind /dev /mnt/dev
mount -o bind /sys /mnt/sys
mount -t proc /proc /mnt/proc
Run Code Online (Sandbox Code Playgroud)
(检查您是否挂载了正确的分区:打开 nautilus 并导航到/mnt
)。
执行:
chroot /mnt
Run Code Online (Sandbox Code Playgroud)
最后运行:
update-grub
Run Code Online (Sandbox Code Playgroud)
exit
从终端退出 ( ) 并重新启动。
您不需要 Live CD 来解决这个问题。
类型:
grub> ls
Run Code Online (Sandbox Code Playgroud)
在这里您应该看到设备/分区的列表。现在我们必须找到包含“/boot”的分区
grub> ls (hd0,gpt1)/
Run Code Online (Sandbox Code Playgroud)
末尾的斜杠是必要的。您可能会看到“msdos”而不是“gpt”。如果这是正确的分区,我们应该看到:
启动等root bin ...
类型:
grub> set root=(hd0,gpt1)
grub> linux /boot/vmlinuz...(Press tab and choose the last working version) root=/dev/sda1
grub> initrd /boot/init...(press tab and select the same version as above)
grub> boot
Run Code Online (Sandbox Code Playgroud)
这只是一个示例,您应该进行相应修改。