Have you recently installed Linux alongside Windows 7 and now you can't find Windows 7 in the GRUB boot menu? Don't worry, you can easily fix this issue by reconstructing the EFI file. In this guide, we will walk you through the steps to make Windows 7 reappear on the GRUB boot menu.
Note: This guide assumes that you have already installed Linux (such as Ubuntu) alongside Windows 7 using the EFI boot method. If you have installed Linux using the legacy BIOS boot method, this guide may not be applicable.
Step 1: Boot into Linux
Start your computer and boot into your Linux distribution. Once you are logged in, open a terminal window. You can usually find the terminal application in the Applications or System Tools menu.
Step 2: Mount the EFI Partition
In the terminal, type the following command to identify the EFI partition:
sudo fdisk -l
Look for a partition labeled "EFI System." Note down the device name (e.g., /dev/sda1) of the EFI partition.
Next, create a mount point for the EFI partition by running the following command:
sudo mkdir /mnt/efi
Mount the EFI partition using the following command, replacing /dev/sda1 with the device name of your EFI partition:
sudo mount /dev/sda1 /mnt/efi
Step 3: Reconstruct the EFI File
Now that the EFI partition is mounted, navigate to the EFI directory by running the following command:
cd /mnt/efi/EFI
Inside the EFI directory, you should see a folder named after your Linux distribution (e.g., ubuntu). Change to that directory by running the following command, replacing ubuntu with the name of your Linux distribution:
cd ubuntu
Now, create a new directory called Microsoft by running the following command:
sudo mkdir Microsoft
Change to the newly created Microsoft directory by running the following command:
cd Microsoft
Finally, copy the EFI file from the Windows 7 partition to the current directory using the following command, replacing /dev/sda2 with the device name of your Windows 7 partition:
sudo cp /dev/sda2/EFI/Microsoft/Boot/bootmgfw.efi .
Step 4: Update GRUB
Now that the EFI file has been reconstructed, you need to update the GRUB boot menu to include Windows 7. In the terminal, run the following command:
sudo update-grub
This command will scan your system for installed operating systems and update the GRUB configuration accordingly.
Step 5: Reboot Your Computer
After updating GRUB, you can now reboot your computer. When the computer restarts, you should see Windows 7 listed in the GRUB boot menu alongside your Linux distribution. Select Windows 7 to boot into it.
Congratulations! You have successfully reconstructed the EFI file to make Windows 7 reappear on the GRUB boot menu.
References
| Source | Link |
|---|---|
| Ubuntu Documentation | https://help.ubuntu.com/community/UEFI |
| GRUB Documentation | https://www.gnu.org/software/grub/manual/grub/grub.html |