Tutorial 11 · macOS

Disk Utility, APFS volumes and freeing storage

Understand APFS containers and volumes, repair disks with First Aid, format external drives, and find what's using your space.

Last updated

Modern Macs use APFS. A disk holds an APFS container, and the container holds volumes that share its free space. Your startup disk is a read-only, signed system volume plus a Data volume holding your files.

1Look at your disks

Open Disk Utility (Applications > Utilities) and choose View > Show All Devices to see disks, containers and volumes.

diskutil list
diskutil apfs list
diskutil info /

2Run First Aid

Select a volume, then click First Aid. Check the volumes first, then the container, then the disk. You can check the startup disk while running; for repairs that need it unmounted, use Disk Utility in macOS Recovery.

diskutil verifyVolume /

3Add a volume or format a drive

To add a volume, select a container and click + (Add APFS Volume). It shares free space, and you can set a reserve or quota.

To format an external drive, select the disk (not the volume) and click Erase. Choose APFS for Mac-only drives, or ExFAT if it must work with Windows too. Erasing destroys everything on the drive.

# erase disk4 as APFS (check the number with diskutil list first!)
diskutil eraseDisk APFS Backup disk4

4Free up storage

Go to System Settings > General > Storage to see what's using space, with recommendations such as Store in iCloud, Optimise Storage and Empty Bin Automatically. The info buttons let you review large files, apps and documents.

du -sh ~/* 2>/dev/null | sort -h      # biggest folders in your home
du -sh ~/Library/Caches
tmutil listlocalsnapshots /

Local Time Machine snapshots and purgeable space are freed automatically when needed, so a nearly full disk is often less full than it looks. Don't delete files inside ~/Library unless you know what they are.

← All macOS tutorials