6

As relates to an answer to a previous question, I'd like to unmount a built-in hard drive every time I boot up. (Or alternately arrange for it not to be mounted). How do I do this?

  • I edited my answer to your other question to include a way that you can prevent the drive from being mounted. – Kyle Cronin Nov 19 '10 at 0:18
3

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.

1

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.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .