How to prevent a drive volume from mounting

WARNING: While I have done this tip myself, and it works great for me, any time you are entering commands into terminal, please have a backup of your system in case of an error or problem. Please take caution.




I'm going to present this tip as it was necessary for me, using my situation should help demonstrate how this is a cool tip, preventing drive volumes from mounting when you boot into Mac OS X. My example is about preventing an external firewire drive from mounting, but you can prevent USB2, internal, or other volumes from mounting also.


Situation: I use SuperDuper! to maintain a clone drive of my Macintosh HD. Considering how inexpensive both an external drive and SuperDuper! (hard drive cloning software) are, we should all keep a cloned copy of our internal drives. Not only does it provide you with a safety copy of your drive, but you can also boot from it if needed. Several times I've been very thankful that I have a clone drive, saved my butt.

By the way, here is a current deal, an AcomData 500GB FireWire 400 for only $120 with free shipping (USA). I've got three AcomData external FW400/USB drives, they work really well.

With SuperDuper! you can schedule 'backup' clone activities, and SD! has the smarts to mount an external drive before the event if the drive isn't already mounted, you do need to have the drive mounted in order to setup the scheduled activity. SD! will even unmount the drive if it was unmounted before the scheduled event.

I don't want spotlight wasting resources indexing my Clone drive, and for some reason OS X won't let me add my Clone drive to my Spotlight exclusion list, or if it does add it to the list, it disappears the next time I reboot.



Question: Now the question which remained for me was how can I keep my Clone External firewire drive from mounting when I reboot? OS X offers no visible means of doing this.


Answer: Some digging around over at MaxOSXHints.com revealed the answer, you just need a bit of information from Disk Utility, and then to type in a line of code in a terminal session. Don't be scared of the terminal entry, it's really very easy.


Step 1) Open Disk Utility select the volume that you do not want to automatically mount when you boot into Mac OS X, click on Information, select and copy the "Universal Unique Identifier" code.

Picture 3


Step 2) Open a Terminal session, type in:
sudo pico /etc/fstab
hit ENTER, and then enter your password.

Picture 1


Step 3) Now enter the following line (using your own UUID). Note the "noauto" is what prevents the drive from mounting, see this page for more detail.

UUID=CDB15826-88A3-36AC-8009-3E71355F0B18 none hfs rw,noauto

You can enter additional lines for additional volumes.

Hit Cont+X to Exit, Y to Save.

Step 4) That's it, reboot and now that volume won't reboot.

Now when I reboot, my Clone drive is not mounted, I don't see it and Spotlight doesn't index it, nightly when my SuperDuper! scheduled event runs, it automatically mounts the volume, performs the clone update and then unmounts the volume. Perfecto!



Digg!


|