osx - Mac OS X 10.4: Non-destructively enlarge HFS+ partition

07
2014-07
  • elcelista

    I have a MacBook running OS X 10.4.11. Some time ago I shrank my main hard disk partition in order to dual-boot with Linux, but now I am running out of space on the Macintosh partition, and I would like to remove the Linux partition and restore the Macintosh partition to its original size. I have been able to remove the Linux partition, but I cannot seem to merge the free space back into the Macintosh partition. Originally I used GParted to shrink the partition, but I cannot use GParted to restore the partition because GParted is unable to enlarge HFS+ partitions.

    Does anyone know how I can restore my HFS+ partition to its original size without losing my data or spending money on a commercial product?

    If I attempt to use diskutil to resize the partition (while booted from the OS X installation DVD), I get the following:

    # diskutil resizeVolume disk0s2 119690149888B
    Started resizing on disk disk0s2 Macintosh HD
    Verifying
    Resizing encountered error No space left on device (28) on disk

    The 119690149888 bytes value was listed as the maximum size in the output of the command diskutil resizeVolume disk0s2 limits.

    I found other instructions for what I want to do at http://wiki.onmac.net/index.php/Triple_Boot_via_BootCamp#Restoring_your_Mac_to_its_original_state, but this requires Boot Camp, which is no longer available for OS X 10.4.

    (This is almost the same problem as question 50317 "Resize HFS Partition", but on Mac OS X 10.4 the Disk Utility application cannot resize partitions non-destructively. When I attempt to re-partition it warns that all data will be lost.)

  • Answers
  • Chris Johnsen

    Can GParted rewrite the partition map (delete the linux partition and then resize the remaining HFS+ partition) without trying to enlarge the HFS+ filesystem? If so you might then be able to use diskutil to enlarge the HFS+ filesystem to fit the bounds of the newly grown partition.

    Before trying this (or even using any of the commercial software), you should make sure you have a full backup (that way you can just destructively redo the partition with Disk Utility and restore from your backup—plus get a ‘free’ defrag for your troubles).


  • Related Question

    osx - Can I remove a Boot Camp partition from my MacBook?
  • Greg Hewgill

    A couple of years ago, I installed the Boot Camp beta on OS X, reserved 20 GB for Windows XP, and installed an XP in that partition. Since then, the Boot Camp beta expired and I used Parallels to run the XP in a VM from that partition. Now I want that 20 GB back.

    I'm not terribly worried about the contents of the XP installation on that partition (I can just back up the data elsewhere), but if I can preserve it in a VM that would be a bonus. I would like to remove that partition and resize the OS X partition to occupy the full drive.

    What's the proper way to do this?


  • Related Answers
  • Diago

    Run the Boot Camp assistant and it will automatically start the removal process after some prompts.

    You will need to use something like VMWare Converter to create a VM first if you want to keep the Windows Installation. You can then convert this to a Parallels VM.

  • Jasarien

    You can use the Bootcamp Assistant (found in /Applications/Utilities) to restore your drive back to one partition.

  • Damien

    Important thing to consider here is that there is a bug with Bootcamp that typically means that after you have removed a partition it has a hard time being able to do a new one and requires a fresh install of OSX should you ever wish to readd it at a later date!

  • Lance

    Open Disk Utility. Select the Windows partition. Choose the "Erase" tab. Change the format to "Mac OS Extended (journaled)". Click the "Erase" button. Wait. When it is done, choose the "Partition" tab. Move the dividing line to the end (probably will be the bottom) of the graph. Click to apply.