开机进入GRUB不要慌,命令行也可启动Linux

 

1. 首先利用ls命令,找到Ubuntu安装在哪个磁盘分区;

 

  • 比如输入ls后我的机器列出的磁盘分区信息如下:

(hd0),(hd1),(hd1,gpt3),(hd1,gpt2),(hd1,gpt1)

  • 查找包含grub.cfg文件的分区
假定通过 ls (hd1,gpt2)/boot/grub 发现了grub.cfg文件,则表明Linux安装在这个分区

 

2.  找到Linux的/boot分区,以及/根分区所在的磁盘位置

输入 cat (hd0,gpt2)/etc/fstab
会输出类似下面的信息
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda2 during installation
UUID=dd6e0539-1369-4938-8af5-378f02cf05cf / ext4 errors=remount-ro 0 1

3. 指定Linux内核,及/所在分区

grub> linux /boot/vmlinuz-4.8.0-36-generic ro text root=/dev/sda2

4. initrd命令指定initrd文件

grub> initrd /boot/initrd.img-4.8.0-36-generic

5. boot引导系统,结束

grub> boot

 

转载于:https://www.cnblogs.com/zztian/p/10289083.html

THE END
< <上一篇
下一篇>>