
我有 2 個 ESP,這可能是問題所在,但我認為可以修復,因為我可以使用 GRUB SET 手動啟動。無論如何,這是我的設定。當我在其他機器上重新輸入時,請忽略某些可能的拼字錯誤:
fdisk -l
/dev/sda1 Windows recovery
/dev/sda2 EFI system
/dev/sda3 Microsoft reserved
/dev/sda4 Microsoft basic data
/dev/sda5 Windows recovery
/dev/sda6 EFI System (linux)
/dev/sda7 Linux fs
Linux 內部:
# grub-probe --target=fs_uuid /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
4C77-A2D0
# grub-probe --target=hints_string /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
--hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2
所以在 GRUB 條目中我使用:
insmod part-gpt
insmod fat
insmod search_fs_uuid
insmod chain
search --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 4C77-A2D0
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
當嘗試啟動進入 Windows 時,這會導致以下錯誤:
error: unspecified search type
error: file '/EFI/Microsoft/Boot/bootmgfw.efi' not found.
所以我進入 GRUB 命令列:
grub> set
...
cmdpath=(hd1,gpt6)/EFI/grub
...
grub> search.fs_uuid 4C77-A2D0
hd1,gpt2
我在 hd1 而不是 hd0,grub 可以透過 UUID 找到。我嘗試修改我的選單項目提示字串來進行搜索hd1,gpt2
,但仍然出現相同的錯誤。我也嘗試過drivemap -s hd1
。仍然找不到分區。
我的問題是為什麼 GRUB 顯示不同的 hd#。我該如何讓它找到分區?
答案1
# grub-mkconfig -o /boot/grub/grub.cfg
編輯完後忘了/etc/grub.d/40_custom
.....