I have a FreeNAS server in the house on which we keep our media. I would like to be able to automount this share in a persistent location when the machine is turned on so that the music players can index the music and we can conveniently browse through the folders etc.
How will I accomplish this?
If you're looking to have a persistent mount that is stale-proof (outside of the networking being down, or the remote machine being off) I would recommend using AutoFS
In short Autofs (also know as Automount) will only mount a directory when it is needed or accessed and after a few moments of inactivity will unmount itself. By doing so you can setup a persistent network location like you NAS and have it always accessible on your machine in the same mount point without having to worry about the mount going stale when networking drops or if you suspend your computer.
Set up your server to provide the share as NFS (assuming it hasn't already). Then follow the guide here: http://www.centos.org/docs/5/html/5.1/Deployment_Guide/s2-nfs-fstab.html
Also, you might have to install
nfs-common
package for it to work.You need to add an entry in the
/etc/fstab
for this. See this question for a sample entry. As the answerer explains, smbfs package may be required. This post gives more detailed instructions on the /etc/fstab entry to be added.You would have to use
gksudo gedit /etc/fstab
to edit the file as root.Further to Marco Ceppi's answer (I'd have posted this as a comment if I had the necessary reputation):
When you want to use
autofs
for the job, have a look at autosshfs, which allows mounting an sshfs (fuse) filesystem with a user'sssh-agent
. That solves the usual authentication issue with autofs: since it runs as root it is tricky to set up to authenticate as a user without having to type a passphrase every time or use an unprotected SSH key.Judging by the tags you need to mount Samba. For that matter look here:
Samba Client Configuration Guide on Ubuntu Wiki
A good resource to look for answers about Ubuntu is http://wiki.ubuntu.com since many questions are answered there in greater detail. :)