NFS Server Client configuration in Linux practice

Source: Internet
Author: User

You can use the mount command or add entry items to/etc/fstab. The entry items in/etc/fstab include an NFS mount type. The NFS file system name consists of the host name of the file and the path name of the mounted directory. The two parts are separated by colons. For example, computer1:/home/project indicates that a file system is attached to/home/project in computer1.

It is recommended that the client use the mount command to mount the file. The following describes the knowledge and methods of mounting, and then describes how to directly edit the/etc/fstab file.

You can also modify multiple NFS-specific mounting options in the NFS entry. For example, you can specify the size of the round-trip data packet and the time when the computer waits for system response, or specify whether a file system is attached hard-mounted or soft-mounted ). For a hard mount file system, if the remote system response fails for some reason, the computer will continuously try to establish a connection. For a soft mount file system, in the same case, after the specified interval, the computer will give up trying to establish a connection and send an error message. By default, a hard mount file system is used. If the system's hard Mount attempt fails, the response to user input will also stop. Because of this, some users prefer soft mounting, which will stop the system from trying the mounting.

The format of the mount command is as follows:

Mount [-t vfstype] [-o options] device dir

The mount command has many parameters. The following are NFS-related parameters.

1)-a: Mount all the paths listed in/etc/fstab.

2)-t: Specifies the mount type, such as nfs.

3)-r: Set the mount path to read only.

4)-v mount: each operation in the process has a message sent back to the screen.

5) rsize = n: the number of bytes used by NFS when the NFS server reads files. The default value is 1 024 bytes.

6) wsize = n: number of bytes used by NFS when writing files to the NFS server. The default value is 1 024 bytes.

7) timeo = n: The number of 1st seconds that will be taken from timeout to 1/7 re-transfer. The default value is 7/7 seconds.

8) retry = n: the number of times that can be tried before the backend mount operation is abandoned. The default value is.

9) soft: Use soft mounting to mount the system. If the Client request does not receive a response, re-request and return an error message.

10) hard: mount the system by means of hard mounting. This value is the default value. Repeat the request until the NFS server responds.

11) intr: Allows NFS to interrupt file operations and return values to programs that call it. By default, file operations are not allowed to be interrupted.

12) fg: Repeat mounting at the prompt.

13) bg: if the file system fails to be mounted for 1st times, continue to try mounting in the background. The default value is not processed in the background after the failure.

14) tcp: mount the file system using TCP instead of the default UDP.

Note: Another important parameter for mounting NFS servers is hard) mount or soft) mount.

When hard mount is used, NFS customers continuously try to connect to the NFS server in the background without any prompt information) until it is mounted.

When soft mount is used, the system tries to connect to the NFS server on the foreground. When an error message is received, the system terminates the mount attempt and provides related information.

For example, hard mount:

# Mount-t nfs-o hard 192.168.1.4:/home/cao/home/nfs/cao

Hard or soft depends on the access information. For example, to view the video files of the NFS server, the system does not want to output a large number of error messages due to unexpected situations such as slow network speed. If the hard mode is used at this time, the system will wait until it can establish a new connection with the NFS server for transmission information. In addition, if it is non-critical data, you can also use the hard method, such as FTP data, so that the session will not be suspended when the remote machine is temporarily unable to connect to or close.

  1. Tips for Linux server network security management
  2. How to Use VNC to connect to a Linux Server
  3. Introduction to Web server setup in Linux

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.