Accidentally deleting EFI partitions can cause issues with your dualboot setup of Windows 7 and Linux. But don't worry, there are steps you can take to fix this problem and get your system back up and running smoothly. In this article, we will guide you through the process of recovering your EFI partitions and restoring your dualboot configuration.
What is an EFI Partition?
EFI stands for Extensible Firmware Interface, and the EFI partition is a small partition on your hard drive that contains important boot files. It is necessary for the proper functioning of your operating systems, including Windows 7 and Linux. Accidentally deleting this partition can lead to booting issues and make your system unbootable.
Step 1: Boot from a Windows 7 Installation Disc
To begin the recovery process, you will need a Windows 7 installation disc. Insert the disc into your computer and restart it. Make sure your computer is set to boot from the disc by accessing the BIOS settings. Once the disc is booted, select your language preferences and click "Next". Then, click on "Repair your computer" at the bottom left corner of the window.
Step 2: Access Command Prompt
In the System Recovery Options window, select the operating system you want to repair and click "Next". On the next screen, click on "Command Prompt" to open the command prompt window.
Step 3: Use Diskpart to List Disks
In the command prompt window, type diskpart and press Enter. This will open the Diskpart utility. Next, type list disk and press Enter. This will display a list of disks on your computer.
Step 4: Select the Disk and EFI Partition
Identify the disk that contains the deleted EFI partition based on its size. Type select disk X (replace X with the disk number) and press Enter. Then, type list partition and press Enter to display a list of partitions on the selected disk. Look for the EFI partition and note its number.
Step 5: Create a New EFI Partition
Type select partition X (replace X with the EFI partition number) and press Enter. Then, type delete partition override and press Enter to delete the selected partition. After that, type convert gpt and press Enter to convert the disk to the GPT partition style. Finally, type create partition efi size=200 and press Enter to create a new EFI partition.
Step 6: Format the EFI Partition
Type format quick fs=fat32 and press Enter to format the newly created EFI partition. Once the formatting is complete, type assign letter=S and press Enter to assign a drive letter to the EFI partition.
Step 7: Rebuild the Boot Configuration Data
Type bcdboot C:\Windows /s S: and press Enter to rebuild the Boot Configuration Data (BCD) on the EFI partition. This will ensure that your Windows 7 installation is properly configured for booting.
Step 8: Reinstall GRUB for Linux
If you also have Linux installed, you will need to reinstall GRUB to ensure that it can boot properly. To do this, boot into your Linux installation media and open a terminal. Then, run the following command: sudo grub-install /dev/sdX (replace X with the appropriate drive identifier, such as a or b). This will reinstall GRUB and update the boot configuration for Linux.
Once you have completed these steps, restart your computer and you should now be able to boot into both Windows 7 and Linux without any issues. Remember to always be cautious when modifying partitions to avoid accidental deletions in the future.
| Reference | Link |
|---|---|
| Windows 7 Installation Disc | https://www.microsoft.com/en-us/software-download/windows7 |
| GRUB | https://www.gnu.org/software/grub/ |