0

I just had my first attempt with diskutil mergePartitions - it was on a backup disk and I ended up loosing all partitions in between :p

Having learnt from my mistake that mergePartitions merges from the first partition to ALL IN BETWEEN up to the last - how can i move partitions so that they are in sequence.

So for example, say I have:

mergeThis   disk0s1
leaveAlone  disk0s2
leaveAlone  disk0s3
withThis    disk0s4

I want to merge disk0s1 with disk0s4, so how do I get to the following stage, before I can run the merge command

mergeThis   disk0s1
withThis    disk0s2
leaveAlone  disk0s3
leaveAlone  disk0s4

Any help would be appreciated.

1

Though you can't move the partitions, you will be able to merge both partitions. You have to convert disk0s1 to a CoreStorage Logical Volume Group, then add disk0s4 as a second CS Physical Volume to the existing CS LVG and expand the Logical Volume in the existing CS LVG to the expanded CS LVG. CS is available in older OS X versions but adding PV to existing LVG is only working reliably in OS X 10.9 and newer.

mergeThis   disk0s1
leaveAlone  disk0s2
leaveAlone  disk0s3
withThis    disk0s4

mergeThis   disk0s1 > LVG' > PV1 (disk0s1) > LVF' > LV' (disk1)
leaveAlone  disk0s2
leaveAlone  disk0s3
withThis    disk0s4

mergeThis   disk0s1 > LVG > PV1 (disk0s1) > LVF' > LV' (disk1)
leaveAlone  disk0s2
leaveAlone  disk0s3
withThis    disk0s4 > LVG > PV2 (disk0s4)

mergeThis   disk0s1 > LVG > PV1 (disk0s1) > LVF > LV (disk1)
leaveAlone  disk0s2
leaveAlone  disk0s3
withThis    disk0s4 > LVG > PV2 (disk0s4) > LVF > LV (disk1)

The content of disk0s4 will be erased. The content of disk0s1 will be preserved as disk1 and disk1 has finally the ~size of disk0s1 + disk0s4.


CoreStorage is a logical volume manager, which is an additional layer between device/partition and a volume.

A Logical Volume Group is based on one or several Physical Volumes (which can be one or several physical devices/partitions) and may contain one or several Logical Volume Families/Logical Volumes.

In OS X it's usually used to manage FileVault and Fusion Drives,

0

Unfortunately what you are trying to accomplish is not actually possible. Live partitioning a drive works to create a partition, but not to move one.

If you think of it like a piece of paper that you've drawn 3 horizontal lines on in random places - effectively creating 4 non-equal spaces - you can erase a line in between two of the adjacent ones and have one larger space again. What you're trying to do is cut along the two outer lines surrounding one of the spaces, and then try to move it into a space that 1) is already occupied by another space and 2) is highly unlikely to be the exact same size therefore would not fit correctly. Throw in the fact that the main partition is in one format (Mac OS Extended Journaled) and the other partitions likely are not, and it gets even messier.

I apologize if that was hard to follow, but it's the only way I know how to explain it without getting into the mechanics of what really happens when you hit the 'Erase' button in a Disk Utility tool.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .