1) Make sure the hard drive you want to prevent mounting at boot is mounted.
2) Launch Terminal.
3) Run the following command to find out what disks are mounted on your system.
diskutil list
this should give a list of drives.
4) Find out more information on the drive you don’t want to mount.
example. Here is a windows drive that I don't want mounted when I start my mac.diskutil info /dev/disk4s3
This gives information that looks like this:
Device Identifier: disk4s3
Device Node: /dev/disk4s3
Whole: No
Part of Whole: disk4
Volume Name:
Mounted: No
Partition Type:Microsoft Basic Data
File System Personality: NTFS
Type (Bundle): ntfs
Name (User Visible): Windows NT File System (NTFS)
OS Can Be Installed: No
Media Type: Generic
Protocol: SATA
SMART Status: Verified
Volume UUID: FXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
5) Locate the line that starts with: Volume UUID:. Select the UUID (Universal Unique Identifier) that follows the rest of the line. It will be something that looks like FFXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX. Your value will be different
6) Copy the UUID to the clipboard.
7) Navigate to /etc by typing the following and pressing enter:
cd /etc
8) Edit (or create) an fstab file by typing the following and pressing enter:
sudo vifs
9) Enter the following line, substituting the UUID you copied in step 5). (Note: vifs uses the value of the EDITOR environment variable to pick the text editor to use. This article assumes you are using the default value of vim.)
In vim, the editor starts in command mode. To add a new line, use the arrow keys to move to the end of the document and press the o key to append a new line and enter edit mode. Then type the following:
UUID=FFXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX none hfs rw,noauto
and press the return key.
note: hfs may need to be replaced with whatever drive formatting type is being used. My drive was using ntfs. You can double-check your drive formating with this command:
replace disk4s3 with your device identifier:
diskutil info disk4s3
10) Type escape to return to command mode and then type ZZ (shift key down) to save and exit vifs
10) Type the following and press enter to reset the auto mounter:
sudo automount -vc
11) Quit Terminal
12) Restart your computer to test if the drive is mounted on startup.