March 22, 2017

Linux Networking, Part 7: Implementing NFS - page 3

Sharing Data Between Machines

  • November 24, 2000
  • By William Wong

The NFS client support is done using the Linux mount application. The following is a sample command line for mounting an NFS directory:

mount -t nfs -o rsize=1024,wsize=1024 client:/mnt/an/nfs/vol /mnt/nfs

This command explicitly declares the type as NFS (-t nfs). The rsize and wsize options specify buffer sizes that should be multiples of 1024. They can be omitted but larger values reserve larger buffers than may improve performance. Other options allow a directory to be specified as read-only or they can prevent applications in the directory or subdirectories from running.

Dismounting a mounted NFS directory is done using the umount application. The following would dismount the /mnt/nfs directory.

umount /mnt/nfs

Mounting a shared directory can also be done when Linux starts up. In this case, an entry, like the following, is added to the /etc/fstab file. This file is also used for other file systems as well such as Samba file systems:

# device			mountpoint	fs-type	options			dump	fsckorder
client:/mnt/an/nfs/vol	/mnt/nfs		nfs	rsize=1024,wsize=1024	0	0

The linuxconf program can be used to make modifications to the /etc/fstab file.

NFS Status

The NFS status application is named nfsstat. It provides details about an NFS server's NFS client and server connection information. Running the application without options displays all information.

Sitemap | Contact Us