2

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?

  • Please add the output of sudo fdisk /dev/disk0 and sudo gpt -r show /dev/disk0 to your question. – klanomath Nov 29 '15 at 8:16
3

The following worked for me. I have macOS 10.12.3 and Windows 10.

  1. Boot to Recovery mode (restart, hold "command+R")
  2. Utilities -> terminal
  3. Run

    fdisk -e /dev/disk0"
    p
    setpid 4
    [press enter]
    flag 4
    p
    write
    y
    
  4. Reboot
1

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.

https://discussions.apple.com/thread/6465316

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.

  • there seems to be nothing there when typing p in the second step. #1 shows data but 2-4 are empty. My files still exist because I can still access them. – user3781268 Nov 29 '15 at 7:36
  • Before I address that, I just had the thought that you may be able to simply open Boot Camp Assistant and repair it that way. Have you tried that? – BarryMode Nov 29 '15 at 7:39
  • "The startup disk cannot be partitioned or restored to a single partition" – user3781268 Nov 29 '15 at 7:42
  • Must be formatted as a single Mac or OS X extended volume or already partitioned by boot camp assistant for installing windows – user3781268 Nov 29 '15 at 7:43
  • The only option I have after that message is to create an install disk... – user3781268 Nov 29 '15 at 7:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .