Skip to content

Instantly share code, notes, and snippets.

@csivanich
Last active September 27, 2025 10:58
Show Gist options
  • Save csivanich/5d836e93233fd2890c051f967e075a1c to your computer and use it in GitHub Desktop.
Save csivanich/5d836e93233fd2890c051f967e075a1c to your computer and use it in GitHub Desktop.

Revisions

  1. csivanich revised this gist Mar 10, 2020. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions windows_efi.md
    Original file line number Diff line number Diff line change
    @@ -12,6 +12,7 @@ Give `boot/efi` flags

    # Create new EFI partition with diskpart
    ![Creating EFI Partition](https://www.diskpart.com/windows-10/images/accidentally-deleted-boot-partition-windows-10/create-efi-boot-partition-1.jpg "Creating EFI Boot Partition")

    _Protip: physically disconnect all other disks during these steps to minimize the chance of mis-locating or breaking things_

    On a Windows install/recovery disk
    @@ -27,6 +28,8 @@ exit
    ```

    # Copy EFI data to partition
    ![Installing EFI Data](https://www.diskpart.com/windows-10/images/accidentally-deleted-boot-partition-windows-10/create-efi-boot-partition-2.jpg "Installing EFI Files")

    ```
    diskpart
    list volume # find the volume letter which belongs to the installed Windows OS
  2. csivanich revised this gist Mar 10, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions windows_efi.md
    Original file line number Diff line number Diff line change
    @@ -11,6 +11,7 @@ Give `boot/efi` flags
    ```

    # Create new EFI partition with diskpart
    ![Creating EFI Partition](https://www.diskpart.com/windows-10/images/accidentally-deleted-boot-partition-windows-10/create-efi-boot-partition-1.jpg "Creating EFI Boot Partition")
    _Protip: physically disconnect all other disks during these steps to minimize the chance of mis-locating or breaking things_

    On a Windows install/recovery disk
  3. csivanich created this gist Mar 10, 2020.
    55 changes: 55 additions & 0 deletions windows_efi.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,55 @@
    # Windows 10 EFI Partition Fix/Move Steps

    Based on https://www.diskpart.com/windows-10/accidentally-deleted-boot-partition-windows-10.html
    -------

    # Create new EFI partition with parted
    _I did this with GParted, so it's psudocode_
    ```
    Create vfat32 partition
    Give `boot/efi` flags
    ```

    # Create new EFI partition with diskpart
    _Protip: physically disconnect all other disks during these steps to minimize the chance of mis-locating or breaking things_

    On a Windows install/recovery disk
    ```
    diskpart
    list disk
    select disk n # n refers to the disk to contain the EFI System partition
    list partition
    create partition efi
    format quick fs=fat32
    list partition
    exit
    ```

    # Copy EFI data to partition
    ```
    diskpart
    list volume # find the volume letter which belongs to the installed Windows OS
    exit
    bcdboot c:\windows \v \f UEFI # c refers to the volume letter of installed Windows OS
    ```
    If that fails being unable to find the system partition, you need to temporarily assign a drive letter to the EFI partition:
    ```
    diskpart
    select vol n # n being the EFI partition
    assign e # assigning e:\ - you may omit or use something else
    exit
    ```
    Now run `bcdboot` with specifying the system partition:
    ```
    bcdboot c:\windows \v \f UEFI \s E:
    ```
    You should see lots of text scroll, including some missing files (it's OK). The last line should mark it successful.
    Now remove the letter assigned to EFI partition, since it's not needed:
    ```
    diskpart
    select vol n # n being the EFI partition
    remove e
    exit
    ```

    From here, you should have a new EFI partition rebuilt for the disk layout specified. Give it a reboot and you should see the Windows entry on the disk.