Home > How to Tips

How To Merge APFS Containers/Partitions to Get More Space

Updated on Tuesday, December 10, 2024

iBoysoft author Amanda Wong

Written by

Amanda Wong
Professional tech editor

Approved by

Jessica Shee

English

Summary: If you have multiple APFS containers or partitions, you can merge the empty/unwanted one to the main container to get a full disk space. This post guides you to merge APFS containers step by step.

merge apfs container

Partitioning a Mac hard drive enables you to install different operating systems on separate partitions and even dual boot two versions of macOS. However, it also splits the disk space into parts and limits the storage space of each partition with a fixed allocated size. 

Perhaps, one APFS container is going to run out of storage space and you get the error message "Your disk is almost full" while another container has a lot of free space available. Then you may want to enlarge the capacity of the main container on the Mac hard drive. 

Or, you just don't need a certain container anymore, maybe a Bootcamp partition, and want to merge it to your main container. You are covered in this post. Let's see how to merge APFS containers/partitions on Mac.

Click the button below to share it with others who need to merge APFS containers on Mac.

 

If you use Multiple volumes in APFS containers

The concept of the container comes with APFS, a file system deployed and developed by Apple Inc. The container is different from the previous partition used on macOS Sierra and earlier. It is a logical construct of digital space, your Mac hard drive. 

By default, the built-in startup disk has one APFS container which contains two volumes, namely Macintosh HD and Macintosh HD -Data. And you can add APFS volumes to the container, and even add APFS containers.

One of the highlights of APFS is the space sharing feature, all the volumes within an APFS container share the free space from the main drive when needed, it automatically grabs space from other APFS volumes/containers or shrinks it. Therefore, you don't need to merge APFS volumes within an APFS container to get more space.

mutiple apfs volume

Why you need to merge APFS containers

With the advent of APFS on macOS 10.13, it automatically converts HFS+ to APFS when upgrading macOS to High Sierra and later on SSD hard drive. And the Partition button is also available in Disk Utility. It allows to partition the hard drive into two or more containers and allocates a portion of the storage space of the disk to them. 

It is recommended to use volumes instead of partitions on macOS High Sierra and later. But you may still want to partition the APFS hard drive into multiple containers/partitions for some reasons, such as installing Windows on another container/partition, separating your work and private files, sharing Photo Library with ease, etc. 

But once the main partition, usually the startup partition, has less free space to use, it needs to enlarge the partition by merging APFS containers to guarantee the fluent performance of your Mac. Otherwise, the Mac may run slowly, get stuck, or undergo some other issues. 

Unlike APFS volumes, a partition can not share the free space with others. That's why you need to merge two or more containers so that you can get more disk space for the main container/partition to use. Now, we can move to the next part to see the detailed steps.

If you think this post is informative and helpful, share it on your social media with the button below.

 

Steps to merge APFS containers on Mac

Depending on different scenarios, the steps to merge APFS containers vary. If you have created a Bootcamp partition via the Boot Camp Assistant, you should remove it with Boot Camp Assistant as Apple suggested. For other macOS partitions, you just need to delete them to reclaim storage space.

Remove Bootcamp partition using Boot Camp Assistant

Boot Camp Assistant enables Mac users to run Windows on Intel Mac running macOS Catalina and earlier. You can also use this tool to remove a BootCamp partition used for Mac. Here's how:

  1. Boot Mac in macOS. Restart the Mac and hold down the Option key, release the key and choose macOS from the boot menu.
  2. Quit all open applications and log out any other users.
  3. Launch Boot Camp Assistant with Spotlight Search.
  4. Click Continue when the Boot Camp Assistant introduction appears.
  5. If the Select Tasks step appears, select Remove Windows 10 or later version, then click Continue.
  6. If there is a single internal disk, click the Restore button. If there are multiple internal disks, select the Windows disk, select Restore disk to a single macOS partition, then click Continue
    remove bootcamp partition 
     
  7. Enter the admin account password if asked to start the process.
  8. When the process completes, it says Partition Removed.

If it fails, you can try Terminal to delete the Windows container/partition from your Mac:

  1. Head to Finder > Applications > Utilities > Terminal, the launch this tool.
  2. Enter the following command:diskutil list
  3. Then it displays a list of disks and partitions:sudo diskutil eraseVolume JHFS+ deleteme /dev/disk0s3
  4. Find the name of the Windows partition that you want to remove. It locates under the 'IDENTIFIER' column.
  5. Replace disk0s3 with the name of the Boot Camp partition.
  6. Enter the password and click Action to delete it.

You can check whether you have successfully removed the BootCamp partition by viewing the sidebar of Mac Finder or that of the Disk Utility. 

Delete APFS containers/partitions to merge disk space

If you want to merge two or more APFS containers to get more storage space for a certain container, you need to delete unneeded partitions in Disk Utility. This action will delete all the files stored on the partition you attempt to remove. Therefore, you can create a backup of the partition to retrieve data later. 

To enlarge a partition, you can only delete the partition that comes after it on the device, and the last added container/partition can not be enlarged. Follow the steps below to merge APFS containers:

  1. Open Disk Utility from Mac Launchpad.
  2. Tap on the View button and select Show All Devices.
  3. Select a volume in the sidebar, then click the Partition button.
  4. In the pie chart, choose the partition you want to delete, then click the Delete(-) button.merge apfs container
  5. Click the Apply button to delete the selected partition.
  6. Read the information in the Partition Device dialogue, then click Partition.
  7. After the operation finishes, click Done.

Now, the space of the deleted partition will restore to your main container. But some Mac users reported that they failed to delete APFS containers/partitions and can't merge the unused space to the main APFS container. If so, the last resort is to format the whole drive and reinstall macOS, but it erases all the data on the drive. 

If the steps above help you merge APFS containers, you can share it with more people!

 

Conclusion

After reading this post, you know how to merge APFS containers on Mac. If you are using multiple volumes in a single APFS container, you don't need to merge them volumes given that they can share the unused space from the main drive. For a Windows partition, you can remove it with Boot Camp Assistant. For other format partitions, you should delete them to merge the space to your main container. 

People Also Ask

Read More Questions