修復
在liveCD下先掛載相應分區,然后使用grub-install
進行修復。
注意:如果系統是使用systemd的,修復環境也要是基於systemd的(直接搞個ubuntu的livecd好了),否則grub-install
可能會失敗(提示 cannot read 'boot/efi': Is a folder)
mount /dev/sda2 /mnt
mount /dev/sda1 /mnt/boot/efi
mount -B /sys /mnt/sys
mount -B /dev /mnt/dev
mount -t proc /proc /mnt/proc
chroot /mnt
grub-mkconfig -o /boot/grub/grub.cfg # 雙系統注意觀察grub-probe輸出是否有windows字樣
grub-install /boot/efi (這是efi的,如果是mbr則是 grub-install /dev/sda1)
修改默認啟動項
默認的GRUB_DEFAULT
為0,改為需要的即可,然后執行 grub-update
更新grub.cfg文件。(或grub-mkconfig -o /boot/grub/grub.cfg
)