While the graphical Disk Utility app in macOS provides a straightforward “First Aid” button to diagnose file systems, it typically evaluates volumes and APFS containers rather than lower-level drive geometry. When an external SSD, backup drive, or internal drive encounters boot failures, unmountable container errors, or partition table corruptions, checking individual volumes is insufficient. You must verify the integrity of the underlying partition map itself.
In macOS Terminal, the diskutil subsystem includes two specialized commands: verifyDisk and repairDisk. These tools inspect the physical GUID Partition Table (GPT), validate secondary GPT backup headers, check EFI system partition alignment, and repair corrupted partition boundaries.
Understanding verifyDisk vs verifyVolume
Understanding where these diagnostic commands operate within the storage hierarchy is essential:
- verifyVolume: Inspects the file system metadata (APFS or HFS+) of a specific logical volume or container (e.g.,
/dev/disk3s1). It verifies directory nodes, extent records, and snapshot trees. - verifyDisk: Targets the raw physical drive identifier (e.g.,
/dev/disk3). It validates the Master Boot Record (MBR) protective scheme, primary GPT header at LBA 1, partition array allocations, EFI system partitions, and the backup GPT header located at the final sectors of the physical disk.
Identifying Your Disk Identifier
Before executing disk repairs, you must determine the exact identifier assigned by macOS:
diskutil list
Review the output to locate your target drive. Identify the whole-disk node corresponding to the physical hardware (e.g., /dev/disk2 or /dev/disk4), rather than a slice (such as disk2s1).
Verifying Partition Map Integrity
To inspect the partition map non-destructively without making modifications to the disk, run:
diskutil verifyDisk /dev/diskN
(Replace /dev/diskN with your actual target identifier, such as /dev/disk2.)
During the verification sequence, macOS performs several checks:
- Checks the protective MBR sector.
- Validates the primary GPT header CRC32 checksum.
- Verifies partition boundary alignments and sector overlapping.
- Compares the primary GPT partition array with the backup GPT array at the end of the physical media.
If all checks pass, Terminal returns: The partition map appears to be OK.
Repairing Partition Maps with repairDisk
If verifyDisk detects misaligned partition boundaries, corrupted secondary GPT tables, or invalid EFI headers, use repairDisk to repair the partition scheme:
diskutil repairDisk /dev/diskN
Keep the following operational considerations in mind when running repairDisk:
- Administrative Privileges: Modifying raw drive sectors requires root authorization. Terminal may prompt you for your macOS account password.
- Confirmation Prompt: Because modifying partition headers can affect volume visibility if executed on the wrong device,
repairDiskoutputs a confirmation prompt:
TypeRepairing the partition map might erase diskN and will wipe out all volumes if something goes wrong. Continue? (y/N)yand press Enter to proceed. - Automatic Unmounting:
diskutilwill attempt to cleanly unmount all mounted child volumes on the target drive before writing updated GPT headers.
Command Reference and Troubleshooting Options
The table below summarizes essential partition map diagnostic workflows:
| Command | Target Level | Expected Recovery Scenario |
|---|---|---|
diskutil verifyDisk diskN |
Whole Physical Disk | Non-destructive diagnostic to check GPT and EFI partition tables. |
diskutil repairDisk diskN |
Whole Physical Disk | Rebuilds damaged secondary GPT headers and resolves partition boundary overlaps. |
diskutil verifyVolume diskNsM |
Specific Slice/Volume | Validates internal APFS container or HFS+ directory catalog b-trees. |
diskutil repairVolume diskNsM |
Specific Slice/Volume | Executes fsck_apfs or fsck_hfs to repair volume file systems. |
Frequently Asked Questions
Can I run repairDisk on my internal startup drive (Macintosh HD)?
On modern macOS systems with Signed System Volumes (SSV), running repairDisk on the active startup disk will be rejected by the kernel while the operating system is booted. To repair the internal physical partition table, boot into macOS Recovery (hold Cmd + R on Intel Macs or press and hold the Power button on Apple Silicon Macs) and open Terminal from the Utilities menu.
What should I do if repairDisk fails with “Resource busy”?
This indicates an application or background process is actively accessing a file on the disk. Unmount all child volumes manually first using diskutil unmountDisk force /dev/diskN before re-running repairDisk.