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

Resized partition using Disk Utility and now Windows 7 will not boot

Hi,


Hopefully someone can help me!!


I had previously used Boot Camp to install Windows 7. However, I later realised I had not given myself anywhere near enough disk space as I started using Windows for things I hadn't originally planned on using it for.


Anyway, long story short, to solve the problem I uninstalled some applications on my Mac OSX and used Disk Utility to decrease the size of my Mac partition. My plan was then to reboot to Windows and use a Windows application to increase the size of the Windows partition. However - I coudln't even get that far.


Upon decreasing the size of my Mac partition (succesfully) I restarted my Mac in order to boot to Windows. However, I was greeted with a message along the lines of "unable to boot to Windows please insert boot disk and press any key" (I can't remember the exact message).


I was wondering if anyone knows of any way to restore my Windows partition, retaining all of my previously saved files on my Windows disk. It's probably a long shot, but the thought of losing everything I have been working on for the last few months is a sickening one.


What does give me a bit of hope is that, if I click Boot Camp it seems to recognise that Windows 7 is installed as the option that appears is to uninstall it.


Furthermore, if I view partitions in Disk Utility, a "DISK0S4" is listed. However, it's only at 20gb - if this WAS my BootCamp partition previously, it was originally at something around 60gb (I think - either way, definitely bigger than 20gb!).


On top of this, my current Macintosh HD parition is at 260gb and with the DISK0S4 partition at 20.21gb, there seems to be some space missing... I'm hoping this is the files I've been working on over the last few months!


Anyway, I've done some searching on the net and it *seems* that GPT fdisk *might* be my savour. I've downloaded it but have no idea how to use it and don't plan on playing about with it as I could no doubt do some real damage. If it is likely to solve my problem however, I'm certainly more than capable of being walked through what I need to do.


Please help!

Mac Pro, Mac OS X (10.7.5), Windows 7, Boot Camp, Partition

Posted on Jun 3, 2013 2:11 PM

Reply
18 replies

Jun 3, 2013 2:15 PM in response to Mannsy

What you did is not permitted via Boot Camp. You will now have to try using Boot Camp Assistant to remove the entire Windows partition. If it refuses then you have to use Disk Utility to remove it. If DU refuses then you will have to repartition the entire drive - you will lose your OS X volume in the process.

Jun 4, 2013 11:42 PM in response to Christopher Murphy

Hi Christoper - thanks for your reply!


Results of sudo fdisk /dev/disk0


Disk: /dev/disk0geometry: 38913/255/63 [625142448 sectors]

Signature: 0xAA55

Starting Ending

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

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

1: EE 1023 254 63 - 1023 254 63 [ 1 - 409639] <Unknown ID>

2: AF 1023 254 63 - 1023 254 63 [ 409640 - 507812496] HFS+

3: AB 1023 254 63 - 1023 254 63 [ 508222136 - 1269536] Darwin Boot

4: 0C 1023 254 63 - 1023 254 63 [ 585664512 - 39477248] Win95 FAT32L


Results of sudo gpt -r -v show disk0


gpt show: disk0: mediasize=320072933376; sectorsize=512; blocks=625142448

gpt show: disk0: Suspicious MBR at sector 0

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 507812496 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC

508222136 1269536 3 GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC

509491672 76172840

585664512 39477248 4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

625141760 655

625142415 32 Sec GPT table

625142447 1 Sec GPT header


Jun 5, 2013 8:42 AM in response to Mannsy

You're almost certainly going to learn the hard way why backups are important.


The MBR and GPT are sync'd in that they describe the same partitions. However the MBR #4 partition for Windows has the wrong type code and isn't flagged as active, so it's not bootable. It's also possible OS X doesn't see it (?) as NTFS because the type code is wrong, which is why you don't have a mounted BOOTCAMP volume in the Finder. These issues are all easily fixed.



Both MBR and GPT says the 4th partition is 18.8GiB (20GB). So if that's wrong, then there must be another step involved that you haven't mentioned because:



1. No Apple provided tool can resize NTFS. It won't even attempt it.

2. Shrinking the OS X partition to create another one for free space doesn't affect other partitions.

3. Adding a 5th partition always causes Disk Utility to replace the hybrid MBR with a protective MBR. You have a hybrid MBR still, so that definitely tells me there's a step in the reported sequence that's missing - as simple as running repair volumes or going back to Disk Utility to remove the partition you created earlier - every detail matters.


So I can't tell you how to fix this because I don't know exactly what you did.


There is 36GiB free space before the Windows volume. I can't tell you if that's part of the Windows volume or part of the resized OS X volume.


HFS+ and NTFS volumes are grown/shrunk from the end, not from the front. So the state of the disk partitioning doesn't really correlate to the sequence of events you've laid out and it seems something's missing. I suggest you go through step by step exactly what you did. And further I suggest you don't do anything else to make changes to this disk or you'll just make the problems worse.

Jun 5, 2013 9:43 AM in response to Christopher Murphy

Hi Chris,


The only other thing that I did was, upon being greeted with the "unable to boot" message first time round, I input the boot CD as it said and it loaded up the Windows 7 splash screen. From there, I selected "Fix issues". That took around 15 minutes or so and then rebooted. I had hoped that would sort it but nothing changed!


Regardless of whether the issue if fixable, thanks for taking the time to at least try and assist - much appreciated.

Jun 5, 2013 4:31 PM in response to Mannsy

Apple's Boot Camp implementation currently depends on EFI CSM (compatibility support module, which behaves as a BIOS), and in turn it depends on an MBR. So Apple creates a hybrid MBR (along with GPT used by OS X). This is arguably a violation of the UEFI spec, and therefore the GPT spec, is totally non-standard, and thus only tools expressly designed to understand this particular implementation of the hybrid MBR will correctly resize/fix such disks. And Apple doesn't provide such tools. I've argue here, and elsewhere that Disk Utility should disallow (or at least warn) users when creating more than three visible (meaning a total of five) partitions, because Apple's tools remove the hybrid MBR and replace it with a protective MBR, making Windows unbootable. And I consider this a data loss event, on just the fact the MBR is modified and unsynced (with the GPT) without notice; let alone the ensuing case where the user does something else to try and fix the situation, which actually causes more data loss, e.g. damage to the NTFS/Windows volume itself. So even if the MBR is reconstituted, the NTFS/Windows volume is damaged, directly as a result of the MBR having been modified.


Apple has a tech note that expressly says not to do what Disk Utility does, yet their own tools behaves in a manner proscribed by the technote. Not good. The technote is exactly, precisely correct, but Disk Utility's behavior is basically sabotage as far as I'm concerned.


It's worth a shot at using fdisk to change the type code and boot flag for the partition and see if rebooting OS X (not Windows) causes the BOOTCAMP volume to reappear. But I don't know that this will work because you're saying the Windows volume should be bigger than 20GB, but I have no idea why it would have been resized given the information you've provided.


So the way to do that with fdisk is:

sudo fdisk -e /dev/diskX


Where X is probably 0 (zero), if you only have one disk; otherwise use diskutil list to find out what the number is. This puts you into fdisk's interact edit mode, in a separate terminal window you should use 'man fdisk' so you can read the manual page. Basically you want to type p <enter> to see the listing you're going to work with, then 'setpid #" where # is the # of the partition you want to change the typecode on, which is 4 in your case, then it asks you to enter a partition id, to which you type 07 and then enter, or ? enter if you want to see the whole list of options yourself. Then use 'flag #' again where # is the partition to set the boot flag on, which in your case is 4. Then 'write <enter>' to write the new partition table to disk. Then reboot.


If you want, you can stop right before the write to disk stage, type p <enter> again, and then copy paste the whole sequence into the forum to have someone proof read it. Just let the Terminal hang out as is until you get a reply or you get bored.


If that doesn't work, testdisk should be able to scan the drive and find the actual start point of the NTFS volume, which, again, based on what you've told me, should be intact and otherwise unmodified. It might be minutes or several hours for it to find the volume though. I haven't used it so I can't really give you any tips on the usage, but it's usually effective.


If it finds it, and it's fixed and you can boot or at least get the Finder to see the BOOTCAMP volume, the first order of priority is to make a backup of everything you don't want to lose. You really should have done that from the outset, but once you've got access, do that immediately. You can figure out how to recover the missing free space on the drive later.

Jun 7, 2013 2:34 PM in response to Christopher Murphy

I have the same situation, my windows 7 partition is gone after trying to make more room for it. I don't seem to have the resizing issue that Mannsy is having.

I too tried to run a repair before coming here.

Mr. Murphy, do you have any words of wisdom for me?

disk utility log:

2013-06-07 15:50:20 -0500: Disk Utility started.


2013-06-07 15:51:14 -0500: Preparing to partition disk: “Hitachi HDT721064SLA360 Media”

2013-06-07 15:51:14 -0500: Partition Scheme: GUID Partition Table

2013-06-07 15:51:14 -0500: 2 partitions will be created

2013-06-07 15:51:14 -0500:

2013-06-07 15:51:14 -0500: Partition 1

2013-06-07 15:51:14 -0500: Name : “Macintosh HD”

2013-06-07 15:51:14 -0500: Size : 90 GB

2013-06-07 15:51:14 -0500: Filesystem : Mac OS Extended (Journaled)

2013-06-07 15:51:14 -0500: Do not erase contents

2013-06-07 15:51:14 -0500:

2013-06-07 15:51:14 -0500: Partition 2

2013-06-07 15:51:14 -0500: Name : “DISK0S3”

2013-06-07 15:51:14 -0500: Size : 352.79 GB

2013-06-07 15:51:14 -0500: Filesystem : MS-DOS (FAT)

2013-06-07 15:51:14 -0500: Do not erase contents

2013-06-07 15:51:14 -0500:

2013-06-07 15:51:14 -0500: Beginning partition operations

2013-06-07 15:51:14 -0500: Verifying disk

2013-06-07 15:52:03 -0500: Shrinking disk

2013-06-07 15:52:23 -0500: Unmounting disk

2013-06-07 15:52:24 -0500: Finishing partition modifications

2013-06-07 15:52:24 -0500: Waiting for disks to reappear

2013-06-07 15:52:24 -0500: Partition complete.

2013-06-07 15:52:24 -0500:

**********

2013-06-07 15:57:18 -0500: Disk Utility started.


2013-06-07 15:57:58 -0500: Verifying volume “Macintosh HD”

2013-06-07 15:57:58 -0500: Starting verification tool:

2013-06-07 15:58:46 -0500: Performing live verification.

2013-06-07 15:58:46 -0500: Checking Journaled HFS Plus volume.

2013-06-07 15:58:46 -0500: Checking extents overflow file.

2013-06-07 15:58:46 -0500: Checking catalog file.

2013-06-07 15:58:46 -0500: Checking multi-linked files.

2013-06-07 15:58:47 -0500: Checking catalog hierarchy.

2013-06-07 15:58:47 -0500: Checking extended attributes file.

2013-06-07 15:58:47 -0500: Checking volume bitmap.

2013-06-07 15:58:47 -0500: Checking volume information.

2013-06-07 15:58:47 -0500: The volume Macintosh HD appears to be OK.

2013-06-07 15:58:47 -0500: Repair tool completed:

2013-06-07 15:58:47 -0500:

2013-06-07 15:58:47 -0500: Verifying volume “disk0s3”

2013-06-07 15:58:47 -0500: Starting verification tool:

2013-06-07 15:58:47 -0500: ** /dev/disk0s3

2013-06-07 15:58:47 -0500: Invalid BS_jmpBoot in boot block: 534552

2013-06-07 15:58:47 -0500: Error: This disk needs to be repaired. Click Repair Disk.2013-06-07 15:58:47 -0500:

2013-06-07 15:58:47 -0500: Disk Utility stopped verifying “disk0s3”: This disk needs to be repaired. Click Repair Disk.

2013-06-07 15:58:47 -0500:


2013-06-07 16:05:53 -0500: Verify and Repair volume “disk0s3”

2013-06-07 16:05:53 -0500: Starting repair tool:

2013-06-07 16:05:53 -0500: ** /dev/disk0s3

2013-06-07 16:05:53 -0500: Invalid BS_jmpBoot in boot block: 534552

2013-06-07 16:05:53 -0500: Volume repair complete.2013-06-07 16:05:53 -0500: Updating boot support partitions for the volume as required.2013-06-07 16:05:53 -0500: 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.2013-06-07 16:05:53 -0500:

2013-06-07 16:05:53 -0500: Disk Utility stopped repairing “disk0s3”: 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.

2013-06-07 16:05:53 -0500:


terminal output


Computer-IV:~ computerIII$ sudo fdisk /dev/disk0

Password:

Disk: /dev/disk0 geometry: 77825/255/63 [1250263728 sectors]

Signature: 0xAA55

Starting Ending

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

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

1: EE 1023 254 63 - 1023 254 63 [ 1 - 409639] <Unknown ID>

2: AF 1023 254 63 - 1023 254 63 [ 409640 - 175781256] HFS+

3: 0C 1023 254 63 - 1023 254 63 [ 561219584 - 689043456] Win95 FAT32L

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

Computer-IV:~ computerIII$


Computer-IV:~ computerIII$ sudo gpt -r -v show disk0

gpt show: disk0: mediasize=640135028736; sectorsize=512; blocks=1250263728

gpt show: disk0: Suspicious MBR at sector 0

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 175781256 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC

176190896 385028688

561219584 689043456 3 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

1250263040 655

1250263695 32 Sec GPT table

1250263727 1 Sec GPT header

Jun 7, 2013 3:11 PM in response to Justin Randall

Please start a new thread and then post the URL in this thread. Otherwise it gets too complicated keeping track of whose issue is being responded to. Include the OS version, how boot camp was created step by step, confirm that you followed the Boot Camp instructions to reformat the disk NTFS from within the Windows installer, and then exactly how you later "tried to make more room for it" step by step. I'm uncertain why you're running an Apple repair utility on a Windows volume. If you have 3rd party NTFS read/write support installed, specify which one.

Aug 26, 2013 2:46 PM in response to Christopher Murphy

Hi Christopher,


I also have problems with Windows rebooting after partition resize trying to reduce Mac side and increase Windows side. I do not see the BootCamp partition labelled as such while running disk utility. 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 you ask.



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/disk0geometry: 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.


Resized partition using Disk Utility and now Windows 7 will not boot

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