How can I unmount a drive every time I reboot?
The following Hint on Mac OS X Hints details a way to do this. Basically you'll create (or modify) the file /etc/fstab
and add a line similar to:
UUID=F0E430C1-5558-3BB3-9FA9-6904B663FEEA none hfs rw,noauto
The actual UUID will vary, you can find the UUID for your disk in system.log
:
In Mac OS X Panther, Disk Utility and the diskutil command doesn't display the UUID value. But if you look in the system.log file, when the disk is mounted, you can see something similar to this (line breaks added for narrower display):
… localhost diskarbitrationd[87]: disk1s9 hfs 77F3E84D-E0ED-3194-96A5-BED10893FFF4 FireWire HD /Volumes/FireWire HD … localhost diskarbitrationd[87]: disk1s10 hfs F0E430C1-5558-3BB3-9FA9-6904B663FEEA Mac OS X Disc /Volumes/Mac OS X Disc
The string before the volume name is the UUID for the disk.
Use a LaunchAgent (see Lingon) that runs at boot to unmount. If it runs too quickly, add a wait/pause/sleep. The action that unmounts can be in whatever you preferred scripting/automation language is (bash (hdiutil), Automator, AppleScript, etc.)