UEFI模式下Windows与Linux三系统启动GRUB菜单异常问题求助
Hey there, I’ve dealt with this exact UEFI GRUB quirk when migrating a multi-boot setup from Legacy BIOS, so let’s walk through fixing it step by step. The core issue here is that UEFI mode uses a completely different boot logic than Legacy—GRUB can’t just reuse the old Legacy configuration, even if the menu looks the same.
Before diving into fixes, let’s make sure your system is actually running in UEFI mode and the EFI partition is accessible:
- Reboot into your BIOS/UEFI settings (usually by pressing F2, Del, or F12 on startup) and double-check that Boot Mode is set to UEFI (not Legacy/CSM).
- Log into Ubuntu, then open a terminal to verify the EFI partition:
- Run
sudo fdisk -lto list all partitions. Look for one labeledEFI System(typically/dev/sda1or similar, depending on your drive). - Check if it’s mounted to
/boot/efiwithmount | grep /boot/efi. If you get no output, mount it manually:sudo mount /dev/sdX1 /boot/efi # Replace sdX1 with your actual EFI partition (e.g., /dev/sda1)
- Run
Legacy GRUB configs don’t work with UEFI, so we need to rebuild the config from scratch:
- First, ensure you have the UEFI version of GRUB installed:
sudo apt install grub-efi-amd64 # Use grub-efi-ia32 if you're on a 32-bit system - Then regenerate the GRUB menu to scan for all UEFI-compatible boot entries:
This command will auto-detect your Linux kernels and any UEFI-based Windows boot loaders, creating a menu that actually works with UEFI.sudo update-grub
Sometimes GRUB misses Windows UEFI entries. If the auto-generated menu still doesn’t let you boot Windows, add them manually:
- Edit the custom GRUB entries file (never edit
/boot/grub/grub.cfgdirectly—it gets overwritten):sudo nano /etc/grub.d/40_custom - Paste the following entries (adjust
hd0,gpt1to match your EFI partition—hd0is your first drive,gpt1is the first GPT partition; if your EFI is on a different drive/partition, tweak accordingly):menuentry "Windows 7" { insmod part_gpt insmod fat set root='hd0,gpt1' chainloader /EFI/Microsoft/Boot/bootmgfw.efi } menuentry "Windows 10" { insmod part_gpt insmod fat set root='hd0,gpt1' chainloader /EFI/Microsoft/Boot/bootmgfw.efi } - Save and exit nano (press
Ctrl+O, hit Enter, thenCtrl+X), then re-runsudo update-grubto apply the changes.
Another common issue: GRUB isn’t set as the default UEFI boot loader, so the menu behaves unpredictably:
- Reboot into BIOS/UEFI settings, find the Boot Order menu.
- Move the
ubuntuentry (or the entry labeled with GRUB’s bootloader ID) to the top of the list, so it loads first. - Also verify that
Windows Boot Managerentries exist in the UEFI boot list—if they’re missing, you might need to repair Windows’ UEFI boot loader first.
If nothing else works, a fresh GRUB install to the EFI partition often fixes corrupted boot data:
sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ubuntu --recheck sudo update-grub
This command forces the UEFI version of GRUB to be written directly to your EFI partition, ensuring it’s properly registered with the UEFI firmware.
Quick note: UEFI boot relies on
.efifiles stored in the EFI partition, whereas Legacy BIOS uses MBR boot code. That’s why the old Legacy GRUB menu looks the same but doesn’t work—under the hood, it’s trying to use Legacy boot logic in a UEFI environment.
内容的提问来源于stack exchange,提问作者Rhaes

