Bootcamp: no bootable device – insert boot disk and press any key
Solution 1:
With the release of High Sierra, Apple has forgotten about the needs of Windows 7 users. The right (or is it wrong) combination of commands causes eraser of the values stored in the Master Boot Record (MBR) table. Windows 7 uses these values to determine the partitioning of the drive. Fortunately, these values are duplicated in the GUID partition table (GPT). Unfortunately, you will have to preform the tedious task of reentering the missing values.
Unless you disable System Integrity Protection (SIP), the solutions given below requires booting to macOS Recovery via the internet, built-in recovery or an USB flash drive macOS installer. Once booted to macOS Recovery, open a Terminal application window.
Note: The Terminal application can be found under "Utilities" on the menu bar.
Solution without Using Third Party Tools
The answer given below is based on my answer to the question How to convert a drive from the GPT format to the hybrid GPT/MBR format when using High Sierra (macOS 10.13.2). You should read this question and answer before proceeding.
The command given below can be used to partially display the information contained in GUID partition table (GPT) stored on disk0
. You will need this information when editing the Master Boot Record (MBR) table.
gpt -r show /dev/disk0
Here are the steps involving in editing the MBR table to create a hybrid partitioning scheme. You will be preforming the same steps as given in this answer, except for the changes given below.
-
The interactive command to edit the MBR partition table is given below. All changes will be not be entered in CHS mode.
fdisk -e /dev/disk0
Entering this command produced the following output
fdisk: could not open MBR file /usr/standalone/i386/boot0: No such file or directory Enter 'help' for information fdisk: 1>
Note: The control+C key can be pressed at anytime to terminate the
fdisk
command without saving any changes. -
The only entry, in the initial MBR table, defines a "Protective Partition". This partition needs to be truncated to the end of the first partition in the GPT with the GUID of
C12A7328-F81F-11D2-BA4B-00A0C93EC93B
. This means thestart
value should remain1
, but thesize
value should be reduced to the valuestart
+size
-1
. The values use in this equation should be taken from GPT. The computed value usually is409639
.Below are the correct values to enter into
fdisk
for the first partition of the MBR table. Replace<start + size - 1 of GPT partition with index=1>
with the computed integer value.edit 1 EE N 1 <start + size - 1 of GPT partition with index=1>
-
Next, enter the correct values for second partition of the MBR table. The command is
edit
and theid
isAC
. Thestart
andsize
values are the same as shown in the GPT. Doing so, results in what is shown below.edit 2 AC N <start of GPT partition with index=2> <size of GPT partition with index=2>
-
Repeat the previous step to update MBR table partitions 3 and 4. This is shown below. The
id
for partition 3 isAB
and for partition 4 is07
.edit 3 AB N <start of GPT partition with index=3> <size of GPT partition with index=3> edit 4 07 N <start of partition with index=4> <size of partition with index=4>
-
The next command flags the fourth MBR partition as bootable. This partition was chosen because this is where the Windows resides.
flag 4
-
The next command to enter is
print
. This command displays what the updated MBR table would look like. You can use the output to verify your changes.Note: The descriptions such as
<Unknown ID>
,Xenix BBT
andHPFS/QNX/AUX
are either wrong and/or outdated. Also, thecyl
,hd
andsec
values are no longer used by macOS or Windows so you can ignore these values. -
The final command
quit
writes the table back to the MBR, then quitfdisk
. This is shown below.fdisk:*1> quit Writing current MBR to disk. Device could not be accessed exclusively. A reboot will be needed for changes to take effect. OK? [n] Y
As the above message suggests, it would be a good idea to restart the Mac.
Solution Using a Third Party Tool
The command gdisk
is a third party tool that can be used to avoid having to manually enter the partition values from the GPT. You can download gdisk
from this SourceForge website. Once booted to macOS Recovery, you would need to enter the command given below.
/Volumes/HARDISK/usr/local/bin/gdisk /dev/disk0
Note: I assume the name of your macOS boot volume is
HARDDISK
. If not, make the appropriate substitution.
An example of your input to gdisk
is given below.
GPT fdisk (gdisk) version 1.0.3
Warning: Devices opened with shared lock will not have their
partition table automatically reloaded!
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): r
Recovery/transformation command (? for help): h
WARNING! Hybrid MBRs are flaky and dangerous! If you decide not to use one,
just hit the Enter key at the below prompt and your MBR partition table will
be untouched.
Type from one to three GPT partition numbers, separated by spaces, to be
added to the hybrid MBR, in sequence: 2 3 4
Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N): y
Creating entry for GPT partition #2 (MBR partition #2)
Enter an MBR hex code (default AF): ac
Set the bootable flag? (Y/N): n
Creating entry for GPT partition #3 (MBR partition #3)
Enter an MBR hex code (default AB): ab
Set the bootable flag? (Y/N): n
Creating entry for GPT partition #4 (MBR partition #4)
Enter an MBR hex code (default 07): 07
Set the bootable flag? (Y/N): y
Recovery/transformation command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/disk0.
Warning: Devices opened with shared lock will not have their
partition table automatically reloaded!
Warning: The kernel may continue to use old or deleted partitions.
You should reboot or remove the drive.
The operation has completed successfully.
As the above message suggests, it would be a good idea to restart the Mac.
Final Thoughts
If you Mac still fail to boot to Windows, then you will need to rebuild your Windows boot code. For this you will need a flash drive you used to install Windows 7. Let me know if you need instructions.
If you read all the way down to this point, I might as well mention the other problem. Your Recovery HD
partition is not suppose to be 87.8 GB in size. This has nothing to do with Windows, but I thought I should point it out.