Reader Charles asked a great question after reading my post about hiding a mounted disk volume on the desktop. He asked, in a nutshell, how to cause Mac OS X to not automatically mount a volume. Basically, Charles wants to leave his bootcamp volume unmounted when in Mac OS X. As it sits, Mac OS X automatically mounts all non-removable drives at startup.
Here’s how. First and formost, don’t be a dumbass. Back up your system. Know how to recover if this hoses up your computer.
If running 10.4.x, you must create an /etc/fstab file. Here’s the setup and necessary steps. Keep in mind, if you hose your computer, you did it. I’m not recommending you take these steps!:
1. You need to know the volume name of the volume you’re trying to hide, and whether it’s formated in FAT32 or NTFS. For this article, we’ll assume the name of the Windows partition that I want to hide is WINDOWS, which is what I see mounted on my desktop.
From the terminal, enter the following, replacing WINDOWS XP with the name of your volume:
diskutil info /Volumes/'WINDOWS'
I’ve surrounded the volume name with single quotes since there’s a space in the name.
The resulting output from diskutil is (important part is highlighted in yellow):
imac:~ cbrewer$ diskutil info /Volumes/'WINDOWS'
Device Node: /dev/disk0s3
Device Identifier: disk0s3
Mount Point: /Volumes/WINDOWS
Volume Name: WINDOWS
File System: MS-DOS FAT32
Partition Type: Microsoft Basic Data
Bootable: Is bootable
Media Type: Generic
SMART Status: Verified
Total Size: 20.6 GB
Free Space: 419.8 MB
Read Only: No
As you can see, my volume’s filesystem is FAT32.
2. Recent versions of Mac OS X ship without an /etc/fstab file. We need to create one. From the Terminal, issue the following command:
sudo tee -a /etc/fstab
3. Type in the following, substituting the name of your volume:
LABEL=WINDOWS none msdos rw,noauto 0 0
If your file system from step one was NTFS, enter:
LABEL=WINDOWS none ntfs rw,noauto 0 0
4. Press “control-d” to send an end of line character to the terminal, thus closing out the tee application and writing the file. You can check your new /etc/fstab file by typing:
5. Next time you reboot, your Mac should not mount the volume. You can check by opening Terminal and entering:
ls -aleG /Volumes
You should see only the names of the volume(s) you want mounted…