14

I am trying to resize my existing Mac OS Extended partition on my Macbook to install Windows 7 (using steps similar to these), but when ever I go to apply the changes, I get this error:

alt

Partition failed

Partition failed with the error:
The partition cannot be resized. Try reducing the amount of change in the size of the partition.

The total capacity of the hard drive in question is 260GB, with the entirety being taken up by the OS X boot partition. There is I am aiming to shrink that partition down to 60GB.

How can I fix this problem? I have been reducing the amount of change by 10GB each attempt, but it still is not working. I assume the problem is that there is not a large amount of continuous space on the device. Is there some way to can do a manual defrag that would rectify this problem?

Josh Hunt
  • 21,369

6 Answers6

15

Super question necromancy since I couldn't find the answer to this anywhere.

When resizing your HFS+ partition fails, there should be a log entry similar to: hfs_reclaimspace: Error reclaiming datafork blocks of fileid=<inode> created in the "All Messages" section of Console.app. find -x / -inum <inode> will tell you which file prevented the resize.

Knowing what file caused the problem allows you to delete that file or move it to another disk and move it back or something, allowing you to complete your resize without reformatting or purchasing a defragmentation program.

I had to do this twice(only two problem files) before my resize completed. I've only tested this with the diskutil command for resizing, but it should be the same with Disk Utility.app because the message comes from the kernel.

mdonoughe
  • 311
11

I had this exact same issue, OS X couldn't move the files to allow the partition to be resized. I went and got Coriolis iDefrag, it created a boot DVD with iDefrag on it that allowed it to do the job perfectly.

It's worth noting that for normal use of a Mac you never need to defrag, since files are defragged on-the-fly, but in this case we're wanting to defrag the free space, including some files that are 'locked'.

As always it's a good idea to backup your data first.

I was able to partition as much as I liked for Boot Camp once iDefrag was done (before it wouldn't even let me do 5Gb, afterwards I did a 100Gb partition).

1

Finally figured this nonsense out. Unfortunately it is destructive.

  1. Reboot to recovery
  2. Choose disk utility
  3. Try to resize - it will probably now show an error it did not show in macOS - which is that the partition is not journaled
  4. First aid on the Macintosh HD partition (or equivalent)
  5. Follow steps to enable journaling (File >> Enable Journaling - If it's grayed out, you're selecting the wrong disk/partition - select another and try again)
  6. It will probably not look like anything occurred (and indeed I don't think anything has)
  7. Now open "Partition" and you'll see the drive shows the "OS X Extended (Journaled)
  8. Click into the text box next to "Partition" and the Apply button should now become clickable
  9. Click apply
  10. Now you will be able to resize your partitions from here on without trouble
Slbox
  • 111
  • 5
1

this is a simple to deal with the partition failed error

  1. You need to reboot your mac into single user mode. In order to do this, you need to hold press -S

  2. You then need to run fsck - which checks your drive. Run `/sbin/fsck -fv' the f is for force and the v for verbose.

  3. reboot the system to get out of single user mode - with exit or reboot

  4. verify the disk from disk utility, then partition the disk again

source

Journeyman Geek
  • 133,878
sagar
  • 11
1

In some cases a problem like this can be caused by bad system-volume information. Try using a utility like Disk Warrior to make sure your HFS+ volume has all of its values set correctly. Short of that, you could try using the Disk Utility from your OS X install disk instead of trying to resize the partition while booted from it.

jweede
  • 6,933
0

I have the same issue. Here is how I resolved it (without buying iDefrag).

  1. Try repairing the disk:

    a. boot into the recovery disk (hold Alt key after restart) and get into Disk utility

    b. try repair disk, it might fail because of some mismatched counts (it'd ask you to reformat your disk). c. before you follow that advice, try repair the disk again (I did this after another restart). The 2nd time, it worked!!

  2. Then I tried resizing the partition from the recovery disk, it would failed at "unmounting the disk" or something. Reboot into your main disk (where your os is).

  3. Resize the partition again, this time it worked for me.