I have a portable drive that I've divided into two partitions: an HFS+ partition for backups and extra storage, and an MSDOS partition so that I can transfer large files or folders to or from Windows boxes. However, I don't need the second partition very often, so I wanted a way to keep it from automatically mounting on my machine when I plug in the drive, while still being able to access it quickly and easily. This turned out to be reasonably easy to do.
First, to prevent the partition from mounting when the disk as a whole mounts, edit/create the fstab system file, which lives down in the root folders at /etc/fstab. Leopard does not seem to have this file by default; it does have a file /etc/fstab.hd, which is not the file you want (though it makes for interesting reading in a Hitchhikers Guide to the Galaxy sort of way). Use a plain-text (i.e. programmer's) text editor such as TextWrangler, Smultron, or Editra, or use a unix tool like vi, and create a file called fstab with the following contents:
LABEL=PARTITION_NAME none msdos rw,noauto
Fields on this line are separated by tabs or spaces, so be careful to escape any spaces in your partition name. The escape character for a space seems to be \040 (octal 40) -- see the example in the man page for fstab.
The four fields specify:
#! /bin/bash
dev_id=`diskutil list | awk '/PARTITION_NAME/{ print $6; }'`
[[ $dev_id ]] && diskutil mount $dev_id
The dev_id line recovers the partition's device ID, and then (if the drive is available), the next line gets diskutil to mount it. Save this script with a .sh extension and run it from the script menu, QuickKeys, Butler, or other script launcher; or save it with a .command extension and run it by double-clicking it.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20090811124320441