Blog/20120503 OS X volumes - hdiutil detach vs. Finder detach

From Bjoern Hassler's website
< W:Blog
Revision as of 12:49, 3 May 2012 by Bjoern (talk | contribs)
Jump to: navigation, search

A bit of a technical blog post, on something that was tricky to diagnose. It applies to OS X, version 10.7.3.

It seems that when a (newly created?) sparseimage is detached using

hdiutil detach

that some timestamps (of files in the sparseimage) change. I.e. if you check a timestamp, then use "hdiutil detach" and then reattach the image, then the timetamp is different (and has current time). So something seems to happen when "hdiutil detach" goes to work. "hdiutil" seems to "touch" some of the file, which changes the timestamp to current time.

However, if you eject the sparseimage via Finder, this doesn't seem to happen.

It's annoying.

A work-around is to use Applescript (e.g. with osascript) to eject the sparseimage in that way. That seems to work.


2012-05-03 | Leave a comment | Back to blog