I wish to set up a network drive for storing my personal photos. I already have a server and a 'pictures' user on the server. I planned to store the photos in the home directory of this user.
I already tried to set up an sshfs mount in fstab but that didn't quite work. I believe the reason was that my laptop is currently only on wifi and fstab would have required wired connection even when using _netdev option.
Then I saw this http://ubuntuforums.org/showthread.php?t=896474&p=5635104#post5635104 which adds mounting scripts to network if-up and if-down. But for some reason even that didn't work. When wifi connection was created the if-up script was not run.
Then I tried to use the "Connect to server" in Nautilus. This looked very promising and it sort of works. Only down side is that places connected with that option do not show up in browsers upload file dialog. And it would be one of the main use cases that I attach a picture to an email.
So my question is how could I mount a network drive so that: 1) the drive would be usable from applications like browser 2) it is automatically connected when network is available or when the bookmark or directory in Nautilus is clicked 3) Can be used by multiple users 4) easy to use even by nontechnical persons (setup can be more demanding)
Is there such a way?
Then I tried to use the "Connect to server" in Nautilus. This looked very promising and it sort of works. Only down side is that places connected with that option do not show up in browsers upload file dialog
Nautilus mounts those files under
~/.gvfs/share_name
and they are available in the browsers upload file dialog from that directory too. Maybe the dialog hides that folder, because it is hidden, just press CTRL+H in the dialog to toggle showing hidden files/directories and browse to that folder.To mount the same way as Nautilus mounts just use the command
(Obviously filling out the parts correctly.) You can make a simple bash script with that command:
make it executable and make that script autostart with your login. (e.g. by typing "startup" in Dash and using the "startup applications" app to set it up.) This script will wait 20 seconds after startup to mount the share, if you need more or less time for the wifi to come up just change the number in the script to the seconds you want.