ubuntu16.04LTS grub rescue模式

- 使用ls 命令查看

ls 命令查看系统安装在哪个分区

我的出现的是 (hd0) (hd0,gpt1) (hd0,gpt2) (hd0,gpt3)

结果发现安装在 (hd0,gpt2)

 grub rescue> ls (hd0,gpt2)/

其中 /boot目录下有两个文件,vmlinuz 和initrd

**- **
grub rescue> set root=(hd0,gpt2)
grub rescue> set prefix=(hd0,gpt2)/boot/grub
grub rescue> set #查看我们现在设置的变量

grub rescue> insmod normal
grub rescue> normal
grub rescue> boot

或者

 grub> linux /boot/vmlinuz-4.15.0-20-generic root=/dev/sda2
    grub> initrd /boot/initrd.img-4.15.0-20-generic

自己电脑报错
error: attempt to read or write outside of disk “hd0”

To check the file system on your Ubuntu partition...

boot to the GRUB menu
choose Advanced Options
choose Recovery mode
choose Root access
at the # prompt, type sudo fsck -f /
repeat the fsck command if there were errors
type reboot
If for some reason you can't do the above...

boot to a Ubuntu Live DVD/USB
start gparted and determine which /dev/sdaX is your Ubuntu EXT4 partition
quit gparted
open a terminal window
type sudo fsck -f /dev/sdaX # replacing X with the number you found earlier
repeat the fsck command if there were errors
type reboot

boot后可以顺利进入系统,进行Grub 修复,否则下次依然是grub rescue 模式

sudo update-grub
sudo grub-install /dev/sda

insmod —load grub module

参考:
https://linuxhint.com/grub_rescue_ubuntu_1804/

https://askubuntu.com/questions/951844/insmod-normal-command-returns-attempt-to-read-or-write-outside-of-disk-hd0

或者最后的方法-----重装

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值