MainspringGuides › diskutil basics
macOS Guide

diskutil on Mac: List, Mount, and Inspect Drives

Updated July 2026 · 3 min read

diskutil is the command-line face of Disk Utility, and it often works when the app doesn't: it can list every attached device, force a stubborn volume to unmount, and explain exactly how your APFS storage is laid out. Here are the subcommands worth knowing — and the ones to treat with respect.

Map your disks with diskutil list

Start here, always:

# every disk and volume the Mac can see
diskutil list

The output shows devices as disk0, disk3, and so on, with numbered slices like disk3s1 — those identifiers are how every other subcommand targets a disk. On a modern Mac you'll see the physical internal drive (often disk0), then a synthesized APFS disk holding your actual volumes — Macintosh HD, Data, Preboot. That's normal: APFS puts multiple volumes in one shared-space container, and the synthesized entry is that container's contents. External drives appear with (external, physical) after their identifier.

Mount and unmount volumes

When Finder claims a disk "couldn't be ejected because it's in use," or an external volume attaches but never appears, these do the job:

# unmount one volume (by mount point or identifier)
diskutil unmount /Volumes/Backup

# undo: mount it again
diskutil mount disk4s2

# unmount every volume on a disk, then eject the device
diskutil unmountDisk disk4
diskutil eject disk4

Unmount and mount are a clean pair — nothing is changed on the disk, so remounting fully reverses the operation. If a plain unmount fails because some process has a file open, diskutil unmountDisk force disk4 will do it anyway; save your work first, since whatever was using the volume loses access mid-operation. After eject, the device is powered down and safe to unplug — to get it back, unplug and reconnect it.

Inspect a disk in detail

# everything about one volume: filesystem, size, SMART status
diskutil info disk3s1

# the full APFS picture: containers, volumes, space sharing
diskutil apfs list

diskutil info answers the questions Finder's Get Info won't: whether a drive is encrypted, its exact partition scheme, whether SMART reports it as verified. diskutil apfs list shows how much of a container each volume is using — the fastest way to understand why "available" space differs between volumes that share a container. Both commands are read-only.

diskutil verifyVolume /Volumes/Backup checks a filesystem without touching it; if it reports problems, run First Aid from Disk Utility (or diskutil repairVolume) with a backup in place.

The commands to treat with respect

diskutil also contains eraseDisk, eraseVolume, and partitionDisk. They do exactly what they say, immediately, with no Trash and no confirmation dialog beyond the command itself. Two rules keep you safe:

For erasing and partitioning, the Disk Utility app shows you what you're about to destroy — for those jobs, the GUI's friction is a feature.

One genuinely safe write operation worth knowing: renaming. diskutil rename "Backup" "Archive-2026" changes a volume's label and nothing else — the undo is renaming it back. And if you're preparing to format a drive elsewhere, diskutil listFilesystems shows every filesystem this Mac can create, with the exact names other subcommands expect. Neither touches data — but as always with diskutil, read the arguments twice before pressing Return.

Reversible beats forceful

The best tweaks are the ones you can take back. Mainspring turns 90+ hidden macOS settings into labelled toggles — every one reversible with the same click that set it.

Try Mainspring free →

Signed & notarized by Apple · 1-day free trial · $29 once

When the disk is fine but full

If your problem is space rather than mounting, start with checking what's using your disk before reaching for any erase command.