Understanding Why Windows 11 Disappears
When you install Windows after Linux, or when disk partitions are reorganized, GRUB may lose track of the Windows Boot Manager. The grub-mkconfig command scans for operating systems but relies on specific signatures to identify them. If the EFI System Partition (ESP) is not mounted correctly during the update process, or if the Windows partition has been formatted with an incompatible file system type, GRUB will skip it entirely.
Another common cause is that the Windows Boot Manager was installed on a different disk than where Linux resides. In such cases, the BIOS/UEFI firmware might point to the wrong drive, leaving GRUB unaware of the other operating system. Checking your UEFI settings to ensure the correct boot priority is set is a crucial first step before diving into configuration files.
Verifying Partition Types and UUIDs
Before editing any configuration files, you must confirm that GRUB can see the Windows partition. Open a terminal in your Linux environment and run the following command to list all block devices:
lsblk -o NAME,FSTYPE,MOUNTPOINT,LABEL,SIZE
Look for a partition labeled FAT32 or ntfs. The FAT32 partition is typically the EFI System Partition, while the NTFS partition contains the Windows OS itself. Note down the device name (e.g., sda2) and the UUID of the NTFS partition. You can get the UUID using:
sudo blkid | grep ntfs
If you do not see an NTFS partition, Windows might not be installed correctly, or the disk might be encrypted. Ensure that Secure Boot is disabled in your UEFI settings, as some older versions of GRUB struggle with signed Windows bootloaders when Secure Boot is active.
Manually Adding an Entry to GRUB
If automatic detection fails, you can force GRUB to recognize Windows 11 by creating a custom script. Create a new file in the /etc/grub.d/ directory. A common practice is to use a file named 40_custom_windows to keep it separate from the default configurations.
sudo nano /etc/grub.d/40_custom_windows
Add the following content to the file, replacing the placeholders with your actual values:
menuentry "Windows 11" {
insmod part_gpt
insmod fat
search --no-floppy --fs-uuid --set=root YOUR_EFI_UUID
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
Replace YOUR_EFI_UUID with the UUID of your EFI System Partition obtained earlier. Also, ensure the path /EFI/Microsoft/Boot/bootmgfw.efi matches the location of your Windows bootloader. Some installations might place it in /EFI/Microsoft/Boot/bootx64.efi, so verify the exact path if the above does not work.
After saving the file, make it executable:
sudo chmod +x /etc/grub.d/40_custom_windows
Updating GRUB Configuration
Once the custom entry is added, you need to regenerate the main GRUB configuration file. The command varies slightly depending on your distribution, but the general principle remains the same. For most Debian-based distributions like Ubuntu or Linux Mint, use:
sudo update-grub
For Arch Linux or Manjaro, the command is:
sudo grub-mkconfig -o /boot/grub/grub.cfg
After running the command, check the output for any errors. If successful, reboot your system. You should now see Windows 11 listed in the GRUB menu alongside your Linux distribution.
If you still face issues, consider checking the integrity of the EFI partition. Sometimes, the Windows bootloader gets corrupted or moved. In such cases, you may need to repair the Windows bootloader using a Windows installation USB or a tool like boot-repair in Linux. For more complex dual-boot scenarios involving multiple disks, refer to our guide on Windows 11 Disk Only Boots with Windows 10 Disk Present which addresses similar multi-drive detection failures.
Preventing Future Detection Issues
To avoid this problem recurring, always install Windows before Linux if possible. If you must install Windows later, ensure that the Linux bootloader is updated immediately after the Windows installation. Additionally, regularly updating your GRUB package via your package manager ensures compatibility with newer Windows versions.
It is also advisable to disable fast startup in Windows 11. Fast startup hibernates the kernel, which can lock the NTFS partition and prevent Linux from accessing it properly, leading to GRUB detection errors or read-only mounts. You can disable this feature by going to Control Panel > Power Options > Choose what the power buttons do and unchecking Turn on fast startup.
Frequently Asked Questions
Why does GRUB only show Linux and not Windows?
This usually occurs because GRUB cannot find a valid EFI signature or the Windows partition is not mounted during the config generation. Verify that the EFI partition is correctly identified and that the os-prober module is enabled in your GRUB settings.
Can I fix this without editing config files?
Yes, installing the os-prober package often helps GRUB detect other operating systems automatically. On Debian-based systems, install it using sudo apt install os-prober and then run sudo update-grub again.
What if my Windows bootloader is on a different disk?
If Windows is on a separate physical drive, GRUB might not see it unless that drive is connected and detected at boot time. Ensure both drives are connected and that the UEFI boot order prioritizes the drive containing the ESP used by GRUB.
Is it safe to edit files in /etc/grub.d/?
Yes, it is safe as long as you follow the naming conventions and syntax. Files in this directory are executed in numerical order to build the final menu. Always backup your original grub.cfg before making changes.
How do I know if my Windows partition is NTFS?
You can check the file system type by running lsblk -f or sudo fdisk -l. Look for the FSTYPE column; if it says ntfs, the partition is compatible with standard Windows boot detection methods.