Mount folder as a volume (OSX)
Is it possible to (auto) 'mount' folders as Volumes? I have a large DAS Volume, 'Data', that contains all my data. To make paths shorter and more future proof, I'd like to have Volumes like
/ContentTypeA/ /ContentTypeB/
Instead of using
/Data/ContentTypeA/ /Data/ContentTypeB/
etc, which is where the data actually resides.
Any ideas on how to do that? It's not a big problem. Just curious.
Solution 1:
Let's assume you are mounting/attaching your Data drive as usual which will result in paths like /Volumes/Data/ContentA
and /Volumes/Data/ContentB
. You can now do either of:
-
create symbolic links via Terminal running the following commands in a Terminal window:
ln -s /Volumes/Data/ContentA ~/ContentA ln -s /Volumes/Data/ContentB ~/ContentB
create aliases via Finder by opening
/Volumes/Data
in Finder, selectingContentA
, pressing Cmd-L to create an alias and moving this alias to your Home folder. The alias file can afterwards be renamed as you see fit.
With both options the content of the Data drive will be accessible via your Home folder.
Solution 2:
Sometimes symbolic links may not be suitable for your needs.
In that cases you can use bindfs - a FUSE filesystem for mounting a directory to another location.
Install it with homebrew:
brew install bindfs
And then bind one folder to another:
bindfs /Volumes/Data/ContentA ~/ContentA
Solution 3:
I just wanna say thanks to @mixel - that is THE WAY to do it, I actually wanted to mount the iCloud Drive as a volume, so that it appears on the desktop.
Installation of bindfs did not go that easy on Sierra, I had to do the following:
brew cask install osxfuse
brew install homebrew/fuse/bindfs
and then in my case I might add that the handy relevant bindfs option is -o volumename=NAME
, otherwise the volume gets some crazy name that hurts eyes.
And for anyone who'd like to have the iCloud Drive appear as a volume, the sequence is this:
sudo mkdir /Volumes/iCloud\ Drive
sudo bindfs -o volname=iCloud\ Drive /Users/robert/Library/Mobile\ Documents/com~apple~CloudDocs \
/Volumes/iCloud\ Drive/
Solution 4:
Update for 2021 on High Sierra:
Trying to install bindfs
on MacOS today, using the examples above, I got this error:
Error: bindfs has been disabled because it requires closed-source macFUSE!
Bummer. (Don't you just hate it when someone else's ideology interferes with your technology?)
But thanks to: https://github.com/osxfuse/osxfuse/issues/801 I was finally able to workaround that, and install bindfs from here:
brew install gromgit/fuse/bindfs-mac