banner
三文字

方寸之间

居善地,心善渊,与善仁,言善信,正善治,事善能,动善时。
github
email
misskey

How to fix Windows EFI partition

Recently, I installed the latest Arch Linux on my computer. This time, I used the Gnome desktop environment, which works pretty well. So I quickly configured my computer based on my previous configuration files. However, when I tried to set up dual boot with Windows, I couldn't find the Windows EFI partition. It's strange because I have two systems installed on two different hard drives, so I didn't accidentally delete the EFI partition. Moreover, I can still mount Windows data in the Linux system, and the data is not lost.

Then I tried to search for the cause of the problem, but couldn't find it. However, I found a solution, and the method is not particularly difficult. It involves using a Windows command called bcdboot. Here's how to do it:

Step 1: Prepare a Windows installation media.

Step 2: Boot into the live system and click on Repair Computer > Troubleshoot > Advanced > Command Prompt in order.

Step 3: After entering the command prompt, use the following commands to display the partitions:

$ diskpart // Run diskpart
diskpart> list disk  // List all disks, each disk has an ID (e.g. 0/1/2)
diskpart> sel disk <disk_id> // Select the disk where the Windows EFI partition is located
diskpart> list vol // List all volumes
diskpart> sel vol <volume_id> // Select the EFI partition
diskpart> assign letter=F // Assign a new drive letter to the EFI partition
diskpart> exit // Exit
$ bcdboot C:\Windows /s F: /f ALL // Create all Windows boot files on drive F
$ reboot // Restart and you can enter Windows normally

Originally published on my personal blog: Between the Lines

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.