As an Amazon Associate I earn from qualifying purchases @AMAZON
How to Verify All Mounted Volumes
This tip presumes the reader is comfortable with using the command line in Terminal, including the use of commands like 'cd', 'ls', 'sudo', etc.
A workstation used for serious work will generally have at least three volumes:
- Boot volume.
- Master volume.
- Time Machine.
- Catalogs (e.g., a dedicated volume for Lightroom catalogs on a fast SSD).
- Additional volumes such as backups.
My main Mac Pro has the following volumes:
Archive1, ArchiveP, Boot.int, BootClone, Master, MasterClone, Scratch, Work, a.Boot, b.Boot, diglloyd, tm, xfer.Archive1, xfer.ArchiveP, xfer.Boot, xfer.Master
The issue
It’s a good idea to verify volumes regularly to check for file system damage, especially prior to making important backups. While rare, file system damage is one way to lose data.
But with two or more volumes, it can be tedious to click on each one in Apple’s Disk Utility to verify, waiting for completion.
Verifying all volumes with a command line script
It is possible to verify the file system on all mounted volumes using one command line (walk away and have some coffee, or just continue work on something else).
Save these scripts in order to run them (“verifyVolumes.sh” or similar), you’ll also need to make them executable.
Verifying all mounted volumes
This shell script collects all volume names, then verifies each in turn.
#!/bin/bash # ©2013 DIGLLOYD INC / MacPerformanceGuide.com # echo "Verifying the file system on all mounted volumes..." for volume in $(ls /Volumes | sort) do echo "Volume: $volume" diskutil verifyVolume $volume echo "" done
Verifying specific volumes
This shell script verifies an explicit list of volumes in the volumesToVerify variable as shown. Simply modify the list of volume names to suit your own system.
#!/bin/bash # ©2013 DIGLLOYD INC / MacPerformanceGuide.com # volumesToVerify="Boot Master Archive1 ArchiveP BootClone MasterClone" echo "Verifying the file system on $volumesToVerify" for volume in ${volumesToVerify} do echo "Volume: $volume" diskutil verifyVolume $volume echo "" done
Example output
Once the verify is done as per above, a glance is sufficient to see if any issues are present. In this case, there were no issues found by diskutil.
Automating the verification followed by a glance at the output is a huge time-saver.
diglloyd:~ lloyd$ verifyMountedVolumes.sh Verifying the file system on all mounted volumes... Volume: Archive1 Started file system verification on disk2s4 Archive1 Checking file system Checking Journaled HFS Plus volume Checking extents overflow file Checking catalog file Checking multi-linked files Checking catalog hierarchy Checking extended attributes file Checking volume bitmap Checking volume information The volume Archive1 appears to be OK Finished file system verification on disk2s4 Archive1 Volume: ArchiveP Started file system verification on disk2s5 ArchiveP Checking file system Checking Journaled HFS Plus volume Checking extents overflow file Checking catalog file Checking multi-linked files Checking catalog hierarchy Checking extended attributes file Checking volume bitmap Checking volume information The volume ArchiveP appears to be OK Finished file system verification on disk2s5 ArchiveP Volume: Boot.int Started file system verification on disk1s2 Boot.int Checking file system Checking Journaled HFS Plus volume Checking extents overflow file Checking catalog file Checking multi-linked files Checking catalog hierarchy Checking extended attributes file Checking volume bitmap Checking volume information The volume Boot.int appears to be OK Finished file system verification on disk1s2 Boot.int Volume: BootClone Started file system verification on disk2s2 BootClone Checking file system Checking Journaled HFS Plus volume Checking extents overflow file Checking catalog file Checking multi-linked files Checking catalog hierarchy Checking extended attributes file Checking volume bitmap Checking volume information The volume BootClone appears to be OK Finished file system verification on disk2s2 BootClone Volume: Master Started file system verification on disk5 Master Checking file system Performing live verification Checking Journaled HFS Plus volume Checking extents overflow file Checking catalog file Checking multi-linked files Checking catalog hierarchy Checking extended attributes file Checking volume bitmap Checking volume information The volume Master appears to be OK Finished file system verification on disk5 Master Volume: MasterClone Started file system verification on disk1s3 MasterClone Checking file system Checking Journaled HFS Plus volume Checking extents overflow file Checking catalog file Checking multi-linked files Checking catalog hierarchy Checking extended attributes file Checking volume bitmap Checking volume information The volume MasterClone appears to be OK Finished file system verification on disk1s3 MasterClone Volume: Scratch Started file system verification on disk10 Scratch Checking file system Checking Journaled HFS Plus volume Checking extents overflow file Checking catalog file Checking multi-linked files Checking catalog hierarchy Checking extended attributes file Checking volume bitmap Checking volume information The volume Scratch appears to be OK Finished file system verification on disk10 Scratch Volume: Work Started file system verification on disk6 Work Checking file system Checking Journaled HFS Plus volume Checking extents overflow file Checking catalog file Checking multi-linked files Checking catalog hierarchy Checking extended attributes file Checking volume bitmap Checking volume information The volume Work appears to be OK Finished file system verification on disk6 Work Volume: a.Boot Started file system verification on disk7s2 a.Boot Checking file system Performing live verification Checking Journaled HFS Plus volume Checking extents overflow file Checking catalog file Checking multi-linked files Checking catalog hierarchy Checking extended attributes file Checking volume bitmap Checking volume information The volume a.Boot appears to be OK Finished file system verification on disk7s2 a.Boot Volume: b.Boot Started file system verification on disk9s2 b.Boot Checking file system Checking Journaled HFS Plus volume Checking extents overflow file Checking catalog file Checking multi-linked files Checking catalog hierarchy Checking extended attributes file Checking volume bitmap Checking volume information The volume b.Boot appears to be OK Finished file system verification on disk9s2 b.Boot Volume: diglloyd Unable to find disk for diglloyd Volume: tm Started file system verification on disk2s3 tm Checking file system Checking Journaled HFS Plus volume Checking extents overflow file Checking catalog file Checking multi-linked files Checking catalog hierarchy Checking extended attributes file Checking multi-linked directories Checking volume bitmap Checking volume information The volume tm appears to be OK Finished file system verification on disk2s3 tm Volume: xfer.Archive1 Started file system verification on disk8s7 xfer.Archive1 Checking file system Checking Journaled HFS Plus volume Checking extents overflow file Checking catalog file Checking multi-linked files Checking catalog hierarchy Checking extended attributes file Checking volume bitmap Checking volume information The volume xfer.Archive1 appears to be OK Finished file system verification on disk8s7 xfer.Archive1 Volume: xfer.ArchiveP Started file system verification on disk8s9 xfer.ArchiveP Checking file system Checking Journaled HFS Plus volume Checking extents overflow file Checking catalog file Checking multi-linked files Checking catalog hierarchy Checking extended attributes file Checking volume bitmap Checking volume information The volume xfer.ArchiveP appears to be OK Finished file system verification on disk8s9 xfer.ArchiveP Volume: xfer.Boot Started file system verification on disk8s3 xfer.Boot Checking file system Checking Journaled HFS Plus volume Checking extents overflow file Checking catalog file Checking multi-linked files Checking catalog hierarchy Checking extended attributes file Checking volume bitmap Checking volume information The volume xfer.Boot appears to be OK Finished file system verification on disk8s3 xfer.Boot Volume: xfer.Master Started file system verification on disk8s5 xfer.Master Checking file system Checking Journaled HFS Plus volume Checking extents overflow file Checking catalog file Checking multi-linked files Checking catalog hierarchy Checking extended attributes file Checking volume bitmap Checking volume information The volume xfer.Master appears to be OK Finished file system verification on disk8s5 xfer.Master