Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

My hard drive is split in three visible partitions: System, Data and Backup.
I'd like to merge System (OS X Lion) and Data into one partition without data loss.

Disk Utility won't let me resize the system partition:

partitions in disk utility

That's my complete setup:

enter image description here

Apparently, I can't use mergePartitions because diskutil man says:

mergePartitions [force] format name fromDevice toDevice

Merge two or more partitions on a disk.
All data on merged partitions other than the first will be lost.

I can imagine decreasing Data size, creating a New partition, moving all files from Data to New and proceeding with mergePartitions, thus merging System and Data into System+Data. Then I probably can move stuff from New to the merged System+Data partition and merge them all.

However I'm unsure what will happen to Recovery HD that stands between System and Data. Will it get erased? If so, how can I restore it?

share|improve this question

3 Answers 3

up vote 4 down vote accepted

There is absolutely no way that you should even think about doing any of this without a complete backup on a separate disk. Verify the backup before beginning.

1) If you have a complete backup, the easiest way to do this would be to wipe everything, make the partitions you want, and then copy the information back from your backup. If your Recovery HD is deleted, there is no way to re-create it without reinstalling the OS. (At least none that I could find when I was searching recently.)

2) Assuming you have a backup OTHER than that Backup partition, if you want to attempt to merge these, I would try it in this order:

a. Delete the 'Backup' partition.

b. Merge 'Data' partition and former 'Backup' partition.

c. Merge System partition and other partition.

d. Re-create the 'Backup' partition and restore it from whatever backup you have.

I have done several live-system partition resizings with no problems. However, the one time that there was a problem, I had to reformat the entire drive and start over.

share|improve this answer

I marked TJ Luoma's answer as correct since his approach looks cleaner, however I decided to take a risk and do a live resizing. In case this might help someone plan their own steps, I leave here a list of my actions. They may not be most rational or correct but they worked for me.

THIS IS TERRIBLY DANGEROUS IF YOU DON'T HAVE A VERIFIED, FULL BACKUP.

No, really. You can lose all your data, including the system. Don't do it.
And this will work only if Data partition is less than 45% full.
And I'm not even sure this will work for you anyway.

You have been warned.


My steps were as follows:

  1. Boot into Recovery HD loader by pressing R during the boot.
  2. Open Disk Utility, select my HDD and open Partition tab.
  3. System partition now has a resize grip. However it is “blocked” by Data partition that comes right after it. I don't have much information on Data so I split it equally in two partitions—let's call them Data A and Data B. Data A is large enough to fit everything Data contained. Data B is empty.

  4. Click Apply

  5. Select the disk (the first root item in left pane), open First Aid tab and click Verify Disk. Wait for the verification to end.

  6. Now we want to move everything from Data A to Data B. I selected Data A in the left pane, clicked Restore tab and dragged Data B to the Destination field. Source is A, destination is B.

  7. Click Restore and wait for Data A to be copied into Data B.

  8. Again, select the disk (the first root item in left pane), open First Aid tab and click Verify Disk. Wait for the verification to end.

  9. Now you have two identical partitions, Data A and Data B. The first one prevents System from resizing. Open Partition tab, select Data A and click the minus glyph (it may not be visible so I included an image—it's just below the list).

    enter image description here

  10. Select the disk (the first root item in left pane), open First Aid tab and click Verify Disk. Wait for the verification to end.

  11. Go to Partition tab and resize System so it takes space that was previously owned by Data A and now is unallocated. Click Apply.

  12. Select the disk (the first root item in left pane), open First Aid tab and click Verify Disk. Wait for the verification to end.

  13. Rename Data B to just Data so your volume name doesn't change.

  14. Quit Disk Utility and boot into OS X.

  15. Copy whatever data you need from Data to System (it has enough space now).

  16. Check you really copied the files you need.

  17. Check again.

  18. Are you sure?!

  19. Open Disk Utility in OS X, remove Data and resize System.

  20. I wish you the best of luck.

share|improve this answer

You don't need to merge them.

You can resize partitions right?

Do such a socoban:

  1. Make a backup
  2. Shrink 'Data' partition (leave just a couple gigabytes free).
  3. Enlarge 'Backup' partition so you can put stuff from 'Data' somewhere (at least temporary).
  4. Put everything from 'Data' in some folder on 'Backup'
  5. Make sure that 'Data' is empty and delete it.
  6. Now you must have a lot of free space between 'System' and 'Backup' so you can grow 'System' partition or redistribute space between them as you like :)
share|improve this answer
    
This will not work because a partition's start position is fixed. Shrinking Data partition still wouldn't let me resize the Backup partition “upwards” as it would involve moving the data (which Disk Utility apparently cannot do). However I could shrink Data partition and use unallocated space for that, which I did. –  Dan Apr 1 '12 at 21:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.