You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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.

1. First: Confirm UEFI Mode & EFI Partition Mount Status

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:
    1. Run sudo fdisk -l to list all partitions. Look for one labeled EFI System (typically /dev/sda1 or similar, depending on your drive).
    2. Check if it’s mounted to /boot/efi with mount | 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)
      
2. Re-Generate UEFI-Compatible GRUB Configuration

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:
    sudo update-grub
    
    This command will auto-detect your Linux kernels and any UEFI-based Windows boot loaders, creating a menu that actually works with UEFI.
3. Manually Add Windows Entries (If Auto-Detect Fails)

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.cfg directly—it gets overwritten):
    sudo nano /etc/grub.d/40_custom
    
  • Paste the following entries (adjust hd0,gpt1 to match your EFI partition—hd0 is your first drive, gpt1 is 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, then Ctrl+X), then re-run sudo update-grub to apply the changes.
4. Fix UEFI Boot Order in BIOS

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 ubuntu entry (or the entry labeled with GRUB’s bootloader ID) to the top of the list, so it loads first.
  • Also verify that Windows Boot Manager entries exist in the UEFI boot list—if they’re missing, you might need to repair Windows’ UEFI boot loader first.
5. Last Resort: Reinstall GRUB to the EFI Partition

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 .efi files 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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 07:54:18