The Natural Philosopher <t...@invalid.invalid> wrote:
> I have a remote server which I connect to using NFS over a hole punched
> in the remote firewall. This works nicely.
> I have never got the hang of automounting either..
I'd still recommend the automounter. It's actually pretty easy...
1. Edit /etc/auto.master and make sure that you have (just) this line:
/var/autofs/net -hosts
This defines a host-and-share-based mapping underneath the root point
/var/autofs/net. You will probably need to create that directory.
2. Start the automounter
invoked-rc.d autofs start # Debian style
service autofs start # RedHat style
3. Edit the opts definition in the file /etc/
auto.net according to
taste. My preference is this, but yours may vary:
opts="-fstype=nfs,hard,intr,nodev,nosuid"
OK so that's the automounter up and running. You can now reference
remote mounts by accessing appropriate host/path directories
underneath the automounter root, /var/autofs/net. For example, if
you have a remote host called
gizmo.roaima.co.uk and a remote path of
/shares/myshare, the target directory on your local machine will be
/var/autofs/net/
gizmo.roaima.co.uk/shares/myshare. I find it helpful to
symlink these up to a /net/ directory, like this, and then I can ignore
the long paths into the automounter:
mkdir /net
cd /net
ln -s /var/autofs/net/
gizmo.roaima.co.uk/shares/myshare
ln -s /var/autofs/net/
gizmo.roaima.co.uk/shares/myothershare
ln -s /var/autofs/net/
another.example.com/home/yetanothershare
If you get really excited about the automounter, you can use the
auto.misc file to declare arbitrary mappings, and theoretically even
use the auto.smb script to build implicit SMB host-and-share-based
mappings. (These tend to be harder, though, as usually authentication
of some form is required for the mount to succeeed.)
/var/autofs/misc /etc/auto.misc
/var/autofs/net /etc/
hosts.net --timeout=60
/var/autofs/smb /etc/hosts.smb --timeout=300
See
http://greenfly.net/tips/autofs.html for lots more excitement
Chris