Written byAmanda Wong
How To Merge APFS Containers/Partitions to Get More Space
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.
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.
Table of Contents:
- 1. If you use Multiple volumes in APFS containers
- 2. Why you need to merge APFS containers
- 3. Steps to merge APFS containers on Mac
- 4. FAQs about merging APFS containers
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.
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:
- Boot Mac in macOS. Restart the Mac and hold down the Option key, release the key and choose macOS from the boot menu.
- Quit all open applications and log out any other users.
- Launch Boot Camp Assistant with Spotlight Search.
- Click Continue when the Boot Camp Assistant introduction appears.
- If the Select Tasks step appears, select Remove Windows 10 or later version, then click Continue.
- 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.
- Enter the admin account password if asked to start the process.
- When the process completes, it says Partition Removed.
If it fails, you can try Terminal to delete the Windows container/partition from your Mac:
- Head to Finder > Applications > Utilities > Terminal, the launch this tool.
- Enter the following command:diskutil list
- Then it displays a list of disks and partitions: sudo diskutil eraseVolume JHFS+ deleteme /dev/disk0s3
- Find the name of the Windows partition that you want to remove. It locates under the 'IDENTIFIER' column.
- Replace disk0s3 with the name of the Boot Camp partition.
- 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:
- Open Disk Utility from Mac Launchpad.
- Tap on the View button and select Show All Devices.
- Select a volume in the sidebar, then click the Partition button.
- In the pie chart, choose the partition you want to delete, then click the Delete(-) button.
- Click the Apply button to delete the selected partition.
- Read the information in the Partition Device dialogue, then click Partition.
- 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!
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.
FAQs about merging APFS containers
Depending on your case, you can choose to use Boot Camp Assistant to remove a Windows container or delete the second container in the Disk Utility tool. The data of the deleted partition will be cleared, you can back up your important files in advance.
Launch Disk Utility.
Click the View icon and select Show All Devices.
Identify the volume you want to delete and mount it if necessary.
Control-click the entry and select Delete APFS Volume.
Click Delete to confirm.
Either the removed Windows partition or the deleted second APFS container will lose all data on it. And the main container you want to merge disk space to keep intact. To avoid data loss, you need to back up the container/partition you want to remove. If there is no backup available to get lost data back, try iBoysoft Data Recovery to recover data as soon as possible.