{"id":495,"date":"2022-07-30T20:40:39","date_gmt":"2022-07-30T12:40:39","guid":{"rendered":"https:\/\/frogvps.com\/?p=495"},"modified":"2022-07-30T20:40:39","modified_gmt":"2022-07-30T12:40:39","slug":"linux%e7%9a%84%e6%96%87%e4%bb%b6%e7%b3%bb%e7%bb%9f%e6%8c%82%e8%bd%bd","status":"publish","type":"post","link":"https:\/\/frogvps.com\/?p=495","title":{"rendered":"linux\u7684\u6587\u4ef6\u7cfb\u7edf\u6302\u8f7d"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u6302\u8f7d mount<\/h2>\n\n\n\n<p>\u683c\u5f0f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mount &#91;-fnrsvw] &#91;-t vfstype] &#91;-o options] device mountpoint<\/code><\/pre>\n\n\n\n<p><strong>device\uff1a<\/strong>\u6307\u660e\u8981\u6302\u8f7d\u7684\u8bbe\u5907<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u8bbe\u5907\u6587\u4ef6\uff1a\u4f8b\u5982:\/dev\/sda5<\/li><li>\u5377\u6807\uff1a-L &#8216;LABEL&#8217;, \u4f8b\u5982 -L &#8216;MYDATA&#8217;<\/li><li>UUID\uff1a -U &#8216;UUID&#8217;\uff1a\u4f8b\u5982 -U &#8216;0c50523c-43f1-45e7-85c0-a126711d406e&#8217;<\/li><li>\u4f2a\u6587\u4ef6\u7cfb\u7edf\u540d\u79f0\uff1aproc, sysfs, devtmpfs, configfs<\/li><\/ul>\n\n\n\n<p><strong>mountpoint\uff1a<\/strong>\u6302\u8f7d\u70b9\uff0c\u5efa\u8bae\u4f7f\u7528\u5df2\u5b58\u5728\u7684\u7a7a\u76ee\u5f55<\/p>\n\n\n\n<p><strong>mount \u5e38\u7528\u547d\u4ee4\u9009\u9879<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-t    fstype    \u6307\u5b9a\u8981\u6302\u8f7d\u7684\u8bbe\u5907\u4e0a\u7684\u6587\u4ef6\u7cfb\u7edf\u7c7b\u578b,\u5982:ext4,xfs\n-r    readonly,\u53ea\u8bfb\u6302\u8f7d\n-w    read and write,\u8bfb\u5199\u6302\u8f7d,\u6b64\u4e3a\u9ed8\u8ba4\u8bbe\u7f6e,\u53ef\u7701\u7565\n-n    \u4e0d\u66f4\u65b0\/etc\/mtab,mount\u4e0d\u53ef\u89c1\n-a    \u81ea\u52a8\u6302\u8f7d\u6240\u6709\u652f\u6301\u81ea\u52a8\u6302\u8f7d\u7684\u8bbe\u5907(\u5b9a\u4e49\u5728\u4e86\/etc\/fstab\u6587\u4ef6\u4e2d\uff0c\u4e14\u6302\u8f7d\u9009\u9879\u4e2d\u6709auto\u529f\u80fd)\n-L    'LABEL' \u4ee5\u5377\u6807\u6307\u5b9a\u6302\u8f7d\u8bbe\u5907\n-U    'UUID' \u4ee5UUID\u6307\u5b9a\u8981\u6302\u8f7d\u7684\u8bbe\u5907\n-B     --bind \u7ed1\u5b9a\u76ee\u5f55\u5230\u53e6\u4e00\u4e2a\u76ee\u5f55\u4e0a\n-o    options\n      async  \u5f02\u6b65\u6a21\u5f0f,\u5185\u5b58\u66f4\u6539\u65f6,\u5199\u5165\u7f13\u5b58\u533abuffer,\u8fc7\u4e00\u6bb5\u65f6\u95f4\u518d\u5199\u5230\u78c1\u76d8,\u6548\u7387\u9ad8,\u4f46\u4e0d\u5b89\u5168\n      sync  \u540c\u6b65\u6a21\u5f0f,\u5185\u5b58\u66f4\u6539\u65f6,\u540c\u65f6\u5199\u78c1\u76d8,\u5b89\u5168,\u4f46\u6548\u7387\u4f4e\u4e0b\n      atime\/noatime  \u5305\u542b\u76ee\u5f55\u548c\u6587\u4ef6\n      diratime\/nodiratime  \u76ee\u5f55\u7684\u8bbf\u95ee\u65f6\u95f4\u6233\n      auto\/noauto  \u662f\u5426\u652f\u6301\u5f00\u673a\u81ea\u52a8\u6302\u8f7d\uff0c\u662f\u5426\u652f\u6301-a\u9009\u9879\n      exec\/noexec  \u662f\u5426\u652f\u6301\u5728\u6587\u4ef6\u7cfb\u7edf\u4e0a\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\n      dev\/nodev  \u662f\u5426\u652f\u6301\u5728\u6b64\u6587\u4ef6\u7cfb\u7edf\u4e0a\u4f7f\u7528\u8bbe\u5907\u6587\u4ef6\n      suid\/nosuid  \u662f\u5426\u652f\u6301suid\u548csgid\u6743\u9650\n      remount  \u91cd\u65b0\u6302\u8f7d\n      ro\/rw  \u53ea\u8bfb\/\u8bfb\u5199\n      user\/nouser  \u662f\u5426\u5141\u8bb8\u666e\u901a\u7528\u6237\u6302\u8f7d\u6b64\u8bbe\u5907,\/etc\/fstab\u4f7f\u7528\n      acl\/noacl  \u662f\u5426\u542f\u7528\u6b64\u6587\u4ef6\u7cfb\u7edf\u4e0a\u7684acl\u529f\u80fd\n      loop  \u4f7f\u7528loop\u8bbe\u5907\n      _netdev  \u5f53\u7f51\u7edc\u53ef\u7528\u65f6\u624d\u5bf9\u7f51\u7edc\u8d44\u6e90\u8fdb\u884c\u6302\u8f7d,\u6bd4\u5982\uff1aNFS\u6587\u4ef6\u7cfb\u7edf\n      defaults  \u9ed8\u8ba4\u9009\u9879,\u76f8\u5f53\u4e8erw,suid,dev,exec,auto,nouser,async     <\/code><\/pre>\n\n\n\n<p>\u6302\u8f7d\u89c4\u5219<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u4e00\u4e2a\u6302\u8f7d\u70b9\u540c\u4e00\u65f6\u95f4\u53ea\u80fd\u6302\u8f7d\u4e00\u4e2a\u8bbe\u5907<\/li><li>\u4e00\u4e2a\u6302\u8f7d\u70b9\u540c\u4e00\u65f6\u95f4\u6302\u8f7d\u4e86\u591a\u4e2a\u8bbe\u5907\uff0c\u53ea\u80fd\u770b\u5230\u6700\u540e\u4e00\u4e2a\u8bbe\u5907\u7684\u6570\u636e\uff0c\u5176\u5b83\u8bbe\u5907\u4e0a\u7684\u6570\u636e\u5c06\u88ab\u9690\u85cf<\/li><li>\u4e00\u4e2a\u8bbe\u5907\u53ef\u4ee5\u540c\u65f6\u6302\u8f7d\u5230\u591a\u4e2a\u6302\u8f7d\u70b9<\/li><li>\u6302\u8f7d\u70b9\u901a\u5e38\u662f\u5df2\u5b58\u5728\u7a7a\u7684\u76ee\u5f55<\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-dots\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u5378\u8f7dumount<\/h2>\n\n\n\n<p>\u5378\u8f7d\u65f6\uff1a\u53ef\u4f7f\u7528\u8bbe\u5907\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528\u6302\u8f7d\u70b9<\/p>\n\n\n\n<p>\u683c\u5f0f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>umount \u8bbe\u5907\u540d|\u6302\u8f7d\u70b9<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-dots\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u67e5\u770b\u6302\u8f7d\u60c5\u51b5<\/h2>\n\n\n\n<p>\u901a\u8fc7\u67e5\u770b\/etc\/mtab\u6587\u4ef6\u663e\u793a\u5f53\u524d\u5df2\u6302\u8f7d\u7684\u6240\u6709\u8bbe\u5907<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mount<\/code><\/pre>\n\n\n\n<p>\u67e5\u770b\u5185\u6838\u8ffd\u8e2a\u5230\u7684\u5df2\u6302\u8f7d\u7684\u6240\u6709\u8bbe\u5907<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat \/proc\/mounts<\/code><\/pre>\n\n\n\n<p>\u67e5\u770b\u67d0\u4e2a\u6302\u8f7d\u70b9\/\u8bbe\u5907<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>findmnt MOUNT_POINT|device<\/code><\/pre>\n\n\n\n<p>\u67e5\u770b\u6b63\u5728\u8bbf\u95ee\u6307\u5b9a\u6587\u4ef6\u7cfb\u7edf\u7684\u8fdb\u7a0b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>lsof MOUNT_POINT\nfuser -v MOUNT_POINT<\/code><\/pre>\n\n\n\n<p>\u7ec8\u6b62\u6240\u6709\u5728\u6b63\u8bbf\u95ee\u6307\u5b9a\u7684\u6587\u4ef6\u7cfb\u7edf\u7684\u8fdb\u7a0b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>fuser -km MOUNT_POINT<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-dots\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u6301\u4e45\u6302\u8f7d<\/h2>\n\n\n\n<p>\u5c06\u6302\u8f7d\u4fdd\u5b58\u5230 \/etc\/fstab \u4e2d\u53ef\u4ee5\u4e0b\u6b21\u5f00\u673a\u65f6\uff0c\u81ea\u52a8\u542f\u7528\u6302\u8f7d\u3002<\/p>\n\n\n\n<p><strong>\u67e5\u770b\u5e2e\u52a9<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>man 5 fstab<\/code><\/pre>\n\n\n\n<p>\/etc\/fstab \u6bcf\u884c\u5b9a\u4e49\u4e00\u4e2a\u8981\u6302\u8f7d\u7684\u6587\u4ef6\u7cfb\u7edf\uff0c\u5176\u4e2d\u5305\u62ec\u5171 6 \u9879<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>\u8981\u6302\u8f7d\u7684\u8bbe\u5907\u6216\u4f2a\u6587\u4ef6\u7cfb\u7edf<\/li><li>\u6302\u8f7d\u70b9\uff1a\u5fc5\u987b\u662f\u4e8b\u5148\u5b58\u5728\u7684\u76ee\u5f55<\/li><li>\u6587\u4ef6\u7cfb\u7edf\u7c7b\u578b\uff1aext4\u3001xfs\u3001iso9660\u3001nfs\u3001none<\/li><li>\u6302\u8f7d\u9009\u9879\uff1adefaults \u3001acl\u3001bind<\/li><li>\u8f6c\u50a8\u9891\u7387\uff1a0\uff1a\u4e0d\u505a\u5907\u4efd \u30011\uff1a\u6bcf\u5929\u8f6c\u50a8\u3001 2\uff1a\u6bcf\u9694\u4e00\u5929\u8f6c\u50a8<\/li><li>fsck\u68c0\u67e5\u7684\u6587\u4ef6\u7cfb\u7edf\u7684\u987a\u5e8f\uff1a0\uff1a\u4e0d\u81ea\u68c0 \u30011\uff1a\u9996\u5148\u81ea\u68c0\uff1b\u4e00\u822c\u53ea\u6709rootfs\u624d\u7528\u30012\uff1a\u975erootfs\u4f7f\u7528<\/li><\/ol>\n\n\n\n<p><strong>\u5728\u6587\u4ef6\u4e2d\u6dfb\u52a0\u65b0\u7684\u6302\u8f7d\u9879\uff0c\u9700\u8981\u6267\u884c\u4e0b\u9762\u547d\u4ee4\u751f\u6548<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mount -a<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6302\u8f7d mount \u683c\u5f0f device\uff1a\u6307\u660e\u8981\u6302\u8f7d\u7684\u8bbe\u5907 \u8bbe\u5907\u6587\u4ef6\uff1a\u4f8b\u5982:\/dev\/sda5 \u5377\u6807\uff1a-L &#8216;LABEL&#8217;, \u4f8b\u5982 -L &#8216;MYDATA&#8217; UUID\uff1a -U &#8216;UUID&#8230;<\/p>\n","protected":false},"author":1,"featured_media":143,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"topic":[],"class_list":["post-495","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/frogvps.com\/index.php?rest_route=\/wp\/v2\/posts\/495","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/frogvps.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/frogvps.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/frogvps.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/frogvps.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=495"}],"version-history":[{"count":3,"href":"https:\/\/frogvps.com\/index.php?rest_route=\/wp\/v2\/posts\/495\/revisions"}],"predecessor-version":[{"id":498,"href":"https:\/\/frogvps.com\/index.php?rest_route=\/wp\/v2\/posts\/495\/revisions\/498"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/frogvps.com\/index.php?rest_route=\/wp\/v2\/media\/143"}],"wp:attachment":[{"href":"https:\/\/frogvps.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frogvps.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=495"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frogvps.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=495"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/frogvps.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftopic&post=495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}