2022-12-04

FSCK'ing Veracrypt Volumes on macOS

Due to unexpected power loss or disconnection of the underlying storage, the filesystem inside Veracrypt volumes is desired to prevent future data loss.

On macOS I tried using 

diskutil verifyDisk /dev/diskXXX

This didn't  work for some reason, most likely because of some interaction with veracrypt. Same results via Disk Utility application.

The Veracrypt GUI however offers a "check filesystem" option if you right click on a mounted volume. Unfortunately, as of version 1.25.9, it doesn't work out-of-the-box on macOS: it fails to find 

/Applications/Utilities/Disk Utility.app

The cause is that from at least macOS 12, Disk Utility is located at

/System/Applications/Utilities/Disk\ Utility.app

There is a quick and dirty workaround

  cd /Applications/Utilities
  sudo ln -s /System/Applications/Utilities/Disk\ Utility.app ./

With the above symlink in place it is possible to perform filesystem verification and repair via the context menu items offered in the Veracrypt GUI.