Apple - Permanently Disable/Ignore Secondary Disk?

Yes!

First get the UUID of the partition you want to prevent from mounting... You can get this in Disk Utility "Get Info".

Now open your /etc/fstab file for editing:

sudo pico /etc/fstab

In this file add the following line (use your own UUID naturally):

UUID=[your UUID] none hfs rw,noauto 0 0

And save the file.

Restart for the change to take affect.

You can always mount it manually in Disk Utility.


Similar to Linux.

The preferred disk identifier a Volume UUID.

You can use disk utility to find the Volume UUID or use diskutil:

diskutil list

get the disk indentifier, e.g. disk0s4

diskutil information disk0s4

In the row labeled Volume UUID:

Volume UUID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX

Edit /etc/fstab as root (it may not exist), creating an entry of the form:

UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX none hfs rw,noauto

Also refer to

man -S5 fstab