I have an external hard disk with two partitions on it: a principal partition is used for all my stuff (apps, games, user file, music, etc.), and a secondary partition with a minimal OS X installation, containing some diagnostic and recovering software utility, that I periodically use for backup and testing purposes.
The principal partition is obviously always active, but ideally the secondary partition would be inactive or hidden on boot, so that it no longer appears on my desktop and would be manually actived when needed (with Disk Utility, the command line or via a automated backup script). For example, I know that TechTool Pro does something similar and calls such partition "eDrive."
There are several hints on this site for unmounting a partition at login, but a better way to make this happen can be used. You need to create an entry point in your filesystem table to tell the OS not to mount that specific volume, and this is relatively easy. In Mac OS X, and under Linux and others unix systems, the volume mounting configuration file is located in /etc/fstab. This file in Mac OS X Tiger is empty (in Panther, it's commented), but type man fstab in Terminal to read some important information.
Read on for my solution...
An /etc/fstab example:
The Identifier is used to identify the volume; the LABEL is the volume name, the UUID is the Universal Unique Identifier Drive. You can use both, but the UUID is the best choice because renaming the volume will not change this identifier.
# Identifier, mount point, fs type, options1 UUID=DF000C7E-AE0C-3B15-B730-DFD2EF15CB91 /export ufs ro UUID=FAB060E9-79F7-33FF-BE85-E1D3ABD3EDEA none hfs rw,noauto LABEL=This40Is40The40Volume40Name none msdos ro
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):
diskutil info /path/to/disk
The string before the volume name is the UUID for the disk.
... localhost diskarbitrationd: disk1s9 hfs 77F3E84D-E0ED-3194-96A5-BED10893FFF4 FireWire HD /Volumes/FireWire HD<br> ... localhost diskarbitrationd: disk1s10 hfs F0E430C1-5558-3BB3-9FA9-6904B663FEEA Mac OS X Disc /Volumes/Mac OS X Disc
Add a line with the UUID for your volume and the mounting point information, for example:
sudo pico /etc/fstab/
Save the file and reboot (for internal drives) or unmount, disconnect and reconnect the volume (for external drives). Now the system should not mount the partition identified in fstab. You can still manually mount the volume in Disk Utility, or via the command line (and for a volume containing a boot system, rebooting from it).
UUID=F0E430C1-5558-3BB3-9FA9-6904B663FEEA none hfs rw,noauto
Mac OS X Hints