In a computer’s operating system, hard disk drives are hidden, mostly for data privacy and security purpose. Also the operating system recovery partitions may be kept hidden in some cases. You can selectively hide partitions or show hidden partitions in MAC by using following tips.
The setfile command can be used to change attributes of files and volumes in Mac OS X, including the hidden attribute. To hide a volume (in my case volume name is Confidential) use the following command:
setfile -a V /Volumes/Confidential
Use Universal Unique Identifier of Hard Disk Drive
Another method is to hide hard disk partition by ‘Universal Unique Identifier’ (UUID) of the drive. First we have to find out the UUID of drive. You can do that by using Disk Utility (terminal command: diskutil). Start the Disk Utility, click on the partition you want to hide and click the info button on the toolbar. Select “Universal Unique Identifier” with mouse and copy it.
Open a terminal window. Look at the /etc folder for presence of fstab file (if there is a file named as, fstab.hd, ignore it. You are not looking for that). The location of fstab can also be /private/fstab depending on your OS X. If you can not find fstab file, create the fstab file by following command.
sudo pico /etc/fstab
Editor window will open. Enter the following in fstab file:
UUID=*******-****-****-****-************ none hfs rw,noauto 0 0
*Stars represent the numbers of your UUID. Replace these with your UUID.
Save (Ctrl+O) and exit (Ctrl+X) /etc/fstab. Reboot the Mac and the required partition will be hidden. It will not mount or display on desktop but will be visible in Disk Utility and can be mounted on demand.
Do not Mount Drisk Drive
Partitions that are mounted in Mac OSX are generally present in the file named as ‘fstab’, located at /etc/fstab location. Fstab is read by system upon boot. If you can find that file, just comment out (i.e. put a # before the required line, and save the file) the line that refers to the drive you do not want to mount, it will not mount upon next boot.
You can also unmount volumes in MAC OS X by using free MAC tools.
Mount Partition Again
You can mount the partition again by using its UUID in fstab file, like below:
UUID=*******-****-****-****-************ none hfs rw,auto
Showing Hidden Partitions in Disk Utility
Disk Utility will show the hidden or un-mounted volumes(partitions of disk). If you can not see the hidden partitions in Disk Utility, then you will have to enable debug menu by using following command in terminal:
defaults write com.apple.DiskUtility DUDebugMenuEnabled 1
After this, close and relaunch Disk Utility and from ‘Debug‘ menu, check “Show Every Partition“. Now you will be able to see hidden partitions in MAC. This tip is also useful for showing ‘Recovery’ partition.