主要是Windows安裝再固態硬盤,Ubuntu(deepin)安裝再機械硬盤,在安裝deepin的時都是默認走,導致Ubuntu Grub建立引導時找不到在固態硬盤中的Windows引導。
一、找到啟動分區所在的硬盤編號(笨辦法)
既然找不到Windows的分區引導,這里再deepin啟動界面直接按“C”或者“Ctrl + C”進度grub命令行。(可以參考:
https://www.cnblogs.com/peach-blossoms/p/15228957.html)
輸入ls命令,就會出現
grub> ls
(hd0),(hd0,gpt3),(hd0,gpt2),(hd0,gpt1),(hd1),(hd1,gpt3),(hd1,gpt2),(hd1,gpt1)等一系列分區。
再輸入命令:
grub> insmod ntfs
grub> set root=(hd1, gpt1)
grub> chainloader /EFI/Microsoft/Boot/bootmgfw.efi
grub> boot
通過設置 root = (hd0, gpt1)找到Windows系統所在分區(我這是本辦法,有好的方式的請留言,如果不是,則無法啟動系統)。
記下 set root=(hd1, gpt1)。
二、修改grub配置文件
網上很多都不建議去改/boot/grub/grub.cfg文件,因為它是通過命令:sudo grub-mkconfig -o /boot/grub/grub.cfg 生成的文件。
建議直接去修改生成模板 /etc/grub.d/40_custom
sudo vim /etc/grub.d/40_custom
再文末加上:
menuentry 'Windows Boot Manager' {
**set root='hd1,gpt1'** ## 前面記下的啟動分區編號
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
boot
}
然后重新生成gurb.cfg文件
sudo grub-mkconfig -o /boot/grub/grub.cfg
sudo update-grub
我的通過update-grub之后,同樣不顯示找到'Windows Boot Manager'。
但是,啟動的時候,啟動界面已經可以啟動Windows了。
至於要設置windows優先啟動的話,參考以下兩篇文章:
https://www.cnblogs.com/finalstar/p/5683235.html
https://www.cnblogs.com/clintqi/p/7190625.html