h4x3d.com

- h4x3d.com

Solution for hdiutil: compact failed – Function not implemented

If you run
$ hdiutil compact my-sparse-image-can-also-be-encrypted.dmg
Initializing…
Finishing…
hdiutil: compact failed – Function not implemented

then this may as well be the case that you are not connected to the power-outlet and running on battery and have not the the needed flag.

If you try -batteryallowed (this means: hdiutil compact my-sparse-image-can-also-be-encrypted.dmg -batteryallowed), then you might be more lucky and it may work. Did for me.