What happened

The article details an experiment comparing the use of hdiutil and diskutil for creating DMG images from a user’s home folder. The goal was to assess their relative performance and functionality, particularly in the context of daily backups on a MacBook Pro running macOS Sequoia.

The core findings are stark: hdiutil's reliance on authentication prompts—due to file ownership issues—causes significant delays (110-115 seconds), while diskutil performs considerably faster (40-45 seconds) and produces smaller images (2.8 GB vs 2.89 GB). Notably, the resulting DMG from diskutil includes unnecessary files like ~/.Trash, suggesting it emulates hdiutil’s default ‘scrub’ behavior.

Why it matters

The discrepancies highlight a fundamental issue with how Apple develops and maintains its command-line utilities. The need to manually resolve file permissions in hdiutil points to an inflexible design that disrupts established workflows—like the daily backup performed by Knox, the app mentioned as being built on direct hdiutil calls. These kinds of disruptions can have significant operational impacts for businesses and individual users reliant on these tools, adding friction during backups and image creation.

But, but, but…

The observed behavior underscores a critical gap in Apple’s approach to tooling: an overreliance on prompting the user to resolve permission issues rather than handling them internally.

Diskutil's failure to trigger authentication demonstrates this lack of robustness. Furthermore, the inclusion of the ~/.Trash folder suggests that diskutil is aggressively removing temporary files during imaging—a default behavior mirrored by hdiutil’s ‘scrub’ option. This indicates a divergence in how these tools manage storage and potential conflicts during backups.

““many years ago i actually worked on an app, knox, that calls hdiutil directly. If hdiutil were removed from macos, that would completely break such an app.””
— Dr Non

The counter-take

Apple’s tendency to prioritize user experience through prompts over robust, automated backend functionality is a persistent frustration within the macOS ecosystem. This approach directly impacts developers reliant on command-line tools and significantly increases operational complexity for administrators managing large numbers of systems.

The AI angle

As Apple continues to integrate AI features and automated systems into macOS, inconsistencies in its core tools like hdiutil and diskutil create significant challenges for automation scripts and workflows. The lack of robust permission handling could exacerbate issues when deploying AI-powered backup solutions or automating complex system management tasks.