osx - Cannot resize OS X partition

07
2014-07
  • David Pearce

    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?

  • Answers
  • Timothy Walters

    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).

  • mdonoughe

    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.

  • jweede

    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.

  • Journeyman Geek

    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

  • Sickest

    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.


  • Related Question

    linux - shrinking an hfs+ partition
  • cobbal

    I have a GPT partitioned disk with 2 HFS+ partitions. I am trying to shrink the first partition.

    things I have tried so far:

    1. use Disk Utility.app
      error: "The partition cannot be resized. Try reducing the amount of change in the size of the partition"
    2. use gparted from a knoppix live cd
      fsck (called by gparted) fails because while gparted can see the multiple partitions, there is no file /dev/sda2.

    Any suggestions?


  • Related Answers
  • fideli

    The issue is that the data is spread across the partition with the free space required to shrink it located in between data. There are a couple options (at least):

    1. iPartition by Coriolis Systems. Works flawlessly. It comes with a Lite version of their iDefrag, which can compact the data and move the free space to the end of the drive. I never tried gparted but I didn't see any positive results online using it for HFS+ on Macs. Not free.

    2. Clone the drive onto an external or something, and then clone it back to the original. I've never tried this but I've read that it basically puts all the data at the beginning of the partition, allowing you to use Disk Utility to shrink it.

  • Tom Freudenberg

    Hey, it seems to be an overflow in the journal space. So if you want to shrink your device and you got this error, you can disableJournal once and enable it right afterwards.

    If the verifyVolume is successfull, you can resizeVolume to the new Value.

    If you need to repair your Volume, you should use your MAC DVD and boot installation and JUST CHECK the device from that point

    Greetings and good luck