{"id":388,"date":"2018-09-18T11:59:25","date_gmt":"2018-09-18T03:59:25","guid":{"rendered":"https:\/\/hkc.nasclub.vip\/wordpress\/?p=388"},"modified":"2024-06-04T23:11:13","modified_gmt":"2024-06-04T15:11:13","slug":"linux%e5%a6%82%e4%bd%95%e8%ae%bf%e9%97%ae%e6%9c%ac%e5%9c%b0%e7%bd%91%e7%bb%9c%e4%b8%ad-synology-nas-%e4%b8%8a%e7%9a%84%e6%96%87%e4%bb%b6nfs","status":"publish","type":"post","link":"https:\/\/hkc.nasclub.vip\/?p=388","title":{"rendered":"Linux\u5982\u4f55\u8bbf\u95ee\u672c\u5730\u7f51\u7edc\u4e2d Synology NAS \u4e0a\u7684\u6587\u4ef6(NFS)"},"content":{"rendered":"<p><!--more-->1\u3001\u542f\u7528 Synology NAS \u4e0a\u7684 NFS<\/p>\n<ul>\n<li>\u4f7f\u7528\u5c5e\u4e8e <b>administrators<\/b> \u7fa4\u7ec4\u7684\u5e10\u6237\u767b\u5f55 DSM\u3002<\/li>\n<li>\u8fdb\u5165\u00a0 \u63a7\u5236\u9762\u677f \u2192 \u6587\u4ef6\u670d\u52a1\u3002<\/li>\n<\/ul>\n<p><img decoding=\"async\" title=\"001\" src=\"https:\/\/nas.swihp.cn:39997\/file\/wordpress\/linux\u6302\u8f7dnas\/001.png\" alt=\"001\" \/><\/p>\n<p>2\u3001\u4e3a\u5171\u4eab\u6587\u4ef6\u5939\u6307\u5b9a NFS \u6743\u9650<br \/>\n\u8fdb\u5165\u00a0 \u63a7\u5236\u9762\u677f \u2192\u5171\u4eab\u6587\u4ef6\u5939<\/p>\n<p><img decoding=\"async\" title=\"002\" src=\"https:\/\/nas.swihp.cn:39997\/file\/wordpress\/linux\u6302\u8f7dnas\/002.png\" alt=\"002\" \/><img decoding=\"async\" title=\"003\" src=\"https:\/\/nas.swihp.cn:39997\/file\/wordpress\/linux\u6302\u8f7dnas\/003.png\" alt=\"003\" \/><\/p>\n<p><strong><span style=\"color: #ff0000;\">\u4e0d\u8981\u7167\u6284\u6211\u7684\u914d\u7f6e\uff0c\u6839\u636e\u81ea\u5df1\u7684\u9700\u8981\u9009\u62e9\uff01\uff01\uff01<\/span><\/strong><\/p>\n<ul>\n<li><strong>\u4e3b\u673a\u540d\u6216 IP\uff1a<\/strong>\u8f93\u5165\u5c06\u8bbf\u95ee\u5171\u4eab\u6587\u4ef6\u5939\u4e4b NFS \u5ba2\u6237\u7aef\u7684 IP \u5730\u5740\u3002\u60a8\u53ef\u4ee5\u7528\u4e0b\u5217\u4e09\u79cd\u65b9\u5f0f\u586b\u5199\u6b64\u680f\uff1a\n<ul>\n<li><strong>\u5355\u4e00\u4e3b\u673a\uff1a<\/strong>\u5b8c\u5168\u5408\u683c\u7684\u57df\u540d\u6216 IP \u5730\u5740\u3002<\/li>\n<li><strong>\u4e07\u7528\u7b26\u53f7\uff1a<\/strong>*,* .synology.com<\/li>\n<li><strong>IP \u7f51\u7edc\uff1a<\/strong> 203.74.205.32\/255.255.252.0, \/24<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u6743\u9650\uff1a<\/strong>\u9009\u62e9 NFS \u5ba2\u6237\u7aef\u7684\u8bfb\u5199\u6743\u9650\u3002<\/li>\n<li><strong> \u5b89\u5168\u6027\uff1a<\/strong>\u6307\u5b9a\u8981\u5b9e\u65bd\u7684\u5b89\u5168\u7c7b\u578b\u3002\n<ul>\n<li><strong>AUTH_SYS\uff1a<\/strong>\u4f7f\u7528 NFS \u5ba2\u6237\u7aef\u7684 UID\uff08\u7528\u6237\u6807\u8bc6\u7b26\uff09\u548c GID\uff08\u7fa4\u7ec4\u6807\u8bc6\u7b26\uff09\u6765\u68c0\u67e5\u8bbf\u95ee\u6743\u9650\u3002<\/li>\n<li><strong>Kerberos \u9a8c\u8bc1\uff1a<\/strong>\u5f53 NFS \u5ba2\u6237\u7aef\u8fde\u63a5\u5230\u5171\u4eab\u6587\u4ef6\u5939\u65f6\u53ef\u6267\u884c Kerberos \u9a8c\u8bc1\u3002\u5ba2\u6237\u7aef\u5fc5\u987b\u901a\u8fc7 Kerberos \u9a8c\u8bc1\u624d\u80fd\u8bbf\u95ee\u5171\u4eab\u6587\u4ef6\u5939\u3002<\/li>\n<li><strong>Kerberos \u5b8c\u6574\u6027\uff1a<\/strong>\u4f20\u8f93\u6570\u636e\u65f6\u6267\u884c Kerberos \u9a8c\u8bc1\u5e76\u786e\u4fdd\u6570\u636e\u5305\u7684\u5b8c\u6574\u6027\u3002<\/li>\n<li><strong>Kerberos \u9690\u79c1\u6027\uff1a<\/strong>\u4f20\u8f93\u6570\u636e\u65f6\u6267\u884c Kerberos \u9a8c\u8bc1\u5e76\u5bf9 NFS \u6570\u636e\u5305\u8fdb\u884c\u52a0\u5bc6\u53ef\u6709\u52a9\u4e8e\u9632\u6b62\u6076\u610f\u5e72\u6270 NFS \u901a\u4fe1\u91cf\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>Squash\uff1a<\/strong>\u6b64\u680f\u53ef\u8ba9\u60a8\u63a7\u5236 NFS \u5ba2\u6237\u7aef\u7528\u6237\u7684\u8bbf\u95ee\u6743\u9650\u3002\u8bf7\u9009\u62e9\u4e0b\u5217\u9879\u76ee\u4e4b\u4e00\uff1a\n<ul>\n<li><strong>\u65e0\u6620\u5c04\uff1a<\/strong>\u5141\u8bb8 NFS \u5ba2\u6237\u7aef\u7684\u6240\u6709\u7528\u6237\uff08\u5305\u62ec\u6839\u7528\u6237\uff09\u4fdd\u6709\u539f\u59cb\u8bbf\u95ee\u6743\u9650\u3002<\/li>\n<li><strong>\u6620\u5c04 root \u4e3a admin\uff1a<\/strong>\u5c06\u8bbf\u95ee\u6743\u9650\u6307\u5b9a\u5230 NFS \u5ba2\u6237\u7aef\u7684 root \u7528\u6237\uff0c\u76f8\u5f53\u4e8e\u60a8\u7cfb\u7edf\u4e2d\u7684 admin \u7528\u6237\u8bbf\u95ee\u6743\u9650\u3002<\/li>\n<li><strong>\u6620\u5c04 root \u4e3a guest\uff1a<\/strong>\u5c06\u8bbf\u95ee\u6743\u9650\u6307\u5b9a\u5230 NFS \u5ba2\u6237\u7aef\u7684 root \u7528\u6237\uff0c\u76f8\u5f53\u4e8e\u60a8\u7cfb\u7edf\u4e2d\u7684 guest \u7528\u6237\u8bbf\u95ee\u6743\u9650\u3002<\/li>\n<li><strong>\u6620\u5c04\u6240\u6709\u7528\u6237\u4e3a admin\uff1a<\/strong>\u5c06\u8bbf\u95ee\u6743\u9650\u6307\u5b9a\u5230 NFS \u5ba2\u6237\u7aef\u7684\u6240\u6709\u7528\u6237\uff0c\u76f8\u5f53\u4e8e\u60a8\u7cfb\u7edf\u4e2d\u7684 admin \u7528\u6237\u8bbf\u95ee\u6743\u9650\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u5f02\u6b65\uff1a<\/strong>\u52fe\u9009\u6b64\u9009\u9879\u53ef\u8ba9\u60a8\u7684 Synology NAS \u5728\u5b8c\u6210\u5bf9\u6587\u4ef6\u7684\u66f4\u6539\u4e4b\u524d\u56de\u590d\u6765\u81ea NFS \u5ba2\u6237\u7aef\u7684\u8bf7\u6c42\uff0c\u5e76\u83b7\u5f97\u66f4\u597d\u7684\u6027\u80fd\u3002<\/li>\n<li><strong>\u5141\u8bb8\u975e\u7279\u6743\u7aef\u53e3\uff1a<\/strong>\u52fe\u9009\u8be5\u9009\u9879\u53ef\u8ba9 NFS \u5ba2\u6237\u7aef\u4f7f\u7528\u975e\u7279\u6743\u7aef\u53e3\u8fde\u63a5\u5230 Synology NAS\uff08\u5373\u5927\u4e8e 1024 \u7684\u7aef\u53e3\uff09\u3002<\/li>\n<\/ul>\n<p><img decoding=\"async\" title=\"005\" src=\"https:\/\/nas.swihp.cn:39997\/file\/wordpress\/linux\u6302\u8f7dnas\/005.png\" alt=\"005\" \/><\/p>\n<p>\u5b8c\u6210\u4e0a\u8ff0\u6b65\u9aa4\u540e\uff0c\u60a8\u53ef\u7528 NFS \u5ba2\u6237\u7aef\u88c5\u8f7d\u5171\u4eab\u6587\u4ef6\u5939\u3002(\u88c5\u8f7d\u8def\u5f84\u8981\u4fdd\u5b58\u4e0b\u6765\uff0c\u540e\u8fb9\u4f1a\u7528\u5230\uff09<\/p>\n<ol>\n<li>\u63a5\u4e0b\u6765\u5728\u60a8\u7684 Linux \u8ba1\u7b97\u673a\u4e2d\uff0c\u6253\u5f00\u547d\u4ee4\u63a7\u5236\u53f0\u3002(\u9996\u5148\u60a8\u7684linux\u5ba2\u6237\u7aef\u5df2\u7ecf\u914d\u7f6e\u597d\u88c5\u8f7d\u6587\u4ef6\u5939\u548c\u6743\u9650)<\/li>\n<li>\u6309\u5982\u4e0b\u683c\u5f0f\u8f93\u5165\u88c5\u8f7d\u547d\u4ee4\uff1a<br \/>\n<i>mount -t nfs [Synology NAS IP \u5730\u5740] : [\u5171\u4eab\u6587\u4ef6\u5939\u88c5\u8f7d\u8def\u5f84] \/ [NFS \u5ba2\u6237\u7aef\u88c5\u8f7d\u70b9]<\/i><br \/>\n<i>\u4f8b\uff1amount -t nfs 192.168.0.29:\/volume1\/test \/mnt\/nas\u00a0<\/i><\/li>\n<li>\u8f93\u5165\u78c1\u76d8\u7a7a\u95f4(df -h)\u547d\u4ee4\u67e5\u770b\u4ee5\u786e\u8ba4\u60a8\u5df2\u6210\u529f\u88c5\u8f7d\u8be5\u5171\u4eab\u6587\u4ef6\u5939\u3002<\/li>\n<\/ol>\n<p><img decoding=\"async\" title=\"007\" src=\"https:\/\/nas.swihp.cn:39997\/file\/wordpress\/linux\u6302\u8f7dnas\/007.png\" alt=\"007\" \/><\/p>\n<p>\u2460\u9996\u5148\u521b\u5efa\u6302\u8f7d\u76ee\u7684\u5730\u6587\u4ef6\u5939\u5e76\u5206\u914d\u6743\u9650<br \/>\n\u2461\u67e5\u770bNAS\u7aef\u662f\u5426\u6709\u53ef\u4ee5\u6302\u8f7d\u7684\u6587\u4ef6\u5939\uff1a showmount -e 192.168.0.29<br \/>\n\u2462\u5f00\u59cb\u6302\u8f7d<br \/>\n\/mnt\/nas \u662flinux\u4e2d\u7684\u6302\u8f7d\u4f4d\u7f6e<br \/>\n192.168.0.29:\/volume1\/test \u662fNAS\u7aef\u53ef\u4ee5\u6302\u8f7d\u7684NFS\u6587\u4ef6\u5939\u8def\u5f84<br \/>\n\u6267\u884c\u547d\u4ee4 <i>mount -t nfs 192.168.0.29:\/volume1\/test \/mnt\/nas<\/i><br \/>\n\u2463\u5f00\u673a\u81ea\u52a8\u6302\u8f7d vi \/etc\/fstab<br \/>\n\u52a0\u5165192.168.0.29:\/volume1\/test \/mnt\/nas nfs defaults 0 0<br \/>\n\u91cd\u542f\u7535\u8111\u9a8c\u8bc1\u5f00\u81ea\u5df1\u81ea\u52a8\u6302\u8f7d\u662f\u5426\u6210\u529f<br \/>\n\u6ce8\uff1a\u4e00\u3001fstab\u7b80\u4ecb<br \/>\nfstab\u6587\u4ef6\u4e2d\u5305\u542b\u4e86\u5404\u79cd\u5404\u6837\u7684\u6587\u4ef6\u7cfb\u7edf\u63cf\u8ff0\u4fe1\u606f\uff0c\u5b83\u53ef\u4ee5\u88ab\u7279\u6b8a\u7684\u5de5\u5177\u4fee\u6539\uff0cfstab\u4e2d\u6bcf\u4e00\u4e2a\u6587\u4ef6\u7cfb\u7edf\u63cf\u8ff0\u5360\u4e00\u884c\uff0c\u6bcf\u4e00\u884c\u662fTAB\u6216\u7a7a\u683c\u5206\u9694\u3002<br \/>\n\u4e8c\u3001fstab\u6587\u4ef6\u5185\u5bb9\u4ecb\u7ecd<br \/>\n<img decoding=\"async\" title=\"008\" src=\"https:\/\/nas.swihp.cn:39997\/file\/wordpress\/linux\u6302\u8f7dnas\/008.png\" alt=\"008\" \/><br \/>\nfile system\uff1a\u6307\u5b9a\u52a0\u8f7d\u7684\u78c1\u76d8\u5206\u533a\u6216\u79fb\u52a8\u6587\u4ef6\u7cfb\u7edf\uff0c\u9664\u4e86\u6307\u5b9a\u8bbe\u5907\u6587\u4ef6\u5916\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528UUID\u3001LABEL\u6765\u6307\u5b9a\u5206\u533a\uff1b<br \/>\nmount point\uff1a\u6307\u5b9a\u6302\u8f7d\u70b9\u7684\u8def\u5f84\uff1b<br \/>\ntype\uff1a\u6307\u5b9a\u6587\u4ef6\u7cfb\u7edf\u7684\u7c7b\u578b\uff0c\u5305\u62ecext2\u3001ext3\u3001reiserfs\u3001nfs\u3001vfat\u7b49<br \/>\noptions\uff1a\u6307\u5b9a\u6302\u8f7d\u7684\u9009\u9879\uff0c\u9ed8\u8ba4\u4e3adefaults\uff0c<br \/>\n&#8212;&#8212;&#8212;&#8211;async \u6b64\u53c2\u6570\u8868\u660e\u6240\u6d89\u53ca\u7684\u6587\u4ef6\u7cfb\u7edfI\/O\u90fd\u662f\u5f02\u6b65\u5904\u7406\uff0c\u4e0d\u4f1a\u540c\u6b65\u5199\u5165\u78c1\u76d8\u80fd\u63d0\u9ad8\u6027\u80fd\uff0c\u751f\u4ea7\u73af\u5883\u4e00\u822c\u4e0d\u7528<br \/>\n&#8212;&#8212;&#8212;&#8211;atime \u6b64\u53c2\u6570\u8868\u660e\u5728\u6bcf\u4e00\u6b21\u6570\u636e\u8bbf\u95ee\u65f6\uff0c\u540c\u6b65\u66f4\u65b0\u6bcf\u6b21\u7684\u8bbf\u95ee\u7684inode\u65f6\u95f4\uff0c\u662f\u9ed8\u8ba4\u53c2\u6570\uff0c\u5b9e\u9645\u751f\u4ea7\u73af\u5883\u4e2d\u9ad8\u5e76\u53d1\u60c5\u51b5\u4e0d\u5efa\u8bae\u4f7f\u7528<br \/>\n&#8212;&#8212;&#8212;&#8211;auto \u80fd\u591f\u88ab\u81ea\u52a8\u6302\u8f7d\u901a\u8fc7-a \u9009\u9879<br \/>\n&#8212;&#8212;&#8212;&#8211;defaults \u7f3a\u7701\u503c\uff08rw,suid,dev,auto\uff09<br \/>\n&#8212;&#8212;&#8212;&#8211;noatime\u4e0d\u540c\u6b65\u66f4\u65b0\u6587\u4ef6\u7cfb\u7edf\u8bbf\u95eeinode\u65f6\u95f4\uff0c\u63d0\u9ad8I\/O\u6027\u80fd\uff0c\u5b9e\u9645\u751f\u4ea7\u73af\u5883\u5e38\u7528<br \/>\n&#8212;&#8212;&#8212;&#8211;noauto\u4e0d\u81ea\u52a8\u8fdb\u884c\u6302\u8f7d<br \/>\n&#8212;&#8212;&#8212;&#8211;noexec\u4e0d\u53ef\u6267\u884c\u53ef\u6267\u884c\u7a0b\u5e8f<br \/>\ndump\uff1a\u8868\u793a\u8be5\u6302\u8f7d\u540e\u7684\u6587\u4ef6\u7cfb\u7edf\u80fd\u5426\u88abdump\u5907\u4efd\u547d\u4ee4\u4f5c\u7528\uff1b0\u8868\u793a\u4e0d\u80fd\uff0c1\u8868\u793a\u6bcf\u5929\u90fd\u8fdb\u884cdump\u5907\u4efd\uff0c2\u8868\u793a\u4e0d\u5b9a\u671f\u8fdb\u884cdump\u64cd\u4f5c\u3002<br \/>\npass\uff1a\u8868\u793a\u5f00\u673a\u8fc7\u7a0b\u4e2d\u662f\u5426\u6821\u9a8c\u6247\u533a\uff1b0\u8868\u793a\u4e0d\u8981\u6821\u9a8c\uff0c1\u8868\u793a\u4f18\u5148\u6821\u9a8c\uff08\u4e00\u822c\u4e3a\u6839\u76ee\u5f55\uff09\uff0c2\u8868\u793a\u4e3a\u57281\u7ea7\u522b\u6821\u9a8c\u5b8c\u540e\u518d\u8fdb\u884c\u6821\u9a8c\uff1b<\/p>\n<p>Ubuntu\u5b89\u88c5nfs\uff1asudo apt-get install nfs-common<\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,6],"tags":[],"class_list":["post-388","post","type-post","status-publish","format-standard","hentry","category-hkc","category-synology"],"_links":{"self":[{"href":"https:\/\/hkc.nasclub.vip\/index.php?rest_route=\/wp\/v2\/posts\/388","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hkc.nasclub.vip\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hkc.nasclub.vip\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hkc.nasclub.vip\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hkc.nasclub.vip\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=388"}],"version-history":[{"count":3,"href":"https:\/\/hkc.nasclub.vip\/index.php?rest_route=\/wp\/v2\/posts\/388\/revisions"}],"predecessor-version":[{"id":1561,"href":"https:\/\/hkc.nasclub.vip\/index.php?rest_route=\/wp\/v2\/posts\/388\/revisions\/1561"}],"wp:attachment":[{"href":"https:\/\/hkc.nasclub.vip\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=388"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hkc.nasclub.vip\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=388"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hkc.nasclub.vip\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=388"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}