NFS Tutorial :: Clients
NFS clients can mount NFS volumes a couple of different ways:
To use it once, it may be easier just to manually use the mount command.
To have the volume mounted automatically at boot time, you can add an entry to /etc/fstab.
To have the volume automatically mounted whenever it's needed, you can use another utility called amd, the Automounting Daemon.
Manual mounting.
It may be advantageous, especially during testing, to simply mount an NFS export manually. It's pretty much like mounting anything:
mount -t nfs -o bg,rw,tcp,nfsvers=3,wsize=8192,rsize=8192
192.168.0.4:/mnt/storage /mnt/remote_storage
Here you see that other option in the NFS connection can be specified. For example, you can specify the protocol to be TCP or UDP. You can specify the NFS protocol version. You can even specify the packet size for reading and writing!
This command will mount the servers /mnt/storage directory on the clients /mnt/remote_storage mount point. The bg specifies that this connection process will run in the background while the server is deciding to do it or not.
Using fstab
To use /etc/fstab to mount automatically at boot, add this entry:
182.168.0.4:/mount/storage /mount/remote_storage nfs
bg,rw,tcp,nfsvers=3,wsize=8192,rsize=8192 0 0
The same options are available to you here.
Using the amd Automounter
Keep in mind that this NFS volume is mounted over a network. So if the network goes down for a second, regular mounting doesn't take so kindly to it. For a more robust system, you might want to try the the Automounter Daemon.
apt-get install am-utils
The amd automounter is configured by /etc/am-utils/amd.conf. Edit it to have these lines:
[global]
nfs_proto = tcp
nfs_vers = 3
map_options = rw,rsize=8192,wsize=8192
The same cusomizations are available here like in regular mounting. Restart amd when you are done.
/etc/init.d/am-utils restart
amd uses symbolic links and some automagical redirection to accomplish the mount. We basically make a symbolic link from a device that doens't really exist, to a mount point that doesn't really exist.
ln -s /net/192.168.0.4/mnt/storage /mnt/remote_storage
Notice here that there is NO colon after the server's IP. Also, the mount point MUST NOT EXIST. /mnt MUST EXIST, but the symbolic link in this case will create /remote_storage


