next up previous contents
Next: Autofs: Automounting File System Up: Network File System Previous: Setting up an NFS   Contents

Setting Up NFS Client

  1. Mounting Exported File Systems

    On the client side, making those exported file systems available to it is quite simple. A system installed with Redhat Linux likely has NFS ready kernel. Put in another way, the linux kernel must support the foriegn file systems other than the native ext2, for example NFS, VFAT, iso9660 etc. to be operated under the kernel control. If you are lucky, you won't need to do anything further with the kernel to make this feature available.

    If everything goes well, you should be able (as root) enter a mount command to connect the remote file systems with your local file system. The new file systems wil be available as a mount point in the client file system structure. Using the previous example, the server side has published or exported the file system /usr/local to both cluster1 and cluster2 machines. The command below show how to mount /usr/local located on cluster3 as a mount point directory /mnt on cluster1 or cluster2. Note that you must telnet to either of these machines to execute the command below as root.

     
    # mount -tnfs cluster3:/usr/local /mnt
    

    Make sure you have the /mnt directory as a mount point. The file system is now available under /mnt and you can cd there, and ls in it, and look at the individual files. You will notice that it's not as fast as a local file system, but a lot more convenient than ftp. If, instead of mounting the file system, mount produces a error message like

     
    mount: cluster3:/usr/local failed, reason given by server: Permission denied
    
    then the exports file is wrong, or you forgot to run exportfs after editing the exports file. If it says
     
    mount clntudp_create: RPC: Program not registered
    
    it means that nfsd or mountd is not running on the server. This problem, however, may stem from the configuration of hosts.allow or hosts.deny which are used for preventing any unauthorized access. Please take a look at the document pertaining to the tcp-wrappers for more information. Finally, to unmount the file system is simply invoking

     
    # umount /mnt
    
  2. Mounting at boot time

    Recall that regular file systems can be detected and mounted every time a system gets reboot by modifying entries in /etc/fstab file. Like other file systems, NFS space can be mounted if the following entry is added to the fstab file (see man fstab).

     
    cluster3:/usr/local  /mnt    nfs        rsize=1024,wsize=1024 0    0
    
    To make your life easier, there are file system tools which allows us to modify this file given the template. If you are uncertain about what the modified file system, please look for a system administrative program like linuxconf etc.


next up previous contents
Next: Autofs: Automounting File System Up: Network File System Previous: Setting up an NFS   Contents
root 2002-09-30