Hdiutil attach -shadow not working

bugcatalinacommand linedisk-utilityhdiutil

This question is for those of you familiar with command-line tools and disk images. I'm stumped!

Previously, I could mount a read-only disk image with a "shadow" file to make it read-write using this command:

hdiutil attach "someDiskImage.dmg" -shadow "someShadowFile.dmg"

However, on Catalina (macOS 10.15) this doesn't work. I'm not sure why or whether it is related to the OS version. Here is the output I get:

-> ls -al

total 391168
-rw-r--r--@ 1 myname  admin  188484680 Nov  7  2018 example.dmg
-rw-r--r--  1 myname  admin   11767808 Nov  7  2018 example.dmg.shadow

-> hdiutil attach -shadow example.dmg.shadow example.dmg

Usage:  hdiutil attach [options] <image>
        hdiutil attach -help

->

Can anyone help me figure this out? Is -shadow just broken on Catalina? Thanks. Also, can you verify if you can reproduce this issue?

Best Answer

Alas, it seems that either macOS has changed the format of .shadow files in a breaking way, or that my .shadow files are corrupted (hundreds of them) without any corruption to the DMGs themselves (hundreds of them, all with checksums that match). I'm going to guess it's the first option. Nonetheless, the usage message only shows when mounting with these specific shadow files. When I create new shadow files, the disk images mount just fine.