21.2.2 Mounting an NFS File System

To mount an NFS file system on a client:

  1. Install the nfs-utils package:

    # yum install nfs-utils
  2. Use showmount -e to discover what file systems an NFS server exports, for example:

    # showmount -e host01.mydom.com
    Export list for host01.mydom.com
    /var/folder 192.0.2.102
    /usr/local/apps *
    /var/projects/proj1 192.168.1.0/24 mgmtpc
  3. Use the mount command to mount an exported NFS file system on an available mount point:

    # mount -t nfs -o ro,nosuid host01.mydoc.com:/usr/local/apps /apps

    This example mounts /usr/local/apps exported by host01.mydoc.com with read-only permissions on /apps. The nosuid option prevents remote users from gaining higher privileges by running a setuid program.

    By default, mount assumes NFS v4. To mount an NFS v3 volume (the default in Oracle Linux 5), use the following mount options:

    -o vers=3,mountproto=tcp

  4. To configure the system to mount an NFS file system at boot time, add an entry for the file system to /etc/fstab, for example:

    host01.mydoc.com:/usr/local/apps      /apps      nfs      ro,nosuid  0 0

For more information, see the mount(8), nfs(5), and showmount(8) manual pages.