如果我运行 update-grub,它会看到我机器上的所有操作系统(Mint、Windows(工作)、Windows(游戏)和 NixOs):
➜ ~ sudo update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/50_linuxmint.cfg'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found theme: /usr/share/grub/themes/Stylish/theme.txt
Found linux image: /boot/vmlinuz-5.15.0-97-generic
Found initrd image: /boot/initrd.img-5.15.0-97-generic
Found linux image: /boot/vmlinuz-5.15.0-94-generic
Found initrd image: /boot/initrd.img-5.15.0-94-generic
Found linux image: /boot/vmlinuz-5.15.0-91-generic
Found initrd image: /boot/initrd.img-5.15.0-91-generic
Memtest86+ needs a 16-bit boot, that is not available on EFI, exiting
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows Boot Manager on /dev/sda1@/EFI/Microsoft/Boot/bootmgfw.efi
Found Windows Boot Manager on /dev/sdd1@/efi/Microsoft/Boot/bootmgfw.efi
Found NixOS 23.11 (Tapir) (23.11) on /dev/sdd5
Adding boot menu entry for UEFI Firmware Settings ...
done
但是当我重新启动时,NixOs 不会出现在菜单中,如果我查看 grub.cfg,它里面只有 mint 和 Windows。
…
export linux_gfx_mode
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-f9edbfda-0552-4a82-a93c-60525d334646' {
…
}
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-f9edbfda-0552-4a82-a93c-60525d334646' {
…
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/10_linux_zfs ###
### END /etc/grub.d/10_linux_zfs ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-efi-C745-9EFB' {
…
}
menuentry 'Windows Boot Manager (on /dev/sdd1)' --class windows --class os $menuentry_id_option 'osprober-efi-22F0-7DFB' {
…
}