The Linux client mounts the file system

<p><span style="font-size:16px"><strong>Method 1: Manually mounting file systems</strong></span></p> <p><strong>Procedure</strong></p> <p>1. Use SSH or other tools to enter the command line mode of the Linux client.</p> <p>2. Detect and install the NFS client packages</p> <p>&middot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Detect if the NFS client packages are already installed.</p> <p># rpm -qa | egrep &quot;nfs|rpcbind&quot;</p> <ul> <li>Install the required client NFS packages</li> </ul> <p># yum install -y nfs-utils&nbsp; rpcbind</p> <p>3. Add the mount directory and execute the following command:</p> <p># mkdir /tmp/test</p> <p>4. Run the mount command. In this example, the server IP is 10.10.10.10 and the shared directory is: /tmp/servertest:</p> <p># mount -t nfs 10.10.10.10:/tmp/servertest /tmp/test -o rw,soft,intr,rsize=32768,wsize=32768,tcp,timeo=300</p> <p>5. Enter the directory for verification and create a new file. Execute the command as follows:</p> <p># cd /tmp/test</p> <p># touch /tmp/test/test.txt</p> <p>&nbsp;</p> <p><span style="font-size:16px"><strong>Method 2: Automounting file systems in CentOS</strong></span></p> <p><strong>CentOS6.X client configuration automounting</strong></p> <p>For the CentOS6.X client, set the cloud NAS volume to be mounted automatically. In this example, the client mount directory is /efsclient /test, the IP address of the server is 10.10.10.10, the path of the server volume is /tmp/servertest and then enter the command line of the client.</p> <p><strong>Procedure</strong></p> <p>1. Log in to the system as the root user; if the current user is not the root user,</p> <p># sudo su</p> <p>then enter the current user&#39;s password</p> <p>2. Install the autofs packages</p> <p># yum -y install autofs</p> <p>3. Check if automount is configured</p> <p># cat /etc/auto.nfsc</p> <p>Check whether the host has mounted other cloud NAS volumes. If it is not configured, you need to perform the following steps. If you have configured it, you only need to perform steps 8~9.</p> <p># df -t nfs -Ph</p> <p>4. View /etc/sysctl.conf</p> <p># cat /etc/sysctl.conf</p> <p>If you do not have the following configuration, you need to run the following command to back up sysctl.conf first.</p> <p># cp -p /etc/sysctl.conf /etc/sysctl.conf.`date +%F_%T`</p> <p>Write configuration:</p> <p># echo &quot;net.core.rmem_default = 2621440&quot; &raquo; /etc/sysctl.conf</p> <p># echo &quot;net.core.wmem_default = 2621440&quot; &raquo; /etc/sysctl.conf</p> <p># echo &quot;net.core.rmem_max = 2621440&quot; &raquo; /etc/sysctl.conf</p> <p># echo &quot;net.core.wmem_max = 2621440&quot; &raquo; /etc/sysctl.conf</p> <p># echo &quot;net.ipv4.tcp_rmem = 4096 655360 2621440&quot; &raquo; /etc/sysctl.conf</p> <p># echo &quot;net.ipv4.tcp_wmem = 4096 655360 2621440&quot; &raquo; /etc/sysctl.conf</p> <p>Make the configuration take effect immediately:</p> <p># sysctl -p</p> <p>5. Check the portmap (rpcbind) and nfslock services, and configure</p> <p>Start the rpcbind service:</p> <p># service rpcbind start</p> <p>Check out the rpcbind service:</p> <p># service rpcbind status</p> <p>Set the rpcbind service to autostart on boot:</p> <p># chkconfig rpcbind on</p> <p>List rpcbind service information:</p> <p># chkconfig --list rpcbind</p> <p>6. Set Automount</p> <p>Backup automount configuration file:</p> <p># cp -p /etc/auto.master /etc/auto.master.`date +%F_%T`</p> <p>Write configuration:</p> <p># echo &quot;/efsclient /etc/auto.nfsc &ndash;timeout=60&quot; &raquo; /etc/auto.master</p> <p>View and enable configuration:</p> <p>List service information for autofs:</p> <p># chkconfig --list autofs</p> <p>Set the autofs service to autostart on boot:</p> <p># chkconfig autofs on</p> <p>List service information for autofs:</p> <p># chkconfig --list autofs</p> <p>Start the service:</p> <p># service autofs start</p> <p>7. Configure the auto.nfsc file</p> <p># vi auto.nfsc</p> <p>Write volume information:</p> <p>test -rw,soft,intr,rsize=32768,wsize=32768,tcp,timeo=300 10.10.10.10:/tmp/servertest</p> <p>Save auto.nfsc</p> <p><strong>Note</strong>:</p> <p>The first test is the OS local directory mount point;</p> <p>The second test is the mount parameter: rw is the read-write mode and ro is the read-only mode;</p> <p>The third test 10.10.10.10: /tmp/servertest is the cloud NAS volume path.</p> <p>Make the configuration take effect:</p> <p># service autofs reload</p> <p>8. Trigger automount auto-hanging</p> <p># ls -dl /efsclient/test/</p> <p>9. Verify if the mount is successful. If you can see the mounted information, the mount is successful:</p> <p># df &ndash;t nfs &ndash;Ph | grep /tmp/servertest</p> <p>Verify read &amp; write:</p> <p># touch /efsclient/test/test.txt</p> <p>&nbsp;</p> <p><strong>CentOS7.X client configuration automounting</strong></p> <p>For the CentOS7.X client, set the cloud NAS volume to be mounted automatically. In this example, the client mount directory is /efsclient /test, the IP address of the server is 10.10.10.10, the path of the server volume is /tmp / servertest and then enter the command line of the client.</p> <p><strong>Procedure</strong></p> <p>1. Log in to the system as the root user; if the current user is not the root user,</p> <p># sudo su</p> <p>then enter the current user&#39;s password</p> <p>2. Install the autofs packages</p> <p># yum -y install autofs</p> <p>3. Check if automount is configured</p> <p># cat /etc/auto.nfsc</p> <p>Check whether the host has mounted other cloud NAS volumes. If it is not configured, you need to perform the following steps. If you have configured it, you only need to perform steps 8~9.</p> <p># df -t nfs -Ph</p> <p>4. View /etc/sysctl.conf</p> <p># cat /etc/sysctl.conf</p> <p>If you do not have the following configuration, you need to run the following command to back up sysctl.conf first.</p> <p># cp -p /etc/sysctl.conf /etc/sysctl.conf.`date +%F_%T`</p> <p>Write configuration:</p> <p># echo &quot;net.core.rmem_default = 2621440&quot; &raquo; /etc/sysctl.conf</p> <p># echo &quot;net.core.wmem_default = 2621440&quot; &raquo; /etc/sysctl.conf</p> <p># echo &quot;net.core.rmem_max = 2621440&quot; &raquo; /etc/sysctl.conf</p> <p># echo &quot;net.core.wmem_max = 2621440&quot; &raquo; /etc/sysctl.conf</p> <p># echo &quot;net.ipv4.tcp_rmem = 4096 655360 2621440&quot; &raquo; /etc/sysctl.conf</p> <p># echo &quot;net.ipv4.tcp_wmem = 4096 655360 2621440&quot; &raquo; /etc/sysctl.conf</p> <p>Make the configuration take effect immediately:</p> <p># sysctl -p</p> <p>5.Check the portmap (rpcbind) and nfslock services, and configure</p> <p>Start the rpcbind service:</p> <p># systemctl start rpcbind</p> <p>Check out the rpcbind service status:</p> <p># systemctl status rpcbind</p> <p>Set the rpcbind service to autostart on boot:</p> <p># systemctl enable rpcbind</p> <p>List all units of rpcbind type:</p> <p># systemctl list-units &ndash;-type=service | grep rpcbind</p> <p>6. Set Automount</p> <p>Backup automount configuration file:</p> <p># cp -p /etc/auto.master /etc/auto.master.`date +%F_%T`</p> <p>Write configuration:</p> <p># echo &quot;/efsclient /etc/auto.nfsc &ndash;timeout=60&quot; &raquo; /etc/auto.master</p> <p>View and enable configuration:</p> <p>List service information for autofs:</p> <p># systemctl list-units &ndash;-type=service | grep autofs</p> <p>Set the autofs service to autostart on boot:</p> <p># systemctl enable autofs</p> <p>List service information for autofs:</p> <p># systemctl list-units &ndash;-type=service | grep autofs</p> <p>Start the service:</p> <p># systemctl start autofs</p> <p>7. Configure the auto.nfsc file</p> <p># vi auto.nfsc</p> <p>Write volume information:</p> <p>test -rw,soft,intr,rsize=32768,wsize=32768,tcp,timeo=300 10.10.10.10:/tmp/servertest</p> <p>Save auto.nfsc</p> <p><strong>Note</strong>:</p> <p>The first test is the OS client mount point;</p> <p>The second test is the mount parameter: rw is the read-write mode and ro is the read-only mode;</p> <p>The third test 10.10.10.10: /tmp/servertest is the cloud NAS volume path.</p> <p>Make the configuration take effect:</p> <p># service autofs reload</p> <p>8. Trigger automount auto-hanging</p> <p># ls -dl /efsclient/test/</p> <p>9. Verify if the mount is successful. If you can see the mounted information, the mount is successful:</p> <p># df &ndash;t nfs &ndash;Ph | grep /tmp/servertest</p> <p>Verify read &amp; write:</p> <p># touch /efsclient/test/test.txt</p>
Did the above content solve your problem? Yes No
Please complete information!

Call us

400-151-8800

Email us

cloud@pingan.com

Online customer service

Instant reply

Technical Support

cloud products