Making /Volumes visible in Finder

Since working out how to automount Drobo FS shares I’ve been looking for a way of having my /Volumes folder appear in Finder.

The solution is to use the SetFile command line tool:

/usr/bin/SetFile is a tool to set the file attributes on files in an HFS+ directory.

To make the /Volumes folder visible:

sudo SetFile -a v /Volumes

To make the /Volumes folder invisible again:

sudo SetFile -a V /Volumes

You can apply this to any folder that is invisible by default in Finder.