Contribute
Register

Using FSTAB to Hide Volumes from OS X Finder

Joined
Mar 30, 2012
Messages
3
Motherboard
Gigabyte Z68XP-UD4, OS X 10.8.5
CPU
Intel i7-2600K @ 3.4GHz
Graphics
NVIDIA 2GB GTX 660
Mac
Mac Pro
Classic Mac
Mobile Phone
Cosmetic tweaks are something I rarely revisit, however, from time to time I see people struggling with the question of hiding specific Volumes from their desktop, and Finder windows. Finder preferences don't allow hiding of a specific Volume, instead, they provide an "all-or-nothing" approach which doesn't satisfy the need.

Using the /etc/fstab file to prevent a Volume from automatically mounting at boot effectively "hides" any partition/volume. You can still mount the Volume manually.


How do I find the UUID?

The most reliable way to uniquely identify a particular Volume is by having /etc/fstab reference its UUID. To find the UUID of a Volume, start by using DISKUTIL to find its identifier (eg: disk0s3):

  1. In Terminal, type: diskutil list to list all mounted Volumes.
  2. Once you have the disk identifier (eg: disk0s3), type: diskutil info disk0s3 to display more detailed information including the UUID (if available). Substitute this example for your own disk identifier.

How do I hide a Mac or Windows Volume?

Note that (as from OS X Lion) the /etc/fstab file does not exist by default. There is a placeholder file - /etc/fstab.hd - do NOT attempt to use that file as it will be completely ignored. You will need to create /etc/fstab manually. Tou can use TextWrangler or TextEdit, but for the purposes of this example I will use Nano/Pico:

  1. In Terminal, type the following to open Nano/Pico and create the new fstab file:
    Code:
    sudo nano /etc/fstab
  2. In Nano/Pico, enter one of the following (Substitute XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX for your own UUID):
    • For a Mac HFS+ Volume
      Code:
      UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX none hfs rw,noauto
    • For a Windows NTFS Volume:
      Code:
      UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX none ntfs ro,noauto
    • For a Windows FAT32 (or FAT16) Volume:
      Code:
      UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX none msdos rw,noauto
  3. Press ^X (CTRL+X) to exit Nano/Pico.
  4. Press Y and ENTER when prompted to save the /etc/fstab file.
  5. Reboot.

What about Windows "System Reserved"?

Note: Because DISKUTIL does not show a UUID for the Windows "System Reserved" boot volume, /etc/fstab will need to reference the Volume label instead. However, it first needs to be 'Unicode Escaped' as follows:
Code:
LABEL=System\040Reserved	none	ntfs	ro,noauto
After a reboot (if all goes well) the Volumes will now be effectively hidden from Finder, and your desktop.

Hope this helps.
 
Joined
Jan 31, 2011
Messages
12
Motherboard
Gigabyte H77n WIFI
CPU
i3 3225
Graphics
Intel HD
Mac
MacBook Pro
Classic Mac
Mobile Phone
Android, iOS, Other
Hi macntosh,

Thanks for this guide. Sorry to resurrect this post but I tried this on my 10.10 yosemite build in which I am running OS X from an SSD and have a seaport HDD which is partitioned with a Windows install and a few other partitions for media. Since the change I am only able to boot into Yosemite in safe mode (-x). You mentioned that since Lion, this /etc/fstab file does not exist in OS X by default; could removing the file via terminal potentially solve my kernel panic problem when booting without -x?

I would rather have a functioning build than one which ignores my Windows partition. Any help you can provide would be appreciated.Thanks.
 
Top