Linux客户端挂载文件系统

<p>&nbsp;</p> <p><a id="方法一:手动挂载" name="方法一:手动挂载"><span style="font-size:16px"><strong>方法一:手动挂载</strong></span></a></p> <p><span style="font-size:16px"><strong>操作步骤</strong></span></p> <p>1.&nbsp;&nbsp;&nbsp; 使用SSH等工具进入Linux客户端的命令行模式。</p> <p>2.&nbsp;&nbsp;&nbsp; 检测及安装NFS客户端软件包。</p> <ul> <li>检测是否已经安装NFS客户端软件包:</li> </ul> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp;&nbsp;&nbsp; </span># rpm -qa | egrep &quot;nfs|rpcbind&quot;&nbsp;&nbsp;</td> </tr> </tbody> </table> <ul> <li>安装所需的客户端NFS软件包:</li> </ul> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp;&nbsp;&nbsp; </span># yum install -y nfs-utils&nbsp; rpcbind</td> </tr> </tbody> </table> <p>3.&nbsp;&nbsp;&nbsp; 增加挂载目录,执行如下命令:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp;&nbsp;&nbsp; # mkdir /tmp/test&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span></td> </tr> </tbody> </table> <p>4.&nbsp;&nbsp;&nbsp; 执行挂载命令,本例中服务器IP为:10.10.10.10,共享目录为:/tmp/servertest:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp;</span>&nbsp; # mount -t nfs 10.10.10.10:/tmp/servertest /tmp/test -o rw,soft,intr,rsize=32768,wsize=32768,tcp,timeo=300<span style="font-family:Consolas">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span></td> </tr> </tbody> </table> <p>5.&nbsp;&nbsp;&nbsp; 进入目录验证,并创建新的文件,执行命令如下:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp;&nbsp;</span>&nbsp; &nbsp;# cd /tmp/test <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # touch /tmp/test/test.txt<span style="font-family:Consolas">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span></p> </td> </tr> </tbody> </table> <p>&nbsp;</p> <p>&nbsp;</p> <p><a name="方法二:自动挂载"><span style="font-size:16px"><strong>方法二:自动挂载</strong></span></a></p> <p><a name="CentOS6.X 客户端配置自动挂载"><span style="font-size:16px"><strong>CentOS6.X 客户端配置自动挂载</strong></span></a></p> <p>对CentOS6.X客户端,设置cloud NAS卷自动挂载,本例中客户端挂载目录为/efsclient/test,服务器的IP为10.10.10.10,服务器卷的路径为/tmp/servertest,进入客户端的命令行。</p> <p><span style="font-size:16px"><strong>操作步骤</strong></span></p> <p>1.&nbsp;&nbsp;&nbsp; 以root用户登录系统;如果当前用户不是root用户:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; </span>&nbsp;# sudo su<span style="font-family:Consolas">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span></td> </tr> </tbody> </table> <p>然后输入当前用户的密码。</p> <p>2.&nbsp;&nbsp;&nbsp; 安装autofs软件包:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># yum -y install autofs</td> </tr> </tbody> </table> <p>3.&nbsp;&nbsp;&nbsp; 查看是否配置过automount:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># cat /etc/auto.nfsc</td> </tr> </tbody> </table> <p>查看主机是否已经挂载过其他cloud NAS卷,如果没有配置过,需要执行以下步骤,如果已经配置过,只需执行8~9步即可:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># df -t nfs -Ph</td> </tr> </tbody> </table> <p>4.&nbsp;&nbsp;&nbsp; 查看/etc/sysctl.conf:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># cat /etc/sysctl.conf</td> </tr> </tbody> </table> <p>如无以下配置,需要执行如下命令,先备份sysctl.conf</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># cp -p /etc/sysctl.conf /etc/sysctl.conf.`date +%F_%T`</td> </tr> </tbody> </table> <p>写入配置:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># echo &quot;net.core.rmem_default = 2621440&quot; &raquo; /etc/sysctl.conf <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # echo &quot;net.core.wmem_default = 2621440&quot; &raquo; /etc/sysctl.conf</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # echo &quot;net.core.rmem_max = 2621440&quot; &raquo; /etc/sysctl.conf</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # echo &quot;net.core.wmem_max = 2621440&quot; &raquo; /etc/sysctl.conf</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # echo &quot;net.ipv4.tcp_rmem = 4096 655360 2621440&quot; &raquo; /etc/sysctl.conf</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # echo &quot;net.ipv4.tcp_wmem = 4096 655360 2621440&quot; &raquo; /etc/sysctl.conf</p> </td> </tr> </tbody> </table> <p>使配置立即生效:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># sysctl -p</td> </tr> </tbody> </table> <p>5.&nbsp;&nbsp;&nbsp; 检查portmap(rpcbind)和nfslock服务并配置</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 启动rpcbind服务:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># service rpcbind start</td> </tr> </tbody> </table> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 查看rpcbind服务:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span> # service rpcbind status</td> </tr> </tbody> </table> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 设置rpcbind服务开机自启动:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># chkconfig rpcbind on</td> </tr> </tbody> </table> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 列出rpcbind服务信息:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># chkconfig --list rpcbind</td> </tr> </tbody> </table> <p>6.&nbsp;&nbsp;&nbsp; 设置自动挂载</p> <p>备份自动挂载配置文件:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># cp -p /etc/auto.master /etc/auto.master.`date +%F_%T`</td> </tr> </tbody> </table> <p>写入配置:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># echo &quot;/efsclient /etc/auto.nfsc &ndash;timeout=60&quot; &raquo; /etc/auto.master</td> </tr> </tbody> </table> <p>查看并启用配置:</p> <p>列出autofs服务信息:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span> # chkconfig --list autofs</td> </tr> </tbody> </table> <p>&nbsp; &nbsp;&nbsp;设置autofs服务开机自启动:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># chkconfig autofs on</td> </tr> </tbody> </table> <p>列出autofs服务信息:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># chkconfig --list autofs</td> </tr> </tbody> </table> <p>开启服务:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># service autofs start</td> </tr> </tbody> </table> <p>&nbsp; &nbsp; &nbsp; &nbsp;7.&nbsp;&nbsp;&nbsp; 配置auto.nfsc文件:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># vi auto.nfsc</td> </tr> </tbody> </table> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 写入卷信息:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span> test -rw,soft,intr,rsize=32768,wsize=32768,tcp,timeo=300 10.10.10.10:/tmp/servertest</td> </tr> </tbody> </table> <p>保存auto.nfsc</p> <p>说明:</p> <p>第一段test为os本地目录挂载点;</p> <p>第二段为挂载参数:rw为读写模式、ro为只读模式;</p> <p>第三段10.10.10.10:/tmp/servertest是cloud NAS卷路径。</p> <p>使配置生效:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># service autofs reload</td> </tr> </tbody> </table> <p>8.&nbsp;&nbsp;&nbsp; 触发automount自动挂卷:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># ls -dl /efsclient/test/</td> </tr> </tbody> </table> <p>9.&nbsp;&nbsp;&nbsp; 验证挂载是否成功,若能看到挂载的信息,表示挂载成功:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># df &ndash;t nfs &ndash;Ph | grep /tmp/servertest</td> </tr> </tbody> </table> <p>验证读写:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># touch /efsclient/test/test.txt</td> </tr> </tbody> </table> <p>&nbsp;</p> <p><a name="CentOS7.X 客户端配置自动挂载"><span style="font-size:16px"><strong>CentOS7.X 客户端配置自动挂载</strong></span></a></p> <p>对CentOS7.X客户端,设置cloud NAS 卷自动挂载,本例中客户端挂载目录为/efsclient/test,服务器的IP为10.10.10.10,服务器卷的路径为/tmp/servertest,进入客户端的命令行。</p> <p><span style="font-size:16px"><strong>操作步骤</strong></span></p> <p>1.&nbsp;&nbsp;&nbsp; 以root用户登录系统;如果当前用户不是root用户:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># sudo su</td> </tr> </tbody> </table> <p>然后输入当前用户的密码。</p> <p>2.&nbsp;&nbsp;&nbsp; 安装autofs软件包:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># yum -y install autofs</td> </tr> </tbody> </table> <p>3.&nbsp;&nbsp;&nbsp; 查看是否配置过automount:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># cat /etc/auto.nfsc</td> </tr> </tbody> </table> <p>查看主机是否已经挂载过其他cloud NAS卷,如果没有配置过,需要执行以下步骤,如果已经配置过,只需执行8~9步即可:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span>df -t nfs -Ph</td> </tr> </tbody> </table> <p>4.&nbsp;&nbsp;&nbsp; 查看/etc/sysctl.conf:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># cat /etc/sysctl.conf</td> </tr> </tbody> </table> <p>如无以下配置,需要执行如下命令,先备份sysctl.conf:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># cp -p /etc/sysctl.conf /etc/sysctl.conf.`date +%F_%T`</td> </tr> </tbody> </table> <p>写入配置:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span>&nbsp;# echo &quot;net.core.rmem_default = 2621440&quot; &raquo; /etc/sysctl.conf <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # echo &quot;net.core.wmem_default = 2621440&quot; &raquo; /etc/sysctl.conf</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # echo &quot;net.core.rmem_max = 2621440&quot; &raquo; /etc/sysctl.conf</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # echo &quot;net.core.wmem_max = 2621440&quot; &raquo; /etc/sysctl.conf</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # echo &quot;net.ipv4.tcp_rmem = 4096 655360 2621440&quot; &raquo; /etc/sysctl.conf</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # echo &quot;net.ipv4.tcp_wmem = 4096 655360 2621440&quot; &raquo; /etc/sysctl.conf</p> </td> </tr> </tbody> </table> <p>使配置立即生效:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># sysctl -p</td> </tr> </tbody> </table> <p>5.&nbsp;&nbsp;&nbsp; 检查portmap(rpcbind)和nfslock服务并配置</p> <p>启动rpcbind服务:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># systemctl start rpcbind</td> </tr> </tbody> </table> <p>查看rpcbind服务状态:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># systemctl status rpcbind</td> </tr> </tbody> </table> <p>设置开机启动rpcbind服务:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># systemctl enable rpcbind</td> </tr> </tbody> </table> <p>列出所有rpcbind类型的unit:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># systemctl list-units &ndash;-type=service | grep rpcbind</td> </tr> </tbody> </table> <p>6.&nbsp;&nbsp;&nbsp; 设置自动挂载</p> <p>备份自动挂接配置文件:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># cp -p /etc/auto.master /etc/auto.master.`date +%F_%T`</td> </tr> </tbody> </table> <p>将信息写入配置文件:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># echo &quot;/efsclient /etc/auto.nfsc &ndash;timeout=60&quot; &raquo; /etc/auto.master</td> </tr> </tbody> </table> <p>查看并启用配置:</p> <p>列出autofs服务信息:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span> # systemctl list-units &ndash;-type=service | grep autofs</td> </tr> </tbody> </table> <p>设置autofs服务开机自启动:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># systemctl enable autofs</td> </tr> </tbody> </table> <p>列出autofs服务信息:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># systemctl list-units &ndash;-type=service | grep autofs</td> </tr> </tbody> </table> <p>开启autofs服务:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># systemctl start autofs</td> </tr> </tbody> </table> <p>7.&nbsp;&nbsp;&nbsp; 配置auto.nfsc文件:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># vi auto.nfsc</td> </tr> </tbody> </table> <p>写入卷信息:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span>test -rw,soft,intr,rsize=32768,wsize=32768,tcp,timeo=300 10.10.10.10:/tmp/servertest</td> </tr> </tbody> </table> <p>保存auto.nfsc</p> <p>说明:</p> <p>第一段test为客户端挂载点;</p> <p>第二段为挂载参数:rw为读写模式、ro为只读模式;</p> <p>第三段10.10.10.10:/tmp/servertest是cloud NAS卷路径;</p> <p>使配置生效:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># systemctl restart autofs</td> </tr> </tbody> </table> <p>8.&nbsp;&nbsp;&nbsp; 触发automount自动挂卷:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># ls -dl /efsclient/test/</td> </tr> </tbody> </table> <p>9.&nbsp;&nbsp;&nbsp; 验证挂载是否成功,若能看到挂载的信息,表示挂载成功:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># df -t nfs -Ph | grep /tmp/servertest</td> </tr> </tbody> </table> <p>验证读写:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:813px"> <tbody> <tr> <td style="background-color:#ededed; width:805px">&nbsp;<span style="font-family:Consolas">&nbsp; &nbsp;</span># touch /efsclient/test/test.txt</td> </tr> </tbody> </table> <p>&nbsp; &nbsp; &nbsp;</p>
以上内容是否解决了您的问题?
请补全提交信息!
咨询·建议

电话咨询

400-151-8800

邮件咨询

cloud@pingan.com

在线客服

工单支持

解决云产品相关技术问题