Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Windows Won't Boot after resizing partition

I am having problems with Windows not rebooting after I resized partition to reduce Mac side and increase Windows side. I do not see the BootCamp partition labelled as such while running disk utility. Upon startup, the Windows partition shows up when I boot up while pressing the ALT key. However, when I try to run Windows, it says " error loading operatig system".


I also followed instruction and went through to run gdisk successfully. Results towards the end.


What can be done? Windows still does not boot and It shows ? Suspicious MBR at sector 0.


Below is information based on typical questions asked here.....



diskutil list

/dev/disk0 #: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *120.0 GB disk0

1: EFI 209.7 MB disk0s1

2: Apple_HFS Macintosh HD 78.5 GB disk0s2

3: Apple_Boot Recovery HD 650.0 MB disk0s3

4: Microsoft Basic Data 31.7 GB disk0s4




sudo gpt -r -vv show disk0

gpt show: disk0: mediasize=120034123776; sectorsize=512; blocks=234441648

gpt show: disk0: Suspicious MBR at sector 0

gpt show: disk0: Pri GPT at sector 1

gpt show: disk0: Sec GPT at sector 234441647

start size index contents

0 1 MBR

1 1 Pri GPT header

2 32 Pri GPT table

34 6

40 409600 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B

409640 153240016 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC

153649656 1269544 3 GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC

154919200 17628896

172548096 61892608 4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

234440704 911

234441615 32 Sec GPT table

234441647 1 Sec GPT header



sudo fdisk /dev/disk0

Disk: /dev/disk0 geometry: 14593/255/63 [234441648 sectors]Signature: 0xAA55

Starting Ending

#: id cyl hd sec - cyl hd sec [ start - size]

------------------------------------------------------------------------

1: EE 0 0 2 - 1023 254 63 [ 1 - 172548095] <Unknown ID>

*2: 07 1023 254 63 - 1023 254 63 [ 172548096 - 61892608] HPFS/QNX/AUX

3: 00 0 0 0 - 0 0 0 [ 0 - 0] unused

4: 00 0 0 0 - 0 0 0 [ 0 - 0] unused





sudo gdisk /dev/disk0

GPT fdisk (gdisk) version 0.8.7


Warning: Devices opened with shared lock will not have their

partition table automatically reloaded!

Partition table scan:

MBR: hybrid

BSD: not present

APM: not present

GPT: present


Found valid GPT with hybrid 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: 4

Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N): y


Creating entry for GPT partition #4 (MBR partition #2)

Enter an MBR hex code (default 07):

Set the bootable flag? (Y/N): y


Unused partition space(s) found. Use one to protect more partitions? (Y/N): n


Recovery/transformation command (? for help): o


Disk size is 234441648 sectors (111.8 GiB)

MBR disk identifier: "DELETED INFO"

MBR partitions:

Number Boot Start Sector End Sector Status Code

1 1 172548095 primary 0xEE

2 * 172548096 234440703 primary 0x07

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/disk2.

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.

Mac mini, Mac OS X (10.7.5), Running Windows XP via Bootcamp

Posted on Aug 26, 2013 3:52 PM

Reply
18 replies

Aug 26, 2013 6:46 PM in response to JiBee

So here's what I think happened. Upon resizing the OS X volume, a 5th partition was created. When that happens, diskutil removes the hybrid MBR that's needed to activate the EFI firmware CSM (BIOS emulator) which is still presently used for booting Windows on Apple hardware. Upon removing the hybrid MBR, Windows is no longer bootable. So what you probably did was used Disk Utility to reverse what you did by deleting the extra partition. When you do this, diskutil recreates the hybrid MBR but with the wrong partition type code. It sets it to 0x0C, and therefore thinks it's FAT32, whereas it should be 0x07 for NTFS. Disk Utility will then let you run a disk check on what it erroneously thinks is a FAT32 volume, but is in fact NTFS. If any writes are done, which it appears is the case, it corrupts the NTFS file system.


So this is just yet another Bootcamp data loss story, without any warning in either documentation or Disk Utility whatsoever.


What version of OS X is this?


The easiest, but most tedious thing to do is to totally start over with everything: obliterate the entire drive with Disk Utility making 1 partition only, reinstalling OS X and files from backups, use Bootcamp Assistant to resize the OS X volume the way you really want it, reinstall Windows and restore from its backup. All of that can be done in the GUI.


You might still use the Windows install disk to run Windows startup repair. It might fix the Bootcamp volume. The remaining problem in that case is what to do with the large pile of free space, but I'll make those suggestions later once you get to that point.


