{"id":15861,"date":"2025-04-18T22:19:24","date_gmt":"2025-04-18T14:19:24","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/15861.html"},"modified":"2025-04-18T22:19:24","modified_gmt":"2025-04-18T14:19:24","slug":"%e3%80%90%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%9f%a5%e8%af%86%e3%80%91%e5%a6%82%e4%bd%95%e5%9c%a8linux%e7%b3%bb%e7%bb%9f%e4%b8%8a%e6%90%ad%e5%bb%ba%e4%b8%80%e4%b8%aanfs","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/15861.html","title":{"rendered":"\u3010\u670d\u52a1\u5668\u77e5\u8bc6\u3011\u5982\u4f55\u5728linux\u7cfb\u7edf\u4e0a\u642d\u5efa\u4e00\u4e2anfs"},"content":{"rendered":"<\/p>\n<h4>\u6587\u7ae0\u76ee\u5f55<\/h4>\n<ul>\n<li>\n<ul>\n<li>NFS\u7f51\u7edc\u7cfb\u7edf\u642d\u5efa<\/li>\n<li>\n<ul>\n<li>**1. \u51c6\u5907\u5de5\u4f5c**<\/li>\n<li>**2. \u670d\u52a1\u5668\u7aef\u914d\u7f6e**<\/li>\n<li>\n<ul>\n<li>**(1) \u5b89\u88c5 NFS \u670d\u52a1**<\/li>\n<li>**(2) \u521b\u5efa\u5171\u4eab\u76ee\u5f55**<\/li>\n<li>**(3) \u914d\u7f6e\u5171\u4eab\u89c4\u5219**<\/li>\n<li>**(4) \u751f\u6548\u914d\u7f6e\u5e76\u542f\u52a8\u670d\u52a1**<\/li>\n<li>**(5) \u9632\u706b\u5899\u914d\u7f6e**<\/li>\n<\/ul>\n<\/li>\n<li>**3. \u5ba2\u6237\u7aef\u914d\u7f6e**<\/li>\n<li>\n<ul>\n<li>**(1) \u5b89\u88c5 NFS \u5ba2\u6237\u7aef\u5de5\u5177**<\/li>\n<li>**(2) \u521b\u5efa\u672c\u5730\u6302\u8f7d\u70b9**<\/li>\n<li>**(3) \u6302\u8f7d NFS \u5171\u4eab\u76ee\u5f55**<\/li>\n<li>**(4) \u9a8c\u8bc1\u6302\u8f7d**<\/li>\n<li>**(5) \u8bbe\u7f6e\u5f00\u673a\u81ea\u52a8\u6302\u8f7d**<\/li>\n<\/ul>\n<\/li>\n<li>**4. \u5e38\u89c1\u95ee\u9898\u6392\u67e5**<\/li>\n<li>\n<ul>\n<li>**\u6743\u9650\u95ee\u9898**<\/li>\n<li>**\u9632\u706b\u5899\u6216\u7f51\u7edc\u95ee\u9898**<\/li>\n<li>**\u6302\u8f7d\u5931\u8d25**<\/li>\n<\/ul>\n<\/li>\n<li>**5. \u5b89\u5168\u5efa\u8bae**<\/li>\n<\/ul>\n<\/li>\n<li>NAS\u6302\u8f7d<\/li>\n<li>\n<ul>\n<li>**\u4e00\u3001\u51c6\u5907\u5de5\u4f5c**<\/li>\n<li>**\u4e8c\u3001\u624b\u52a8\u6302\u8f7dNAS**<\/li>\n<li>\n<ul>\n<li>**\u65b9\u6cd51&#xff1a;\u6302\u8f7dNFS\u5171\u4eab**<\/li>\n<li>**\u65b9\u6cd52&#xff1a;\u6302\u8f7dSMB\/CIFS\u5171\u4eab**<\/li>\n<\/ul>\n<\/li>\n<li>**\u4e09\u3001\u81ea\u52a8\u6302\u8f7d&#xff08;\u5f00\u673a\u81ea\u52a8\u6302\u8f7d&#xff09;**<\/li>\n<li>\n<ul>\n<li>**NFS\u81ea\u52a8\u6302\u8f7d**<\/li>\n<li>**SMB\/CIFS\u81ea\u52a8\u6302\u8f7d**<\/li>\n<\/ul>\n<\/li>\n<li>**\u56db\u3001\u9a8c\u8bc1\u6302\u8f7d**<\/li>\n<li>**\u4e94\u3001\u5378\u8f7dNAS**<\/li>\n<li>**\u516d\u3001\u5e38\u89c1\u95ee\u9898**<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>NFS\u7f51\u7edc\u7cfb\u7edf\u642d\u5efa<\/h3>\n<p>\u5728 Linux \u7cfb\u7edf\u4e0a\u642d\u5efa NFS&#xff08;Network File System&#xff09;\u7684\u8be6\u7ec6\u6b65\u9aa4\u5982\u4e0b&#xff1a;<\/p>\n<h4>1. \u51c6\u5907\u5de5\u4f5c<\/h4>\n<ul>\n<li>\u670d\u52a1\u5668\u7aef&#xff1a;\u63d0\u4f9b\u5171\u4eab\u76ee\u5f55\u7684\u673a\u5668\u3002<\/li>\n<li>\u5ba2\u6237\u7aef&#xff1a;\u8bbf\u95ee\u5171\u4eab\u76ee\u5f55\u7684\u673a\u5668\u3002<\/li>\n<li>\u7f51\u7edc\u4e92\u901a&#xff1a;\u786e\u4fdd\u670d\u52a1\u5668\u548c\u5ba2\u6237\u7aef\u5728\u540c\u4e00\u4e2a\u7f51\u7edc&#xff0c;\u9632\u706b\u5899\u5141\u8bb8 NFS \u76f8\u5173\u6d41\u91cf&#xff08;\u9ed8\u8ba4\u4f7f\u7528 TCP\/UDP 2049 \u7aef\u53e3&#xff09;\u3002<\/li>\n<\/ul>\n<h4>2. \u670d\u52a1\u5668\u7aef\u914d\u7f6e<\/h4>\n<h5>(1) \u5b89\u88c5 NFS \u670d\u52a1<\/h5>\n<p>\u6839\u636e Linux \u53d1\u884c\u7248\u9009\u62e9\u5b89\u88c5\u547d\u4ee4&#xff1a;<\/p>\n<ul>\n<li>\n<p>Ubuntu\/Debian&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> update<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> <span class=\"token function\">install<\/span> nfs-kernel-server\n <\/li>\n<li>\n<p>CentOS\/RHEL&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> yum <span class=\"token function\">install<\/span> nfs-utils\n <\/li>\n<\/ul>\n<h5>(2) \u521b\u5efa\u5171\u4eab\u76ee\u5f55<\/h5>\n<p>\u9009\u62e9\u4e00\u4e2a\u76ee\u5f55\u4f5c\u4e3a\u5171\u4eab\u5b58\u50a8&#xff08;\u4f8b\u5982 \/data\/nfs_share&#xff09;&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">mkdir<\/span> <span class=\"token parameter variable\">-p<\/span> \/data\/nfs_share<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">chown<\/span> nobody:nogroup \/data\/nfs_share  <span class=\"token comment\"># \u8bbe\u7f6e\u6743\u9650&#xff08;\u6839\u636e\u9700\u6c42\u8c03\u6574&#xff09;<\/span><\/p>\n<h5>(3) \u914d\u7f6e\u5171\u4eab\u89c4\u5219<\/h5>\n<p>\u7f16\u8f91 NFS \u914d\u7f6e\u6587\u4ef6 \/etc\/exports&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> \/etc\/exports<\/p>\n<p>\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9&#xff08;\u793a\u4f8b\u5141\u8bb8\u6240\u6709\u5ba2\u6237\u7aef\u8bfb\u5199&#xff09;&#xff1a;<\/p>\n<p>\/data\/nfs_share *<span class=\"token punctuation\">(<\/span>rw,sync,no_subtree_check,no_root_squash<span class=\"token punctuation\">)<\/span><\/p>\n<ul>\n<li>\u53c2\u6570\u8bf4\u660e&#xff1a;\n<ul>\n<li>rw&#xff1a;\u5141\u8bb8\u8bfb\u5199\u3002<\/li>\n<li>sync&#xff1a;\u540c\u6b65\u5199\u5165&#xff0c;\u4fdd\u8bc1\u6570\u636e\u4e00\u81f4\u6027\u3002<\/li>\n<li>no_subtree_check&#xff1a;\u7981\u7528\u5b50\u76ee\u5f55\u68c0\u67e5&#xff08;\u63d0\u9ad8\u6027\u80fd&#xff09;\u3002<\/li>\n<li>no_root_squash&#xff1a;\u5141\u8bb8\u5ba2\u6237\u7aef root \u7528\u6237\u4fdd\u7559\u6743\u9650&#xff08;\u8c28\u614e\u4f7f\u7528&#xff09;\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h5>(4) \u751f\u6548\u914d\u7f6e\u5e76\u542f\u52a8\u670d\u52a1<\/h5>\n<p><span class=\"token function\">sudo<\/span> exportfs <span class=\"token parameter variable\">-a<\/span>  <span class=\"token comment\"># \u5e94\u7528\u6240\u6709 exports \u914d\u7f6e<\/span><br \/>\n<span class=\"token function\">sudo<\/span> systemctl start nfs-server  <span class=\"token comment\"># Ubuntu\/Debian<\/span><br \/>\n<span class=\"token function\">sudo<\/span> systemctl start nfs         <span class=\"token comment\"># CentOS\/RHEL<\/span><br \/>\n<span class=\"token function\">sudo<\/span> systemctl <span class=\"token builtin class-name\">enable<\/span> nfs-server <span class=\"token comment\"># \u8bbe\u7f6e\u5f00\u673a\u81ea\u542f<\/span><\/p>\n<h5>(5) \u9632\u706b\u5899\u914d\u7f6e<\/h5>\n<p>\u5f00\u653e NFS \u76f8\u5173\u7aef\u53e3&#xff08;\u4ee5 firewalld \u4e3a\u4f8b&#xff09;&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> firewall-cmd <span class=\"token parameter variable\">&#8211;permanent<\/span> &#8211;add-service<span class=\"token operator\">&#061;<\/span>nfs<br \/>\n<span class=\"token function\">sudo<\/span> firewall-cmd <span class=\"token parameter variable\">&#8211;permanent<\/span> &#8211;add-service<span class=\"token operator\">&#061;<\/span>mountd<br \/>\n<span class=\"token function\">sudo<\/span> firewall-cmd <span class=\"token parameter variable\">&#8211;permanent<\/span> &#8211;add-service<span class=\"token operator\">&#061;<\/span>rpc-bind<br \/>\n<span class=\"token function\">sudo<\/span> firewall-cmd <span class=\"token parameter variable\">&#8211;reload<\/span><\/p>\n<h4>3. \u5ba2\u6237\u7aef\u914d\u7f6e<\/h4>\n<h5>(1) \u5b89\u88c5 NFS \u5ba2\u6237\u7aef\u5de5\u5177<\/h5>\n<ul>\n<li>\n<p>Ubuntu\/Debian&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> <span class=\"token function\">install<\/span> nfs-common\n <\/li>\n<li>\n<p>CentOS\/RHEL&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> yum <span class=\"token function\">install<\/span> nfs-utils\n <\/li>\n<\/ul>\n<h5>(2) \u521b\u5efa\u672c\u5730\u6302\u8f7d\u70b9<\/h5>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">mkdir<\/span> <span class=\"token parameter variable\">-p<\/span> \/mnt\/nfs_client<\/p>\n<h5>(3) \u6302\u8f7d NFS \u5171\u4eab\u76ee\u5f55<\/h5>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">mount<\/span> <span class=\"token parameter variable\">-t<\/span> nfs \u670d\u52a1\u5668IP:\/data\/nfs_share \/mnt\/nfs_client<\/p>\n<h5>(4) \u9a8c\u8bc1\u6302\u8f7d<\/h5>\n<p>\u68c0\u67e5\u6302\u8f7d\u662f\u5426\u6210\u529f&#xff1a;<\/p>\n<p><span class=\"token function\">df<\/span> <span class=\"token parameter variable\">-h<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> nfs<\/p>\n<p>\u6216\u5199\u5165\u6d4b\u8bd5\u6587\u4ef6&#xff1a;<\/p>\n<p><span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;NFS Test&#034;<\/span> <span class=\"token operator\">&gt;<\/span> \/mnt\/nfs_client\/test.txt<\/p>\n<h5>(5) \u8bbe\u7f6e\u5f00\u673a\u81ea\u52a8\u6302\u8f7d<\/h5>\n<p>\u7f16\u8f91 \/etc\/fstab \u6587\u4ef6&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> \/etc\/fstab<\/p>\n<p>\u6dfb\u52a0\u4ee5\u4e0b\u884c&#xff1a;<\/p>\n<p>\u670d\u52a1\u5668IP:\/data\/nfs_share \/mnt\/nfs_client nfs defaults <span class=\"token number\">0<\/span> <span class=\"token number\">0<\/span><\/p>\n<h4>4. \u5e38\u89c1\u95ee\u9898\u6392\u67e5<\/h4>\n<h5>\u6743\u9650\u95ee\u9898<\/h5>\n<ul>\n<li>\u786e\u4fdd\u670d\u52a1\u5668\u5171\u4eab\u76ee\u5f55\u7684\u6743\u9650\u5141\u8bb8\u5ba2\u6237\u7aef\u8bbf\u95ee&#xff08;\u53ef\u901a\u8fc7 chmod \u6216 chown \u8c03\u6574&#xff09;\u3002<\/li>\n<li>\u82e5\u5ba2\u6237\u7aef\u65e0\u6cd5\u5199\u5165&#xff0c;\u68c0\u67e5\u670d\u52a1\u5668\u7aef \/etc\/exports \u662f\u5426\u8bbe\u7f6e\u4e86 rw\u3002<\/li>\n<\/ul>\n<h5>\u9632\u706b\u5899\u6216\u7f51\u7edc\u95ee\u9898<\/h5>\n<ul>\n<li>\u4f7f\u7528 rpcinfo -p \u670d\u52a1\u5668IP \u68c0\u67e5 NFS \u670d\u52a1\u662f\u5426\u6b63\u5e38\u3002<\/li>\n<li>\u5728\u670d\u52a1\u5668\u7aef\u6267\u884c showmount -e \u67e5\u770b\u5171\u4eab\u76ee\u5f55\u662f\u5426\u53ef\u89c1\u3002<\/li>\n<\/ul>\n<h5>\u6302\u8f7d\u5931\u8d25<\/h5>\n<ul>\n<li>\u68c0\u67e5 NFS \u670d\u52a1\u72b6\u6001&#xff1a;systemctl status nfs-server\u3002<\/li>\n<li>\u67e5\u770b\u65e5\u5fd7&#xff1a;tail -f \/var\/log\/messages&#xff08;CentOS&#xff09;\u6216 \/var\/log\/syslog&#xff08;Ubuntu&#xff09;\u3002<\/li>\n<\/ul>\n<h4>5. \u5b89\u5168\u5efa\u8bae<\/h4>\n<ul>\n<li>\u9650\u5236\u5ba2\u6237\u7aef\u8303\u56f4&#xff1a;\u5728 \/etc\/exports \u4e2d\u6307\u5b9a\u5177\u4f53 IP \u6216\u7f51\u6bb5&#xff08;\u5982 192.168.1.0\/24&#xff09;\u3002<\/li>\n<li>\u907f\u514d\u4f7f\u7528 no_root_squash&#xff1a;\u9632\u6b62\u5ba2\u6237\u7aef root \u7528\u6237\u62e5\u6709\u670d\u52a1\u5668 root \u6743\u9650\u3002<\/li>\n<li>\u542f\u7528 NFSv4&#xff1a;\u5728 \/etc\/nfs.conf \u4e2d\u8bbe\u7f6e vers4.2&#xff08;\u6027\u80fd\u66f4\u597d\u4e14\u66f4\u5b89\u5168&#xff09;\u3002<\/li>\n<\/ul>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4&#xff0c;\u4f60\u53ef\u4ee5\u5728 Linux \u7cfb\u7edf\u4e0a\u5feb\u901f\u642d\u5efa\u5e76\u914d\u7f6e NFS \u5171\u4eab\u670d\u52a1\u3002<\/p>\n<h3>NAS\u6302\u8f7d<\/h3>\n<p>\u5728Linux\u7cfb\u7edf\u4e2d\u6302\u8f7dNAS&#xff08;\u7f51\u7edc\u9644\u52a0\u5b58\u50a8&#xff09;\u901a\u5e38\u53ef\u4ee5\u901a\u8fc7NFS&#xff08;Network File System&#xff09;\u6216SMB\/CIFS&#xff08;Server Message Block\/Common Internet File System&#xff09;\u534f\u8bae\u5b9e\u73b0\u3002\u4ee5\u4e0b\u662f\u8be6\u7ec6\u6b65\u9aa4&#xff1a;<\/p>\n<h4>\u4e00\u3001\u51c6\u5907\u5de5\u4f5c<\/h4>\n<li>\n<p>\u786e\u8ba4NAS\u4fe1\u606f&#xff1a;<\/p>\n<ul>\n<li>NAS\u7684IP\u5730\u5740&#xff08;\u5982 192.168.1.100&#xff09;<\/li>\n<li>\u5171\u4eab\u8def\u5f84&#xff08;\u5982 \/share\/data \u6216 \/\/nas-server\/share&#xff09;<\/li>\n<li>\u8bbf\u95ee\u534f\u8bae&#xff08;NFS\/SMB&#xff09;<\/li>\n<li>\u7528\u6237\u540d\u548c\u5bc6\u7801&#xff08;\u5982\u679c\u9700\u8981\u8ba4\u8bc1&#xff09;<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5b89\u88c5\u4f9d\u8d56\u5de5\u5177&#xff1a;<\/p>\n<ul>\n<li>NFS&#xff1a;\u786e\u4fdd\u5df2\u5b89\u88c5NFS\u5ba2\u6237\u7aef\u5de5\u5177&#xff1a;<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> <span class=\"token function\">install<\/span> nfs-common      <span class=\"token comment\"># Debian\/Ubuntu<\/span><br \/>\n<span class=\"token function\">sudo<\/span> dnf <span class=\"token function\">install<\/span> nfs-utils       <span class=\"token comment\"># Fedora\/CentOS\/RHEL<\/span>\n <\/li>\n<li>SMB\/CIFS&#xff1a;\u5b89\u88c5cifs-utils&#xff1a;<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> <span class=\"token function\">install<\/span> cifs-utils      <span class=\"token comment\"># Debian\/Ubuntu<\/span><br \/>\n<span class=\"token function\">sudo<\/span> dnf <span class=\"token function\">install<\/span> cifs-utils      <span class=\"token comment\"># Fedora\/CentOS\/RHEL<\/span>\n <\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u521b\u5efa\u672c\u5730\u6302\u8f7d\u70b9&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> <span class=\"token function\">mkdir<\/span> <span class=\"token parameter variable\">-p<\/span> \/mnt\/nas\n <\/li>\n<h4>\u4e8c\u3001\u624b\u52a8\u6302\u8f7dNAS<\/h4>\n<h5>\u65b9\u6cd51&#xff1a;\u6302\u8f7dNFS\u5171\u4eab<\/h5>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">mount<\/span> <span class=\"token parameter variable\">-t<\/span> nfs <span class=\"token operator\">&lt;<\/span>NAS_IP<span class=\"token operator\">&gt;<\/span>:\/<span class=\"token operator\">&lt;<\/span>\u5171\u4eab\u8def\u5f84<span class=\"token operator\">&gt;<\/span> \/mnt\/nas<\/p>\n<p>\u793a\u4f8b&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">mount<\/span> <span class=\"token parameter variable\">-t<\/span> nfs <span class=\"token number\">192.168<\/span>.1.100:\/share\/data \/mnt\/nas<\/p>\n<h5>\u65b9\u6cd52&#xff1a;\u6302\u8f7dSMB\/CIFS\u5171\u4eab<\/h5>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">mount<\/span> <span class=\"token parameter variable\">-t<\/span> cifs <span class=\"token parameter variable\">-o<\/span> <span class=\"token assign-left variable\">username<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token operator\">&lt;<\/span>\u7528\u6237\u540d<span class=\"token operator\">&gt;<\/span>,password<span class=\"token operator\">&#061;<\/span><span class=\"token operator\">&lt;<\/span>\u5bc6\u7801<span class=\"token operator\">&gt;<\/span> \/\/<span class=\"token operator\">&lt;<\/span>NAS_IP<span class=\"token operator\">&gt;<\/span>\/<span class=\"token operator\">&lt;<\/span>\u5171\u4eab\u540d<span class=\"token operator\">&gt;<\/span> \/mnt\/nas<\/p>\n<p>\u793a\u4f8b&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">mount<\/span> <span class=\"token parameter variable\">-t<\/span> cifs <span class=\"token parameter variable\">-o<\/span> <span class=\"token assign-left variable\">username<\/span><span class=\"token operator\">&#061;<\/span>user1,password<span class=\"token operator\">&#061;<\/span>pass123 \/\/192.168.1.100\/myshare \/mnt\/nas<\/p>\n<p>\u5e38\u7528\u9009\u9879&#xff1a;<\/p>\n<ul>\n<li>vers&#061;3.0&#xff1a;\u6307\u5b9aSMB\u534f\u8bae\u7248\u672c&#xff08;\u5982vers&#061;2.0\u6216vers&#061;3.0&#xff09;\u3002<\/li>\n<li>uid&#061;1000&#xff1a;\u8bbe\u7f6e\u6302\u8f7d\u540e\u6587\u4ef6\u7684\u7528\u6237\u6240\u6709\u8005\u3002<\/li>\n<li>gid&#061;1000&#xff1a;\u8bbe\u7f6e\u6302\u8f7d\u540e\u6587\u4ef6\u7684\u7ec4\u6240\u6709\u8005\u3002<\/li>\n<li>file_mode&#061;0777&#xff1a;\u8bbe\u7f6e\u6587\u4ef6\u6743\u9650\u3002<\/li>\n<li>dir_mode&#061;0777&#xff1a;\u8bbe\u7f6e\u76ee\u5f55\u6743\u9650\u3002<\/li>\n<\/ul>\n<h4>\u4e09\u3001\u81ea\u52a8\u6302\u8f7d&#xff08;\u5f00\u673a\u81ea\u52a8\u6302\u8f7d&#xff09;<\/h4>\n<p>\u7f16\u8f91 \/etc\/fstab \u6587\u4ef6&#xff0c;\u6dfb\u52a0\u6302\u8f7d\u914d\u7f6e&#xff1a;<\/p>\n<h5>NFS\u81ea\u52a8\u6302\u8f7d<\/h5>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> \/etc\/fstab<\/p>\n<p>\u6dfb\u52a0\u884c&#xff1a;<\/p>\n<p>&lt;NAS_IP&gt;:\/&lt;\u5171\u4eab\u8def\u5f84&gt;  \/mnt\/nas  nfs  defaults,_netdev  0  0<\/p>\n<h5>SMB\/CIFS\u81ea\u52a8\u6302\u8f7d<\/h5>\n<p>\/\/&lt;NAS_IP&gt;\/&lt;\u5171\u4eab\u540d&gt;  \/mnt\/nas  cifs  username&#061;&lt;\u7528\u6237\u540d&gt;,password&#061;&lt;\u5bc6\u7801&gt;,vers&#061;3.0,_netdev  0  0<\/p>\n<p>\u8bf4\u660e&#xff1a;<\/p>\n<ul>\n<li>_netdev&#xff1a;\u786e\u4fdd\u6302\u8f7d\u5728\u7f51\u7edc\u5c31\u7eea\u540e\u8fdb\u884c\u3002<\/li>\n<li>\u82e5\u9700\u9690\u85cf\u5bc6\u7801&#xff0c;\u53ef\u5c06\u51ed\u636e\u4fdd\u5b58\u5230\u6587\u4ef6&#xff08;\u5982 \/etc\/smb.creds&#xff09;&#xff0c;\u5e76\u5728fstab\u4e2d\u4f7f\u7528credentials&#061;\/etc\/smb.creds\u3002<\/li>\n<\/ul>\n<hr \/>\n<h4>\u56db\u3001\u9a8c\u8bc1\u6302\u8f7d<\/h4>\n<li>\u67e5\u770b\u5df2\u6302\u8f7d\u7684\u6587\u4ef6\u7cfb\u7edf&#xff1a;<span class=\"token function\">df<\/span> <span class=\"token parameter variable\">-hT<\/span>\n <\/li>\n<li>\u68c0\u67e5\u6302\u8f7d\u70b9\u8bfb\u5199\u6743\u9650&#xff1a;<span class=\"token function\">touch<\/span> \/mnt\/nas\/testfile <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token function\">rm<\/span> \/mnt\/nas\/testfile\n <\/li>\n<hr \/>\n<h4>\u4e94\u3001\u5378\u8f7dNAS<\/h4>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">umount<\/span> \/mnt\/nas<\/p>\n<h4>\u516d\u3001\u5e38\u89c1\u95ee\u9898<\/h4>\n<li>\n<p>\u6743\u9650\u4e0d\u8db3&#xff1a;<\/p>\n<ul>\n<li>\u68c0\u67e5NAS\u5171\u4eab\u7684\u6743\u9650\u8bbe\u7f6e\u3002<\/li>\n<li>\u5728\u6302\u8f7d\u547d\u4ee4\u4e2d\u6307\u5b9auid\/gid\u6216file_mode\/dir_mode\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u534f\u8bae\u7248\u672c\u4e0d\u5339\u914d&#xff1a;<\/p>\n<ul>\n<li>\u5bf9\u4e8eSMB&#xff0c;\u5c1d\u8bd5\u6307\u5b9avers&#061;2.0\u6216vers&#061;3.0\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u7f51\u7edc\u4e0d\u53ef\u8fbe&#xff1a;<\/p>\n<ul>\n<li>\u68c0\u67e5NAS\u7684IP\u548c\u9632\u706b\u5899\u8bbe\u7f6e&#xff08;\u786e\u4fddNFS\/SMB\u7aef\u53e3\u5f00\u653e&#xff09;\u3002<\/li>\n<\/ul>\n<\/li>\n<p>\u901a\u8fc7\u4e0a\u8ff0\u6b65\u9aa4&#xff0c;\u60a8\u53ef\u4ee5\u8f7b\u677e\u5728Linux\u7cfb\u7edf\u4e2d\u6302\u8f7dNAS\u5b58\u50a8&#xff0c;\u5e76\u6839\u636e\u9700\u6c42\u9009\u62e9\u624b\u52a8\u6216\u81ea\u52a8\u6302\u8f7d\u65b9\u5f0f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e20\u6b21\uff0c\u6536\u85cf15\u6b21\u3002\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u4f60\u53ef\u4ee5\u5728 Linux \u7cfb\u7edf\u4e0a\u5feb\u901f\u642d\u5efa\u5e76\u914d\u7f6e NFS \u5171\u4eab\u670d\u52a1\u3002\u9009\u62e9\u4e00\u4e2a\u76ee\u5f55\u4f5c\u4e3a\u5171\u4eab\u5b58\u50a8\uff08\u4f8b\u5982\u3002\u5f00\u653e NFS \u76f8\u5173\u7aef\u53e3\uff08\u4ee5\u3002\u7f16\u8f91 NFS \u914d\u7f6e\u6587\u4ef6\u3002_linux\u521b\u5efanfs<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,406,870,43,867,44],"topic":[],"class_list":["post-15861","post","type-post","status-publish","format-standard","hentry","category-server","tag-linux","tag-nas","tag-nfs","tag-43","tag-867","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010\u670d\u52a1\u5668\u77e5\u8bc6\u3011\u5982\u4f55\u5728linux\u7cfb\u7edf\u4e0a\u642d\u5efa\u4e00\u4e2anfs - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/15861.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010\u670d\u52a1\u5668\u77e5\u8bc6\u3011\u5982\u4f55\u5728linux\u7cfb\u7edf\u4e0a\u642d\u5efa\u4e00\u4e2anfs - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e20\u6b21\uff0c\u6536\u85cf15\u6b21\u3002\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u4f60\u53ef\u4ee5\u5728 Linux \u7cfb\u7edf\u4e0a\u5feb\u901f\u642d\u5efa\u5e76\u914d\u7f6e NFS \u5171\u4eab\u670d\u52a1\u3002\u9009\u62e9\u4e00\u4e2a\u76ee\u5f55\u4f5c\u4e3a\u5171\u4eab\u5b58\u50a8\uff08\u4f8b\u5982\u3002\u5f00\u653e NFS \u76f8\u5173\u7aef\u53e3\uff08\u4ee5\u3002\u7f16\u8f91 NFS \u914d\u7f6e\u6587\u4ef6\u3002_linux\u521b\u5efanfs\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/15861.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T14:19:24+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/15861.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/15861.html\",\"name\":\"\u3010\u670d\u52a1\u5668\u77e5\u8bc6\u3011\u5982\u4f55\u5728linux\u7cfb\u7edf\u4e0a\u642d\u5efa\u4e00\u4e2anfs - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T14:19:24+00:00\",\"dateModified\":\"2025-04-18T14:19:24+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/15861.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/15861.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/15861.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010\u670d\u52a1\u5668\u77e5\u8bc6\u3011\u5982\u4f55\u5728linux\u7cfb\u7edf\u4e0a\u642d\u5efa\u4e00\u4e2anfs\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010\u670d\u52a1\u5668\u77e5\u8bc6\u3011\u5982\u4f55\u5728linux\u7cfb\u7edf\u4e0a\u642d\u5efa\u4e00\u4e2anfs - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/15861.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010\u670d\u52a1\u5668\u77e5\u8bc6\u3011\u5982\u4f55\u5728linux\u7cfb\u7edf\u4e0a\u642d\u5efa\u4e00\u4e2anfs - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e20\u6b21\uff0c\u6536\u85cf15\u6b21\u3002\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u4f60\u53ef\u4ee5\u5728 Linux \u7cfb\u7edf\u4e0a\u5feb\u901f\u642d\u5efa\u5e76\u914d\u7f6e NFS \u5171\u4eab\u670d\u52a1\u3002\u9009\u62e9\u4e00\u4e2a\u76ee\u5f55\u4f5c\u4e3a\u5171\u4eab\u5b58\u50a8\uff08\u4f8b\u5982\u3002\u5f00\u653e NFS \u76f8\u5173\u7aef\u53e3\uff08\u4ee5\u3002\u7f16\u8f91 NFS \u914d\u7f6e\u6587\u4ef6\u3002_linux\u521b\u5efanfs","og_url":"https:\/\/www.wsisp.com\/helps\/15861.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T14:19:24+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/15861.html","url":"https:\/\/www.wsisp.com\/helps\/15861.html","name":"\u3010\u670d\u52a1\u5668\u77e5\u8bc6\u3011\u5982\u4f55\u5728linux\u7cfb\u7edf\u4e0a\u642d\u5efa\u4e00\u4e2anfs - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T14:19:24+00:00","dateModified":"2025-04-18T14:19:24+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/15861.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/15861.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/15861.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010\u670d\u52a1\u5668\u77e5\u8bc6\u3011\u5982\u4f55\u5728linux\u7cfb\u7edf\u4e0a\u642d\u5efa\u4e00\u4e2anfs"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/15861","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=15861"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/15861\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=15861"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=15861"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=15861"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=15861"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}