Repair EFI from Terminal

Hello! I broke Windows EFI loader after some experiments and trying to repair
sudo /Applications/Winclone.app/Contents/Resources/winclone -p /dev/disk2s2 -e
Password:
Starting Winclone command line tool…
Showing disk info

/dev/disk2 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *240.1 GB disk2
1: EFI EFI 209.7 MB disk2s1
2: Microsoft Basic Data Windows 239.8 GB disk2s2


Mac identifier is MacPro5,1
The image contains an Windows 8 or later
Based on Model identifier, this Mac can boot Windows in EFI mode
Setting EFI Bootable
Forcing boot type
Forcing EFI
Making /dev/disk2s2 EFI Bootable
Copying EFI Files if needed
source device is file:///dev/disk2s2
/Volumes/EFI/EFI/Microsoft/Boot/bg-BG already exists. Skipping

/Volumes/EFI/EFI/Microsoft/Boot/zh-TW already exists. Skipping
copying /Volumes/Windows/Windows/Boot/Fonts to /Volumes/EFI/EFI/Microsoft/Boot/Fonts
copying /Volumes/Windows/Windows/Boot/Resources to /Volumes/EFI/EFI/Microsoft/Boot/Resources
copying EFI bootloader from /Applications/Winclone.app/Contents/Resources/bootx64.efi to /Volumes/EFI/EFI/Boot/bootx64.efi
EFI Unmounted
Updating BCD with BCD at /Applications/Winclone.app/Contents/Resources/EFIBCD
error updating BCD on EFI partition
Mac-Pro-Rodion:~ rodion$
as a result it works, but it seems to be strange to unmount EFI before creation the BCD file

The EFI partition is remounted in the " Updating BCD with BCD" function. We unmount and remount partitions a lot more than is needed since a lot of operation require the disk to be in a very specific mount state.

tim

1 Like

Thanks for the answer!
What is " error updating BCD on EFI partition"? it works, I can boot this copy of Windows
and bcdedit /enum shows correct data
Just for interest
Thanks again!