If Windows startup repair can't fix the Bootcamp volume, and you don't have a backup, then you'll need to download and install testdisk, and read how to use it to try and find your data. It's an iterative process. Once that's done, while it probably won't fix it and make it bootable again, you'll have a basic backup of files. The remaining thing to do is use gdisk remove the broken Windows partition, make a new one that also includes free space you presumably wanted Windows to have, and make a new hybrid MBR adding partitions 2 3 4. Then reinstall Windows, your apps, and restore your data from backups.


So that's the gist. Ask if you have more questions.

Aug 26, 2013 8:05 PM in response to Christopher Murphy

I don't know if this information helps:

The EFI was visible right upon startup after the resize but dissapeared after I ran "gdisk". Bootcamp appeared as "disk0s4" after resize.


Version of software is Mac OS X Lion 10.7.5

It still shows code as " 0x07"


I was trying to save many of the WIndowsXP versions of software and associated files that I had accumulated over time. A re-install would mean a newer version of WIndows which is what I have avioded and would like to avoid. I'll have to look very hard for the WindowsXP install disk now.


Yes, such data loss stories are unfortunate for many of us.

Aug 26, 2013 8:21 PM in response to JiBee

The EFI was visible


I don't know what that means.


Bootcamp appeared as "disk0s4" after resize.


That's unfortnately expected (while being undocumented, is caused without prior warning, and Apple provides no tools to repair). So did you click on disk0s4 and try to repair it?


Strictly speaking a reinstall doesn't require a new version of Windows. It's just that Bootcamp Assistant blocks you from this. The old XP bootcamp.exe files/drivers are still floating around, so as long as you have older hardware that's successfully running XP, it's possible to reinstall it. Again, just not via Bootcamp Assistant. It can be done via Disk Utility or via command line.

Aug 26, 2013 8:39 PM in response to JiBee

EFI used to be one of the HDD symbols I would see upon initial startup while I held down the ALT key. I don't see this anymore.


That's not normal. With Lion + Windows you should see three options: Macintosh, Recovery HD, Windows.


You can see it but not be able to click on it. Interestingly it show format as MS-DOS(FAT).


Now? Or previously?


I'll try the Windows re-install and see what happens.


No, I suggested that you boot the installer and run Windows startup repair first. It's worth seeing if it can be fixed. And then next is testdisk if you don't have backups.

Aug 26, 2013 10:02 PM in response to Christopher Murphy

FYI...Here's what I get when I try to repair disk0s4...


Verifying volume “disk0s4”

Checking file system** /dev/disk0s4

Invalid BS_jmpBoot in boot block: 0a0000

Error: This disk needs to be repaired. Click Repair Disk.


Verify and Repair volume “disk0s4”

Checking file system** /dev/disk0s4

Invalid BS_jmpBoot in boot block: 0a0000

Volume repair complete.Updating boot support partitions for the volume as required.Error: Disk Utility can’t repair this disk. Back up as many of your files as possible, reformat the disk, and restore your backed-up files.

Aug 27, 2013 12:03 AM in response to JiBee

You really aren't paying attention. I explicitly said earlier you do NOT want to run Disk Utility on Windows NTFS volumes that Disk Utility incorrectly identifies as FAT32 because it will corrupt the file system if any writes are done.


6 hours ago I wrote:

Disk Utility will then let you run a disk check on what it erroneously thinks is a FAT32 volume, but is in fact NTFS. If any writes are done, which it appears is the case, it corrupts the NTFS file system.



Disk Utility != Windows startup repair. OS X cannot create or repair NTFS volumes. It can repair FAT32 volumes. Disk Utility is misidentifying the volume as FAT32 and attempting to repair it. You should not allow it to do this!

Aug 27, 2013 8:34 AM in response to JiBee

Windows XP is a long time ago, I'd see if you can even find a Vista or Windows 7 install DVD, with or without serial number. Use it manually as described in the bootrec documentation, rather than using the automated windows startup repair which probably won't work on an older version of Windows. But a newer chkdsk will. Use chkdsk first and see what results you get. Then try chkdsk \f to force repair without trusting the journal.


Even if you can't get it booting at least you can get data off of it. So it may still be worthwhile to go down the testdisk route.

Aug 27, 2013 9:10 AM in response to JiBee

Probably. But I'm unfamiliar with both that backup method, or the restore process. So either the exact steps of "how to restore" using that backup method needs to be specified, or the expectations of system state immediately prior to the restore needs to be specified. Then I can tell you what you need to do to your system to get it in that state, as it's pretty unlikely the GUI tools will help you do that correctly.

Windows Won't Boot after resizing partition

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.