Pages

Sunday, May 22, 2011

Mount a NFS resources with the mount command:

Mount a NFS resources with the mount command:

In aim to get access to the remote resource over network. One computer (lets call it server) should share it's resources, so they can be reached with nfs protocol over network. It can be done almost at any stage of work process however user to mount a nfs should be a privileged user.

 

To mount NFS resources, do the following:

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.

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 shall stay mounted ntill you unmount them manually with the umount command or exit init state 3. Also, if you reenter init state 3, the nfs resource will no longer be mounted (unless you edited the vfstab file to mount a nfs resource automatically).

 

When you mount a 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.

 

Hard and soft mounts

NFS supports two types of mounts -- hard mounts and soft mounts. If a mount a nfs with hard mount, 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 you mount a nfs with soft mount, a 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.

1. 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/

2. 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 

 

Visit Immigration Quebec Website

Mount a NFS

Mount a NFS resources with the mount command:

In aim to get access to the remote resource over network. One computer (lets call it server) should share it's resources, so they can be reached with nfs protocol over network. It can be done almost at any stage of work process however user to mount a nfs should be a privileged user.

To mount NFS resources, do the following:

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.

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 shall stay mounted ntill you unmount them manually with the umount command or exit init state 3. Also, if you reenter init state 3, the nfs resource will no longer be mounted (unless you edited the vfstab file to mount a nfs resource automatically).

When you mount a 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.

Hard and soft mounts

NFS supports two types of mounts -- hard mounts and soft mounts. If a mount a nfs with hard mount, 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 you mount a nfs with soft mount, a 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.

1. 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/

2. 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 

Visit Immigration Quebec Website