19 November 2009

Mounting the NAS through NFS share.

Mounting NFS resources with the mount command

To mount a remote resource, provided the resource is shared and you can reach the server over the network, use the mount command. This may be done any time during client operations. However, you must be a privileged user to use mount.

To mount NFS resources, do the following:

  1. Create a mount point for the remote resource using the mkdir command.
    NOTE: As with a local mount, if you mount a remote resource on an existing directory that contains files and subdirectories, the contents of the directory are obscured.

  2. The syntax of the mount command, as it relates to an NFS mount, is:

    mount [-F nfs] [-o specific_options] {special | mount_point}

    mount [-F nfs] [-o specific_options] special mount_point

    Use the first form if you have entries in the /etc/vfstab file. See the mount(1Mnfs) manual page for details.

Resources accessed through the mount command stay mounted unless you unmount them with the umount command or exit init state 3. Also, if you exit and reenter init state 3, the resource will no longer be mounted (unless you edited the vfstab file to mount the resource automatically).

When you mount an NFS resource, we suggest that you do the following:

  • Use the hard option with any resource you mount read-write. Then, if a user is writing to a file when the server goes down, the write will continue when the server comes up again, and nothing will be lost. Refer to ``Hard and soft mounts'' for details of hard and soft NFS mounts.

  • Use the nosuid option with any resource you mount read-write, unless you have good reasons to do otherwise.
See ``Examples: mounting resources'' for an illustration of the mount command in use.

Hard and soft mounts

NFS supports two types of mounts -- hard mounts and soft mounts. If a mount is a hard mount, an NFS request affecting any part of the mounted resource is issued repeatedly until the request is satisfied (for example, the server crashes and comes back up at a later time). When a mount is a soft mount, an NFS request returns an error if it cannot be satisfied (for example, the server is down), then quits.

Examples: mounting resources


NOTE: The -F nfs option specified in these examples is not strictly required and could be omitted. Here it serves merely as a reminder of the filesystem type.

  • You want to soft mount online manual pages from remote machine dancer on the local directory /usr/man. You want the pages mounted read-only. Type the following command:

    mount -F nfs -o ro,soft dancer:/usr/man /usr/man/

  • You want to hard mount the resource /usr/local from the remote machine dancer on the mount-point /usr/local/dancer. You want the resource mounted read-write, with the set-uid bits ignored and the keyboard interrupt enabled. Enter the following, all on one line:

    mount -F nfs -o hard,nosuid,intr dancer:/usr/local /usr/local/dancer

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home