I needed more space on my Windows partition... So I used Disk Utility to free up some space from the OS X partition, and upon restarting to Windows in order to add the free space to windows, I discovered that windows no longer boots! OS X still boots, but how can I fix my Windows partition without reinstalling Windows and losing all my data?
The following worked for me. I have macOS 10.12.3 and Windows 10.
- Boot to Recovery mode (restart, hold "command+R")
- Utilities -> terminal
fdisk -e /dev/disk0" p setpid 4 [press enter] flag 4 p write y
The Terminal commands below has been proven to work in this situation. It's a fix within the last year from someone with the same problem. Disk Utility and Boot Camp were never designed to cooperate. Unfortunately, they aren't labelled at all to prevent this kind of event from taking place.
For future reference, I believe the way to resize the partition is to do so in Boot Camp Assistant. Since you already did it, however, you'll need to adjust your partition manually in order to get it booting again. Of course, replace disk0 with your disk number which you can find in Disk Utility.
sudo fdisk -e /dev/disk0 p setpid 4 07 flag 4 p write y
Now Reboot and hold the ALT key and check if Windows shows up and is bootable. If you get 'missing operating system', then Windows Startup Repair and see if Windows will comeback alive. If you notice the difference between the Disk Utility screen (two partitions) vs the fdisk output (or the GPT) there are 'hidden' partitions and the MBR partitioning style used for Windows allows a maximum of 4 partitions. If you need further explanation, read the original thread. Yosemite should not be installed on any machine that is critical to you. If only partitioning was done, but Yosemite was NOT installed, you are in better shape. Yosemite ignores and is unaware of bootcamp and creates an additional Recovery HD and moves things around.