Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Alvin777

Suspended
Original poster
Aug 31, 2003
503
39
Hello I recently uninstalled something in the EFI (in this EFI folder I erased folders named EFI, System and boot.efi in the secondary macOS volume (my setup, in one drive is a quadruple boot at that time, which included Boot Camp. I had the EFI mounted with an app). I deleted that volume, that whole secondary macOS volume after using Disk Utility.

After I rebooted wanting to dual boot to Boot Camp Windows, I held the 'Option' key to show which startup volumes are available (Apple's take on the Boot Manager) but only my two macOSes came up, Boot Camp wasn't seen as bootable.

However if I boot to my macOS Monterey, Boot Camp still mounts on the desktop (thankfully it wasn't deleted) and if I go to the Startup in Systems Preferences, you could select Boot Camp as the volume to boot to on restart which doesn't when I do restart it, macOS is eventually booted.

Is there a way on macOS, a macOS app that can repair the boot file or whatever makes Boot Camp bootable again?

Thank you, happy St. Valentine's Day in advance- may it be a great one.
 

tinygoblin

macrumors regular
Feb 20, 2022
121
33
EFI folder contained Windows boot files, that's why you don't get the option. You can restore by installing Windows to an external drive and restoring your internal drive's EFI by running command from your new external drive Windows installation:
BCDBOOT Z:\Windows /S Y: /F ALL (for BIOS & UEFI, for any Mac)
or
BCDBOOT Z:\Windows /S Y: /F UEFI (for UEFI only, if your Mac is ~2016+)
where Z:\ is your internal SSD's Windows volume and Y: is your internal drive's EFI volume.
Make sure to backup contents of your internal drive's EFI volume before running commands (just copy all somewhere using File Explorer).
You will also have to assign letter to your internal drive's EFI partition so it's accessible in Windows from File Explorer & BCDBOOT command, use the following to do that:
Code:
DISKPART
LIST DISK
Note internal disk's disk number based on it's size
SELECT DISK # (# is 0 or 1, the internal drive's number)
LIST PARTITION
Note EFI partition's number, the smallest size one
SELECT PARTITION # (# EFI partition's number)
ASSIGN LETTER Y:
EXIT
If something goes off and you'll loose some boot option just copy backup of EFI to EFI volume using your Windows on external drive. But you should be al' good.
 
  • Like
Reactions: Alvin777

Alvin777

Suspended
Original poster
Aug 31, 2003
503
39
EFI folder contained Windows boot files, that's why you don't get the option. You can restore by installing Windows to an external drive and restoring your internal drive's EFI by running command from your new external drive Windows installation:
BCDBOOT Z:\Windows /S Y: /F ALL (for BIOS & UEFI, for any Mac)
or
BCDBOOT Z:\Windows /S Y: /F UEFI (for UEFI only, if your Mac is ~2016+)
where Z:\ is your internal SSD's Windows volume and Y: is your internal drive's EFI volume.
Make sure to backup contents of your internal drive's EFI volume before running commands (just copy all somewhere using File Explorer).
You will also have to assign letter to your internal drive's EFI partition so it's accessible in Windows from File Explorer & BCDBOOT command, use the following to do that:
Code:
DISKPART
LIST DISK
Note internal disk's disk number based on it's size
SELECT DISK # (# is 0 or 1, the internal drive's number)
LIST PARTITION
Note EFI partition's number, the smallest size one
SELECT PARTITION # (# EFI partition's number)
ASSIGN LETTER Y:
EXIT
If something goes off and you'll loose some boot option just copy backup of EFI to EFI volume using your Windows on external drive. But you should be al' good.
Thanks. I borrowed a Windows 11 installer on a USB flash drive (it's for a PC computer) when I hold the Option key on boot up, that flash drive isn't seen as a boot, Disk Utility doesn't see it as bootable too (but it boots on the PC).

With that that said, if I used Rufus to create an external Windows 10 or 11 install, will the Mac (hold option upon boot up) recognize the external drive as bootable to Windows 10 or 11?

Also coz' I'd have to find a drive or borrow an extra drive to install a bootable external Windows 10 or 11 to but maybe it's possible for a virtual machine to see my Boot Camp volume and restore it from a virtual machine like Oracle's virtual machine for macOS?

I could mount the EFI folder I think of the Boot Camp Volume but is there a link, a site (for those with this kind of problem) where I can copy boot files for windows 11 or 10 and paste it into the EFI folder and restore it like that?
 

tinygoblin

macrumors regular
Feb 20, 2022
121
33
If you've got Windows virtual machine just use it to wipe your "faulty" Windows 11 flash drive and make a bootable Windows PE from this drive. Drop Boot Camp drivers into root of the drive in folder $WinPEDriver$ so Windows PE can read your Mac's internal SSD (you can get drivers using Brigadier from GitHub in virtual machine, it will deliver $WinPEDriver$ folder that you can just copy to the root of your WinPE). Boot from Windows PE bootable USB drive and use commands from above. No need to have an external drive with Windows on it. Once you're done with restoring make Windows 11 bootable drive and return it. If you're short on time here's my WinPE ISO, feel free to use it. Don't use sketchy software to create bootable WinPE. Use good ol' DISKPART from Windows virtual machine (this is for UEFI Macs which is marked with asterixis, for BIOS Macs use MBR):
1) format USB flash drive using Command Prompt
Code:
diskpart
list disk
select disk # (# is number of USB flash drive)
clean
convert mbr
* convert gpt (or mbr)
create partition primary
select partition 1
* list volume (for GPT)
* select volume # (for GPT)
active
format fs = exfat quick
* format fs = ntfs quick
assign (typically assigned E:\)
exit
2) mount Windows PE ISO (typically D:\)
3) Command Prompt:
Code:
D:\boot\bootsect.exe /nt60 E:
xcopy D: E: /E /G /H /Q
You can also buy yourself a 512+ MB USB flash drive since they are quite affordable these days, like $1 used or even free sometimes. Oh, your Windows 11 bootable USB flash rive is probably not visible because it's prepared for UEFI device and you've got BIOS Mac. I just called it "faulty" for a quicker explanation.
 
Last edited:
  • Like
Reactions: Alvin777

Alvin777

Suspended
Original poster
Aug 31, 2003
503
39
If you've got Windows virtual machine just use it to wipe your "faulty" Windows 11 flash drive and make a bootable Windows PE from this drive. Drop Boot Camp drivers into root of the drive in folder $WinPEDriver$ so Windows PE can read your Mac's internal SSD (you can get drivers using Brigadier from GitHub in virtual machine, it will deliver $WinPEDriver$ folder that you can just copy to the root of your WinPE). Boot from Windows PE bootable USB drive and use commands from above. No need to have an external drive with Windows on it. Once you're done with restoring make Windows 11 bootable drive and return it. If you're short on time here's my WinPE ISO, feel free to use it. Don't use sketchy software to create bootable WinPE. Use good ol' DISKPART from Windows virtual machine (this is for UEFI Macs which is marked with asterixis, for BIOS Macs use MBR):
1) format USB flash drive using Command Prompt
Code:
diskpart
list disk
select disk # (# is number of USB flash drive)
clean
convert mbr
* convert gpt (or mbr)
create partition primary
select partition 1
* list volume (for GPT)
* select volume # (for GPT)
active
format fs = exfat quick
* format fs = ntfs quick
assign (typically assigned E:\)
exit
2) mount Windows PE ISO (typically D:\)
3) Command Prompt:
Code:
D:\boot\bootsect.exe /nt60 E:
xcopy D: E: /E /G /H /Q
You can also buy yourself a 512+ MB USB flash drive since they are quite affordable these days, like $1 used or even free sometimes. Oh, your Windows 11 bootable USB flash rive is probably not visible because it's prepared for UEFI device and you've got BIOS Mac. I just called it "faulty" for a quicker explanation.
Hi I got to create a Windows 11 PE and got to boot it on the iMac. It seems my Win PE USB is X: and my BootCamp is C: Is this the command I use to restore or repair Win 11's bootloader (or boot file), I changed D: to X: and D: to C: in the xcopy command (correct me if I'm wrong):

X:\boot\bootsect.exe /nt60 E:
xcopy X: C: /E /G /H /Q

By the way where is this command used? bootsect /nt60 sys
 

tinygoblin

macrumors regular
Feb 20, 2022
121
33
BOOTSECT was required to make WinPE USB flash drive bootable. To restore EFI you need to boot from WinPE, assign letter to EFI and then use BCDBOOT command (everything as I described in message #2). BCDBOOT.EXE is in X:\Windows\System32 when you boot from WinPE USB drive. I found an article with pictures, may be easier to understand what you're supposed to do in Command Prompt of WinPE.

As I understand it, BCDBOOT reads actual location (disk offset) of your Windows partition and creates appropriate boot loader in EFI partition. I used this approach multiple times to create an external bootable Windows (Boot Camp) USB from existing Boot Camp partition (its a lot faster because you don't need to wait for Windows to install from slow USB disk, you just copy offline image contents SSD-to-SSD and make it work by injecting correct offset and boot loader directly to EFI via BCDBOOT).
 
Last edited:
  • Like
Reactions: Alvin777
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.