Blog of Raivo Laanemets

Stories about web development, freelancing and personal computers.

Automount NFS share on Slackware 14.1

NFS shares can be but into the /etc/fstab files, like:

server:/files /mnt/server nfs defaults 0 0

Despite that, it is not mounted before the network is connected. If you use NetworkManager (one of the options on Slackware, comes with the default install) then these shares can be mounted automatically by creating a dispatcher script. NetworkManager itself must be activated too, through /etc/rc.d/rc.networkmanager.

Create the file /etc/NetworkManager/dispatcher.d/ with the contents:

mount -a -t nfs

And then setup its permissions and make it executable:

chown root:root /etc/NetworkManager/dispatcher.d/
chmod +x /etc/NetworkManager/dispatcher.d/

The script will be run on every time the NetworkManager establishes a connection. The NFS mounts specified in the fstab file will be mounted. This works best for desktop computers that connect a single network.


No comments have been added so far.

Email is not displayed anywhere.
URLs (max 3) starting with http:// or https:// can be used. Use @Name to mention someone.