RitterSport:

Open (as root) the existing /etc/fstab file eg.

sudo nano /etc/fstab

"comment-out" your existing NFS mount(s) by adding a "#" at the start of the line(s) and then save the file with Ctrl-o and exit with Ctrl-x.

Unmount the existing NFS mounts:

sudo umount -a

Install autofs eg.

sudo apt-get install autofs

Open (as root) new file /etc/auto.master eg.

sudo nano /etc/auto.master

Assuming that you want the mounted directories under /mnt, add the following line at the end:

/mnt /etc/auto.misc --timeout 60 --ghost

Note that you can change the mount directory to one of your choice. The "ghost" option ensures that even unmounted directories are always visible. Remove this if you prefer to only see the directory when you enter the path to the mounted directory.

Save the file with Ctrl-o and exit with Ctrl-x.

Open (as root) new file /etc/auto.misc eg.

sudo nano /etc/auto.misc

Add line(s) at the end for your mount directories in a similar format to your /etc/fstab file eg:

client_mount_directory_1 -fstype=nfs,rsize=8192,wsize=8192,nosuid,soft server_1:dir_to_be_shared_1 client_mount_directory_2 -fstype=nfs,rsize=8192,wsize=8192,nosuid,soft server_2:dir_to_be_shared_2

Adjust the mount options to suit your requirements.

Save the file with Ctrl-o and exit with Ctrl-x.

Start the autofs service:

sudo service autofs restart

Autofs should now be running and if the PC is shutdown or restarted this service should start automatically. Your NFS mounts should be visible and will show the contents when accessed either via a terminal or via the Thunar GUI file manager. Hopefully, the PC will now shutdown and/or restart without hanging.

Last edited by Zill (2013-02-23 12:13:04)