Q: auto mount disk image on boot
If I have a disk image on a direct attached drive, is there a way to get the system to mount it automatically on boot (as opposed to on a user login)? Can I do it if the image is encrypted?
I'm trying to talk TimeMachine Server into backing up to an encrypted sparse disk image rather than consume a whole disk.
Mac mini (Mid 2011), OS X Server
Posted on Dec 3, 2013 9:25 PM
You can use a launchdaemon. Save the following file (with proper revisions) in /Library/LaunchDaemons:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>RunAtLoad</key>
<true/>
<key>Label</key>
<string>system.dmg.mount</string>
<key>ProgramArguments</key>
<array>
<string>hdiutil</string>
<string>-attach</string>
<string>/Path/to/dmg file/.dmg</string>
</array>
</dict>
</plist>
working with an encryoted diskimage will need some modifications that I haven't worked through - I'm not sure how Time Machine encrypts things.
I will give the obligatory "I told you so" warning. Trying to coerce Time Machine into doing something that Time Machine isn't set up to do is almost certainly going to send you into migraine territory. Disk space is cheap and you only have one brain; no sense wasting the latter trying to save the former.
Posted on Dec 4, 2013 9:10 AM