Docs
ufs
Operation Guide
Mount file system
Linux

Mounting File Systems (Linux)

NFS

Step 1: Install NFS Client

  1. Before installing the NFS client, please confirm that you are using the recommended kernel version according to the information in the Linux NFS client kernel defect section, otherwise the host may experience IO freezes.

    If it is a CentOS host, execute the following command to install the NFS client:

     sudo yum install nfs-utils
    

    If it is an Ubuntu host, execute the following command to install the NFS client:

     sudo apt-get install nfs-common
    
  2. Since the NFS client defaults to limit the number of concurrent NFS requests that can be initiated, and the default allowed concurrent request number is 2, which has a major impact on performance, you can refer to how to modify the concurrent number of NFS requests? to modify it to improve performance.

Step 2: Mount File System

  1. Please operate according to the mount point information displayed in the “Manage Mount Point” operation. The following shows the mounting operation with the file system ID ufs-dh6tds as an example, assuming its mount point IP is 10.8.0.1 (please replace the relevant parameters in the example with the file system ID and mount point IP you want to use during actual operation).

    Execute the following command to mount using the nfsv3 protocol

     sudo mount -t nfs -o rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,nfsvers=3,proto=tcp,mountproto=tcp,nolock,noacl 10.8.0.1:/ /mnt
    

    Execute the following command to mount using the nfsv4 protocol

     sudo mount -t nfs -o rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport 10.8.0.1:/ /mnt
    

The meanings of various parameters in the mount command are as follows:

Parameter/Option NameDescription
Mount PointThe entry point for accessing the file system. The UFS mount point is represented by an IPv4 address.
rsize,wsizeIt is used to specify the block size of data when interacting with the file storage server (in Bytes). It is recommended to set 1048576.
hardIt instructs the NFS client to continue retrying operations to the remote file storage when it is temporarily unavailable, rather than returning an error to the upper layer application. It is recommended to enable this option, which can enhance the fault tolerance of long-running tasks and high-cost interruption operations to temporary failures on network and other aspects.
timeoThe time that the NFS client waits before retrying the request to the remote file storage, in units of 0.1 seconds. It is recommended to set the value to 600.
retransThe number of retries of a request by the NFS client. It is recommended to set this to 2.
noresvportUse a new port during network interruption reconnection, which can reduce the probability of reconnection failure. It is recommended to enable it.

Step 3: View Mount Result

  1. After the mount command is executed, you can list the current mounted file system list by executing mount -l or nfsstat -m. If the list contains the file system to be mounted, then the mounting is successful.

Step 4: Set to Mount Automatically

  1. We can implement automatic mounting of NFS file systems by configuring the /etc/fstab file in the Linux system. v4 protocol automatic mounting

     10.8.0.1:/ /mnt nfs rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,_netdev,noresvport 0 0
    

    v3 protocol automatic mounting

     10.8.0.1:/ /mnt nfs rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,nfsvers=3,proto=tcp,mountproto=tcp,nolock,noacl,_netdev,noresvport 0 0
    

The meanings of various parameters in the command are as follows:

Parameter/Option NameDescription
_netdevIndicates that the file system to be mounted is a network file system, to prevent from mounting operation before the network is ready, which may cause the host to freeze when booting up.
0 (first item after noresvport)If the value is not 0, it indicates that the file system should be backed up by dump. For NAS service, this item is 0.
0 (second item after noresvport)Indicates whether to perform the fsck operation after booting. Since the UFS product guarantees data persistence and consistency by the server, it is not necessary to enable this option.

SMB

Step 1: Install CIFS Client

  1. Before installing the CIFS client, please confirm that you are using the recommended kernel version according to the information in the Linux CIFS client kernel defect section, otherwise the host may experience IO freezes.

    If it is a CentOS host, execute the following command to install the CIFS client:

     sudo yum install cifs-utils
    

    If it is an Ubuntu host, execute the following command to install the CIFS client:

     sudo apt-get install cifs-utils
    

Step 2: Mount File System

  1. Please operate according to the mount point information displayed in the “Manage Mount Point” operation. The following shows the mounting operation with the file system ID ufs-dh6tds as an example, assuming its mount point IP is 10.8.0.1 (please replace the relevant parameters in the example with the file system ID and mount point IP you want to use during actual operation).

     sudo mount -t cifs  -o guest,uid=0,gid=0,rsize=1048576,wsize=1048576 //10.8.0.1/share /mnt
    

The meanings of various parameters in the mount command are as follows:

Parameter/Option NameDescription
guestOnly supports client mounting based on the ntlm authentication protocol
rsize,wsizeIt is used to specify the block size of data when interacting with the file storage server (in Bytes). It is recommended to set 1048576.
uidThe owner of the file after a successful mount. If uid is not set, uid will default to 0.
gidThe group to which the file belongs after a successful mount. If gid is not set, gid will default to 0.

Step 3: View Mount Result

  1. After the mount command is executed, you can list the current mounted file system list by executing mount -l. If the list contains the file system to be mounted, then the mounting is successful.

Step 4: Set to Mount Automatically

  1. We can implement automatic mounting of SMB file systems by configuring the /etc/fstab file in the Linux system.

     //10.8.0.1/share /mnt cifs guest,uid=0,gid=0,rsize=1048576,wsize=1048576 0 0