# Moving EFI Partition



## Ipurerican (Oct 23, 2017)

I recently upgraded my Hard Drive Disk with an SSD, moving my older HDD as a second storage drive. I then installed Windows 10 on my SSD . But the problem is the EFI System partition is still on my HDD, not the SSD. I would like to move the EFI partition to the SSD.

Is there a way to either recreate the partition, or move it from my HDD to the SSD? (100 MB Partition)

Any help would be greatly appreciated!


----------



## crjdriver (Jan 2, 2001)

Yes, it is possible however doing so generally requires a pretty high level of skill. Probably easier to just clean install windows on the ssd. Be sure to have ONLY the ssd drive connected when doing the install.


----------



## Ipurerican (Oct 23, 2017)

I'm really not looking to re-install all of my programs. 
Thanks anyways.


----------



## crjdriver (Jan 2, 2001)

Well you already did it once and it would probably take less time however IF you really want to try, here are the instructions.
1 Make a win10 repair or install disk
2 Create a bootable linux usb with parted magic
3 Boot your system with the linux live usb. Use gparted to move/resize partitions on your system drive. Leave 512meg at least at the front of the drive; leave unallocated
4 Quit linux and boot your system with the windows repair disk
5 Now comes the difficult part;
Since the system doesn't boot correctly, we'll need Windows installation disk with Windows 10 (Win 8 or 7) or any other boot disk. Boot from the installation media and on the first installation screen press *Shift+F10*. The command prompt window opens.



Run the disk and partition management utility:

Diskpart
Display the list of hard disks in the system (in our example, there is only one disk, *disk 0*. The asterisk in the GPT column means that it uses the GUID partition table).

list disk
Select this disk:

Select disk 0
Display the list of partitions on this disk:

List partition
In our example, only two partitions are left in the system:


MSR partition - 128 MB;
Windows system partition - 9 GB.
As you can see, the EFI partition is missing (it has been deleted).



Our task is to remove the remaining MSR partition so that we have at least 228 MB of unallocated space on the drive (for MSR and EFI partitions). You can remove this partition using the graphical Gparted or directly from the command prompt (we'll choose the last variant).

*Important!* Please, be extremely attentive here and do not accidentally delete Windows partition or partitions containing user data (if there are any).
Select the partition to remove:

Select partition 1
And delete it

Delete partition override
Make sure that there is only Windows partition left:

List partition


Now you can re-create EFI and MSR partitions manually. To do it, run these commands in diskpart context one by one.

Select the disk:

select disk 0

create partition efi size=100
Make sure that the 100 MB partition (an asterisk in front of the Partition 1) is selected:

list partition
select partition 1
format quick fs=fat32 label="System"
assign letter=G
create partition msr size=128
list partition
list vol
In our case, disk letter C: is already assigned to our Windows partition. Otherwise, assign the drive letter to it as follows:

select vol 1
assign letter=C
exit


*Repairing EFI bootloader and Windows BCD*
After you have created a minimal disk partition structure for the UEFI system, you can proceed to copy the EFI boot files to the disk and create a bootloader configuration file (BCD).

Copy the EFI environment files from the directory of the installed Windows 10:

mkdir G:\EFI\Microsoft\Boot

xcopy /s C:\Windows\Boot\EFI\*.* G:\EFI\Microsoft\Boot


Let's re-create the Windows 10 / 7 bootloader configuration:

g:
cd EFI\Microsoft\Boot
bcdedit /createstore BCD
bcdedit /store BCD /create {bootmgr} /d "Windows Boot Manager"
bcdedit /store BCD /create /d "My Windows 10" /application osloader
You can replace the caption "My Windows 10" for any other.

*Tip*. If only EFI files were damaged on the EFI partition and the partition itself was not deleted, you can skip the process of recreating partitions using diskpart. Although in most cases it is enough to repair the EFI bootloader in Windows 10 / 8.1. You can manually recreate the BCD on an MBR+BIOS system using this article.
The command returns the GUID of the created record, in the next command put this GUID instead of *{your_guid}*.



bcdedit /store BCD /set {bootmgr} default {your_guid}
bcdedit /store BCD /set {bootmgr} path \EFI\Microsoft\Boot\bootmgfw.efi
bcdedit /store BCD /set {bootmgr} displayorder {default}


The following commands are run in the {default} context:

bcdedit /store BCD /set {default} device partition=c:
bcdedit /store BCD /set {default} osdevice partition=c:
bcdedit /store BCD /set {default} path \Windows\System32\winload.efi
bcdedit /store BCD /set {default} systemroot \Windows
exit


Restart your computer… In our case it didn't boot from the first time. Try the following:


Turn your PC off.
Unplug your hard drive.
Turn your PC on, wait till the boot error window appears and turn it off again.
Plug your disk.
Then in our case (the test took place on the VMWare virtual machine with UEFI system) we had to add a new item to the boot menu by selecting *EFI\Microsoft\Boot\bootmgrfw.efi* on the EFI partition.

In some UEFI menus, by analogy, you need to change the priority of the boot partitions.



After all these actions, your Windows should boot correctly.


----------



## crjdriver (Jan 2, 2001)

BTW it is possible when deleting/moving partitions to select the wrong one. BE SURE of what you are doing and have a current backup of anything important.


----------



## Ipurerican (Oct 23, 2017)

crjdriver said:


> BTW it is possible when deleting/moving partitions to select the wrong one. BE SURE of what you are doing and have a current backup of anything important.


Thank you


----------

