I have some nfs mounts defined, e.g /home/andrew
I can mount these to /mnt
# mount computer:/home/andrew /mnt/computer
in which case the folder /mnt/computer is my home folder on computer
$ cd /mnt/computer
[list of contents of /home/andrew]
# showmount --exports computer
correctly returns /home/andrew
I have now installed autofs and added
/mnt -hosts --timeout=60
Everything works fine, but not as expected.
If I cd to /mnt/computer I now find that it has mounted /home/andrew to /mnt/computer thus
$ cd /mnt/computer
$ cd home
$ cd andrew
Is it possible to make autofs mount the filesystem in the same way as nfs does?
Last edited by fdservices (2013-01-15 12:05:20)
Yes you can...
computer -timeout=60 host:/path/to/export]
Hope this help.
You know that systemd has an autofs feature built in?
Thanks - that worked after I made sure that auto.nfs was properly terminated with a cr/lf
I will look at the systemd (automount?) feature. Thanks for the tip.
And for systemd automounting "good point glorious" Everything I always wish I had baked into linux (with regards to nfs mount handling)
Here's how I did it on my machine:
step one pimp your /etc/fstab
# begin /etc/fstab
# archie needs a /home
server:/path/to/home /home/archie nfs rsize=8192,wsize=8192,timeo=14,rw,soft,intr,noauto,x-systemd.automount 0 0
# end of the world
Get rid of the bogus
systemctl disable autofs &&
pacman -Rs autofs &&
rm -r /etc/autofs &&
shutdown -r now
Thats it your free chicken is baked.
OK, that was pretty much a disaster. Set up automount on systemd and it tried to mount shares which were not running at start up in spite of the noauto flag being set. Had to boot into a terminal and reset the fstab before I could start up cleanly.
I have moved back to autofs for the moment, but that also does not appear foolproof. I knwo this is sacrilege, but Windows handles remote mounts much better than Linux.