View Single Post
 
Old 03-22-2008, 10:41 PM
Voyn1x's Avatar
Voyn1x Voyn1x is offline
 
Join Date: Jan 2008
Location: United Kingdom
Posts: 554
This tutorial is great for keeping your desktop tidy by unmounting drives you don't need regular access to. For example this could be your Windows drive, Tiger partition etc. I thought this could be added to the wiki, i'm sure others would find this useful

First get the UUID of a volume you wish to stop mounting - this can be seen in Disk Utility (click the Info button and find the Universal Unique Identifier).

Now that you have a UUID for the volume to hide during the mount process, from an admin account create your /etc/fstab file (in Leopard this file doesn't exist by default):

From Leopard on you need to use vifs to create and edit /etc/fstab, or at least you should*.

Code:
sudo vifs
Add a line with the UUID for your volume and the mounting point information, for example:

Code:
# Identifier,  mount point,  fs type,  options
UUID=F0E430C1-5558-3BB3-9FA9-6904B663FEEA  none  hfs  rw,noauto
The Identifier is used to identify the volume.

The mount point is the directory used when the volume is mounted; set none to use the pre-defined OS X directory, i.e. ./Volumes/

The fs type describes the type of the filesystem; use hfs for a Mac volume, use ntfs if it's a NTFS formatted PC volume. The field options describes the mount options associated with the filesystem. 'noauto' will force the volume not to be mounted automatically; and last, use 'rw' or 'ro' for a read-write or read-only disk.

One thing to note is that FAT32 and NTFS formatted volumes are not assigned a UUID. You'll have to use LABEL instead of UUID and change the fs type to 'msdos' or 'ntfs'. NTFS volumes are mounted read only under os x, so you'll also have to change the option from 'rw' to 'ro'.

eg.

FAT32
Code:
LABEL=<drive name> none msdos rw,noauto
NTFS
Code:
LABEL=<drive name> none ntfs ro,noauto
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).

Also, you might find that /etc/fstab is ignored and your partition still mounts. Two things you can try:*
  1. Code:
    sudo defaults write /Library/Preferences/SystemConfiguration/autodiskmount AutomountDisksWithoutUserLogin -bool true
  2. Instead of using "none" for the mountpoint use the normal location i.e. /Volumes/WindowsXP along with the ro,noauto options.
Reply With Quote