Diskutil: list, verify and repair disks
The essential commands to inspect volumes.
- List disks and partitions:
diskutil list
- See APFS containers and volumes:
diskutil apfs list
- Verify the startup volume:
diskutil verifyVolume /
- To repair the startup disk, restart in Recovery Mode and run "First Aid" in Disk Utility.
- Eject an external disk cleanly:
diskutil eject /dev/disk4
⚠️ Never use diskutil eraseDisk or eraseVolume without checking the disk identifier with diskutil list.