問題:啟動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