# copy the ESP files from an existing Win 7 EFI installation
# the files will later be copied to the new ESP
# ESP file name: /dev/sdb1
sudo mkdir /mnt/esp
sudo mount -r /dev/sdb1 /mnt/esp
mkdir ~/esp
sudo cp -vR /mnt/esp/* ~/esp
# convert the partition table from MBR to GPT
sudo gdisk /dev/sdb
r
f, y
m
w, y
# convert SRP to ESP
# this assume that BitLocker isn't used
sudo gdisk /dev/sdb
t, 1, ef00
w, y
# format ESP as FAT32 (it's by default NTFS)
sudo mkdosfs -vF32 -n"EFI System" /dev/sdb1
# copy files to ESP
sudo mount /dev/sdb1 /mnt/esp
sudo cp -vR ~/esp/* /mnt/esp
Run these commands in WinPE
# make bootable from Windows 7 install image (WinPE)
# open the console with Shift + F10
recovery\startrep
Use caution
Test the operation with a disk image in a virtual machine
by adding this line to the .vmx to enable EFI
firmware="efi"
before applying the operation to the original disk because
an incorrect command can damage the partition table so that files can't be read
EFI system partition
A default Windows 7 MBR installation has the partition
System Reserved
size: 100.0 MiB
file system: NTFS
purpose: BitLocker and WinRE
conversion: can be converted to the ESP if BitLocker is unused
A default Windows 7 GPT installation has the partition
EFI System Partition
size: 100.0 MiB
file system: FAT32
flags: boot
System Reserved
size: 128.0 MiB
file system: unknown
flags: msftres
purpose: Conversion to dynamic volume
conversion: to reserve space for this purpose without resizing paritions share the 100.0 MiB System Reserved space between the ESP and an MSR partition
Request
Undescribed problem
Describe a problem with this conversion that's not described in this post
I.o.w. a difference between the resulting partitions from this conversion and a default Windows 7 GPT installation
Bootable
Describe a more precise way than StartRep to make the ESP bootable because
it can be used to troubleshoot cases when StartRep fails
Data critical to platform operation is located in partitions and not in unpartitioned or "hidden" sectors. GPT disks use primary and backup partition tables for redundancy and CRC32 fields for improved partition data structure integrity
Unpartitioned or "hidden" sectors refer to for example the 0x00 to 0x1b8 MBR code area
Introduction
This post is written because
Abbreviations
Command
Run these commands in Ubuntu
Run these commands in WinPE
Use caution
Test the operation with a disk image in a virtual machine
by adding this line to the
.vmx
to enable EFIbefore applying the operation to the original disk because
EFI system partition
A default Windows 7 MBR installation has the partition
A default Windows 7 GPT installation has the partition
Request
Undescribed problem
Describe a problem with this conversion that's not described in this post
I.o.w. a difference between the resulting partitions from this conversion and a default Windows 7 GPT installation
Bootable
Describe a more precise way than StartRep to make the ESP bootable because
Loading SLIC
The WindSLIC UEFI SLIC loader can be used to
GPT benefit
The reason for using GPT over MBR are
Partition size
support for >2TiB partitions
Easier to change boot code
The boot code is easier and safer to change because
Windows and GPT FAQ
Unpartitioned or "hidden" sectors refer to for example the 0x00 to 0x1b8 MBR code area