Posted by: kuanhoong | 22/04/2009

How to mount NFS Filesystems at Boot Time

Network File System (NFS) is a network file system protocol originally developed by Sun Microsystems in 1984. With NFS, clients can mount filesystems across the network that are being offered by NFS servers and can work with them as if they were filesystems mounted from local disks. NFS is a simple and widely used method of sharing files across the network.

It is possible that you may want to mount particular NFS filesystems at boot time. You may also want to allow non-root users on the client to mount NFS shares themselves. In either of these cases, you will need to include a suitable entry in the file /etc/fstab. Just as this file controls the local filesystems that are to be mounted, it can also control the mounting of NFS shares.

For example, with this entry in /etc/fstab on the client:

susetips:/test /testmount nfs user,noauto,ro 0 0

any user on the client can mount (read-only) the specified directory from susetips on the specified mount point simply by issuing the command mount /testmount.

To force the directory to be mounted automatically, you might use the following:

susetips:/test /testmount nfs rw 0 0

This line in /etc/fstab ensures that the NFS share is mounted read-write whenever the system boots, provided that the service nfs is set to start in runlevel 3 on the client.


Leave a comment

Categories