问题:启动ubuntu就直接进入GRUB2.02的命令行界面
原因:grub2引导出现问题。
解决方法:图形方法,引导修复
(1)电脑上插入Ubuntu系统启动引导U盘(如果没有引导U盘,就到官网下载一个iso镜像,制作一个),开机,按ESC键(我的是按ESC键,不同的电脑按键可能不同),选择从U盘启动,然后选择“try ubuntu”,
(2)确保连上因特网,以便下载修复工具,可以插上网线,或连接wifi,
(3)执行如下3条命令,安装boot-repair修复工具:
ubuntu@ubuntu:~$ sudo apt-add-repository ppa:yannubuntu/boot-repair
ubuntu@ubuntu:~$ sudo apt-get update
ubuntu@ubuntu:~$ sudo apt-get install -y boot-repair
(4)输入命令: boot-repair,
打开 "boot repair" 软件,点击"Recommended repair"按钮:
但是有报错: GPT detected. Please create a BIOS-Boot partition (>1MB, unformatted filesystem, bios_grub flag). This can be performed via tools such as Gparted. Then try again. Alternatively, you can retry after activating the [Separate /boot/efi partition:] option.
(5)然后,我选择 advanced options -- GRUB location, 勾选 【Separate /boot/efi partition:】的选项 (我的efi系统,是一个单独的分区/dev/sdb1,挂载在/boot/efi/目录上 ,所以我觉得可能要勾选那个选项 )
(6)重新进行第(4)步,成功了。以下是修复成功的提示:
Boot successfully repaired.
Please write on a paper the following URL:
http://paste.ubuntu.com/p/Hz8R3SZKr8/
In case you still experience boot problem, indicate this URL to:
boot.repair@gmail.com or to your favorite support forum.
You can now reboot your computer.
Please do not forget to make your BIOS boot on sdb1/EFI/ubuntu/shimx64.efi file!
(7)重新启动计算机,Ubuntu能正常启动。
参考文章: https://jingyan.baidu.com/article/4ae03de3dbdac83eff9e6be0.html