2

A month or so ago, I added a new partition to my 500 GB SSD drive so I could have MacOS Mojave on a separate partition. After adding the new partition, I was left with two logical volumes that were 450GB and 50GB.

Fast forward to this evening. I went to update for the latest release and I needed more space. I added an unnamed partition and reduced the size of my 450GB partition to 400GB and I'm left with 3 logical partitions. I was thinking I'd resize the empty 50GB partition to zero and up the other 50GB partition to 100GB and I'd be on my merry way...I thought wrong. 😂🤣😂

I took a look at this article from MacWorld, but it seems to be written to address a scenario for an external drive, not an internal drive.

When I'm done, I'd like to have Macintosh HD sized to 400GB and Mojave beta sized to 100GB.

Here are my questions:

1) How do I nuke an empty partition?

2) How do I resize the Mojave beta partition from 50GB to 100GB?

enter image description here

UPDATE

Progress. I selected the Apple SSD, clicked partition, highlighted the empty partition, and clicked "-", which removed it. I still can't resize the other two partitions. Ideas are greatly appreciated.

6
  • Are you trying to partition the whole disk, or the virtual Container disks? If the former, in order to purge the extra partition you may try first unmounting the Untitled partition, and formatting the Container disk1 partition as HFS+, at which point you should be able to partition the entire disk and remove the second partition completely. As far as resizing issues go, I'm afraid I use an HDD based system, and haven't spent enough time on Mojave Beta to get acquainted with APFS's partitioning quirks. Commented Aug 14, 2018 at 3:28
  • Thanks for reading. I'm not really picky at this point...I just want one disk with 400gb and another with 100gb from a single SSD drive 😂🤣😂. I think I'm getting close to resolving this, but I've had to venture into the command line, which is a little scary (even though I've got my data backed up).
    – Adrian
    Commented Aug 14, 2018 at 3:31
  • The terminal can be a little daunting at first, but you'll find it's quite intuitive if you work with it enough. What exactly have you tried with the command line thus far? Commented Aug 14, 2018 at 4:02
  • Perhaps you could use a macOS Installer USB, or the Recovery HD. Try booting to one of those, and using the included Disk Utility to unmount Macintosh HD/Mojave beta, then resizing the Container disk0 and Container disk2. Seeing as being booted into either OS on the internal disk will stop you from unmounting its respective partition, which will in turn stop you from resizing its container partition, booting from an external disk may allow you to make the necessary modifications to the internal disk. Commented Aug 14, 2018 at 4:18
  • @AlisonE.E. I tried this sudo diskutil apfs resizeContainer disk0s2 400g jhfs+ disk0s4 75g, but I keep getting A problem occurred; undoing all changes Error: -5344: MediaKit reports not enough space on device for requested operation when it gets to the end.
    – Adrian
    Commented Aug 14, 2018 at 4:37

2 Answers 2

2

Ok, so it turns out this error -5344: MediaKit reports not enough space on device for requested operation is caused by the fact that you are trying to expand a container backward into free space that exists before it on the partition list, even though Disk Utility (and by extension diskutil) can only expand partitions forward into free space that comes after the container in the partition list. Another notable error is your attempt to resize the Physical Store partitions on which the Container disks are stored (disk0s2 and disk0s4), rather than the Container disks themselves (disk3, disk4, and disk5 in the below example).

With a bit of trial and error I was able to figure out how to effectively merge Containers 2 and 3 into one, with no data loss to Container 1. Note that this will require the deleting of the Mojave beta partition, so make sure you either have it backed up, or have an installer on hand.

UPDATE: There is a way to do this without having to reinstall the second OS. In macOS versions up to Sierra (I haven't tried it in newer) you could create directly bootable backups of your entire system with (adjusting for the disk names you gave in your question) sudo ditto -V -X --nocache /Volumes/Mojave\ beta/ /Volumes/Untitled/ NOTE: for backing up the currently booted system, subsitute /Volumes/Mojave\ beta/ with /

For posterity please make sure you have a macOS installer (USB or Recovery HD) on hand for each OS you have installed.

Please also remember that these disk lables are just the ones for my disk on my system, always double check the names are correct for yours when running these commands by comparing them with the output of diskutil apfs list

In order to replicate your situation the best I could, using Disk Utility I formatted a 4 GB flash drive as APFS. I then partitioned the disk two separate times, which resulted in three APFS Containers, and three virtual volumes, in the following order:

First Container
Container disk3 - 1.85G
Physical Store disk2s2
Volume disk3s1

Second Container
Container disk4 - 0.94G
Physical Store disk2s3
Volume disk4s1

Third Container
Container disk5 - 0.94G
Physical Store disk2s4
Volume disk5s1

I then opened a terminal, and deleted the Third Container with: diskutil apfs deleteContainer disk5, which resulted in disk2s4 being converted into an HFS+ volume.

After this I deleted the partition disk2s4, and in so doing freed up the space necessary to expand the Second Container by running diskutil eraseVolume "Free Space" "" disk2s4

At this point the partition list looked like this:

First Container
Container disk3 - 1.85G
Physical Store disk2s2
Volume disk3s1

Second Container
Container disk4 - 0.94G
Physical Store disk2s3
Volume disk4s1

Free Space - 0.94G

Finally I was able to expand the Second Container to 1.85 GB with diskutil apfs resizeContainer disk4 1.85G. The final result of this is two APFS Container disks of equal value on the flash drive:

First Container
Container disk3 - 1.85G
Physical Store disk2s2
Volume disk3s1

Second Container
Container disk4 - 1.85G
Physical Store disk2s3
Volume disk4s1

Besides adjusting the commands so that the disk labels match those on your own machine, the one notable substitution you should make is changing 1.85G to 100G in the final command. Beyond that this should be all you need to make the conversion requested.

2
  • Thank you! Going forward, I'm not going to partition any disk to a size smaller than 100GB :)
    – Adrian
    Commented Aug 14, 2018 at 23:32
  • @Adrian Happy to help. Generally, one should stick to Disk Utility's Add/Remove APFS Volume feature. As David Anderson said below, this would also be ideal for dual booting stable and beta copies of the OS on an APFS disk, since it would produce an environment where both OSes are able to access (up to) all 500GB of space on the disk, while keeping their directory structures isolated to avoid breaking the system. Commented Aug 15, 2018 at 1:24
1

You do not need a separate container for Mojava. Apple created APFS was so one would not have to resize partitions. You can just add a new APFS volume to the same container as your existing macOS and install Mojava in this volume.

See APFS - Is it possible to install 2 macOS versions inside one APFS container?

Note: I have noticed the Disk Utility can display the wrong information about a drive after performing a partition operation. You may need to relaunch the Disk Utility and/or restart your Mac to correct this problem.

If you want to proceed with two AFPS containers, you will need to do the following:

  1. Open the Disk Utility application and remove all APFS containers except the original. This container should contain virtually all the drive space.
  2. Create a new APFS partition with the size of 100 GB.

You can also use the Terminal application to enter commands. This is usually safer than using the Disk Utility. I would post the commands, but I would need the output from diskutil list after your Mac is restarted.

You must log in to answer this question.

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