I want to expand a partition on my boot SSD, but there is a Recovery Partition and EFI System Partition in the way. How can I get around this?

Okay, I took the plunge and decided to try and fix it anyway, even if it involved deleting my Microsoft Reserved Partition. As Rod Smith said, the EFI System Partition is in a non-standard location as I had manually created the NTFS partition at the start of the SSD prior to installing Windows, so it placed the partition in the only place it could. Following are steps I followed to fix my problem and make room to expand the drive.

You will need the installation media, or some Windows recovery environment with DISKPART.

  1. Using GParted, move the EFI System Partition and Recovery partition out of the way, to make room for the Boot partition to move around, and apply changes.

  2. Move the Boot partition to the right, leaving enough space. The Recovery Partition is 450 MB, the EFI System Partition is 100 MB, and the Microsoft Reserved Partition is 128 MB. This gives 678 MB in total. To leave room for Windows to create more of its stupid extra partitions in the future I added 1024 MB onto this, meaning I moved the Boot partition to the right by a total of 1702 MB. Apply changes (and have a cup of tea in the meantime as this takes a while).

  3. Delete the Microsoft Reserved Partition in GParted, and apply changes.

  4. Right-click and copy the EFI System Partition in the GUI, and then paste it into the free space preceding the Boot partition - I put the EFI system Partition at the very start of the disk, as that's the standard place. Right-click the new partition, and apply the exact same flags as the old one (boot, esp). Repeat this procedure for the Recovery partition and apply the same flags as the original again, but put it at the end of the free space (next to the Boot partition) rather than at the start. Apply changes. The drive layout should now look like this:
    EFI System Partition | Free space | Recovery Partition | Boot partition | ...

  5. Delete the original EFI System Partition and Recovery Partition, and apply changes. The Boot partition is now free to grow, so I resized it to the right to fill the free space there.

  6. Boot into the Windows installation media, and press SHIFT+F10 to open the command prompt. Type diskpart. Type list disk, and then select disk X where X is the number of the physical drive containing the Boot partition. Type list partition to give you the partition list. I had the EFI System Partition at the start of the disk now which is 100 MB in size, and the partition list says that it began at an offset of 1024 kB. Windows considers a megabyte to be 1024 kB so the free space begins at an offset of 1024 + (100*1024) = 103424 kB. Type the command create partition msr size=128 offset=103424. If you have the sizes and offsets right, this should work, and in my case, it indeed did.

  7. Reboot into Windows to ensure it works fine.

I live on the edge so I didn't make a backup before I did all this, and it was fine - however I'd recommend you backup any important information on the Boot partition before doing this.