Probably the most reliable way to do this is with FSTAB. This file is read by OS X whenever a disk is attached, and determines how it's handled. We can use this file to tell OS X to make the disk read-only. The following process will require admin privileges.
Launch Disk Utility, select the partition you want to make read-only and Get Info on it. You'll see a line called, "Universal Unique Identifier". The string following it will be needed later.
Now launch Terminal, make sure you're logged in as an admin user, and type:
sudo vifs
You will be asked to authenticate by entering your admin password. It will not appear as you type it. Hit enter when done. This will open a text editor called VIM, and within it the FSTAB file. Using the cursor keys, scroll down to the last line in the file, and then press:
o
That's the letter, not a zero. This will cause the cursor to move down a line, and the word, "INSERT" to appear at the foot of the screen. Now, type the following:
UUID=
Then, paste that long string from Disk Utility here; make sure there's no space between the "=" and this string. The normal copy/paste operates as before in Terminal. Then, press Tab to create a space, and enter the following, pressing tab wherever <Tab> appears:
none<Tab>hfs<Tab>ro
The final "ro" is the bit that tells OS X to mount the drive read-only.
Now, hit Escape. You should end up with a line like this:
UUID=blah none hfs ro
Now, type a colon, ":", then:
x
And hit enter. The file will save itself, and VIM will close. Test the changes we made by fully ejecting and detaching your external HDD, then re-attaching it. You should find that it is read-only now. You can confirm this by typing:
mount
in Terminal, and hitting Enter. Look for the line that contains the name of your HDD, and you should see, "ro" or "read-only" listed in the brackets at the end of the line.
HTH 🙂