Problem
After using GParted to resize an NTFS bootcamp partition, Windows 8 fails to boot with “Missing Operating System”.
Discussion
There are commercial utilities for resizing a bootcamp partition like Camptune or WinClone, but they are unnecessary. Disk Utility will shrink the OS X partition to make space. Booting to a Linux USB Drive with GParted can then expand the NTFS partition, and Windows’ bcdboot can fix the resulting error.
Solution
Boot to a Windows 8 USB drive and get to a command prompt. Then use diskpart to set the NTFS partition to Active, and run bcdboot to repair the boot files.
Example steps:
At the prompt, run diskpart, set the partition to Active, and run bcdboot with your Windows directory as a parameter. Here is a sample command sequence:
diskpart select disk 0 list part select part 4 active exit bcdboot d:\windows
The results will look something like this:
And finally, type exit
to restart…
This got rid of the “Missing Operating System” error and allowed Windows to boot.
Optional
As a result of the bcdboot command, there was an annoying extra entry in my list of boot loaders:
So, I removed the extra entry using bcdedit. First, find the GUID entry you want to delete (hint: it’s the one not labeled current). Then, delete that entry:
bcdedit /delete {your-GUID-here}
Now the machine will boot straight into Windows just as it did before, but with a handily resized partition. No extra commercial software required. This process can also be used in reverse, i.e. boot to Linux, use GParted to shrink the NTFS partition, repair with bcdboot, then use Disk Utility to enlarge the OS X partition.
I have a problem . When I write “list part” it shows me only 3 partitions!!! So I tried all the three And each Time it doesn’t work
Just remove all the hardwares and flash disks connected
unable to open the command prompt tooo.
Help me how to open command prompt??
this worked perfectly. I was so scared when i first saw the text, “Missing Operating System”.
Cheers
Thanks! That provided the one hint I needed to sort out a similar issue with a Windows 7 Boot Camp installation.
de nada. 🙂
I followed these steps, slightly modifying to my computer’s set up. But I came across an error when trying to use the bcdboot command, saying “Failure when attempting to copy boot files.” Also instead of being on the D:\ drive after using diskpart, my computer remains at X:\Sources, I don’t know if this is making it not work or not. Does anyone have any ideas?
@Drake — yeah, the drive letters can be confusing. X: is the Windows repair environment and not where you want to run bcdboot. In this example, D: was the USB drive containing a clean copy of Windows where I needed to run bcdboot. Using “list volumes” in diskpart will show you which drive is which.
Very very very thank youuuuu mannnn
Just in case you need to make a bootable Windows 8 USB stick in OSX:
http://apple.stackexchange.com/questions/103874/creating-a-bootable-usb-of-windows-8-1-on-os-x
Worked swimmingly after resizing my OSX partition with gparted! Thanks very much!
i repaired it without
bcdboot d:\windows
only used commands prior this one (win 7)