{"id":181905,"date":"2020-05-22T10:00:57","date_gmt":"2020-05-22T02:00:57","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=181905"},"modified":"2020-05-12T08:55:53","modified_gmt":"2020-05-12T00:55:53","slug":"use-mergefs-increase","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/use-mergefs-increase.html","title":{"rendered":"\u4f7f\u7528 mergefs \u589e\u52a0\u865a\u62df\u5b58\u50a8"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u5982\u679c\u4f60\u60f3\u5728\u4e00\u4e2a\u5a92\u4f53\u9879\u76ee\u4e2d\u7528\u5230\u4e86\u591a\u4e2a\u78c1\u76d8\u6216\u5206\u533a\uff0c\u4e0d\u60f3\u4e22\u5931\u4efb\u4f55\u73b0\u6709\u6570\u636e\uff0c\u4f46\u53c8\u60f3\u5c06\u6240\u6709\u6587\u4ef6\u90fd\u5b58\u653e\u5728\u4e00\u4e2a\u9a71\u52a8\u5668\u4e0b\uff0c\u8be5\u600e\u4e48\u529e\uff1f\u8fd9\u65f6\uff0cmergefs \u5c31\u80fd\u6d3e\u4e0a\u7528\u573a\uff01<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

mergerfs \u662f\u4e00\u4e2a\u8054\u5408\u6587\u4ef6\u7cfb\u7edf\uff0c\u65e8\u5728\u7b80\u5316\u5b58\u50a8\u548c\u7ba1\u7406\u4f17\u591a\u5546\u4e1a\u5b58\u50a8\u8bbe\u5907\u4e0a\u7684\u6587\u4ef6\u3002<\/p>\n

\u4f60\u9700\u8981\u4ece\u4ed6\u4eec\u7684 GitHub<\/a> \u9875\u9762\u83b7\u53d6\u6700\u65b0\u7684 RPM\u3002Fedora \u7684\u7248\u672c\u540d\u79f0\u4e2d\u5e26\u6709 \u201cfc\u201d \u548c\u7248\u672c\u53f7\u3002\u4f8b\u5982\uff0c\u8fd9\u662f Fedora 31 \u7684\u7248\u672c\uff1a mergerfs-2.29.0-1.fc31.x86_64.rpm<\/a>\u3002<\/p>\n

\u5b89\u88c5\u548c\u914d\u7f6e mergefs<\/strong><\/div>\n

\u4f7f\u7528 sudo \u5b89\u88c5\u5df2\u4e0b\u8f7d\u7684 mergefs \u8f6f\u4ef6\u5305\uff1a<\/p>\n

$ sudo dnf install mergerfs-2.29.0-1.fc31.x86_64.rpm\r\n<\/pre>\n

\u73b0\u5728\uff0c\u4f60\u53ef\u4ee5\u5c06\u591a\u4e2a\u78c1\u76d8\u6302\u8f7d\u4e3a\u4e00\u4e2a\u9a71\u52a8\u5668\u3002\u5982\u679c\u4f60\u6709\u4e00\u53f0\u5a92\u4f53\u670d\u52a1\u5668\uff0c\u5e76\u4e14\u5e0c\u671b\u6240\u6709\u5a92\u4f53\u6587\u4ef6\u90fd\u663e\u793a\u5728\u4e00\u4e2a\u5730\u65b9\uff0c\u8fd9\u5c06\u5f88\u65b9\u4fbf\u3002\u5982\u679c\u5c06\u65b0\u6587\u4ef6\u4e0a\u4f20\u5230\u7cfb\u7edf\uff0c\u90a3\u4e48\u53ef\u4ee5\u5c06\u5b83\u4eec\u590d\u5236\u5230 mergefs \u76ee\u5f55\uff0cmergefs \u4f1a\u81ea\u52a8\u5c06\u5b83\u4eec\u590d\u5236\u5177\u6709\u8db3\u591f\u53ef\u7528\u7a7a\u95f4\u7684\u78c1\u76d8\u4e0a\u3002<\/p>\n

\u8fd9\u662f\u4f7f\u4f60\u66f4\u5bb9\u6613\u7406\u89e3\u7684\u4f8b\u5b50\uff1a<\/p>\n

$ df -hT | grep disk\r\n\/dev\/sdb1      ext4      23M  386K 21M 2% \/disk1\r\n\/dev\/sdc1      ext4      44M  1.1M 40M 3% \/disk2\r\n$ ls -l \/disk1\/Videos\/\r\ntotal 1\r\n-rw-r--r--. 1 curt curt 0 Mar 8 17:17 Our Wedding.mkv\r\n$ ls -l \/disk2\/Videos\/\r\ntotal 2\r\n-rw-r--r--. 1 curt curt 0 Mar 8 17:17 Baby's first Xmas.mkv\r\n-rw-rw-r--. 1 curt curt 0 Mar 8 17:21 Halloween hijinks.mkv<\/pre>\n

\u5728\u6b64\u4f8b\u4e2d\u6302\u8f7d\u4e86\u4e24\u5757\u78c1\u76d8\uff0c\u5206\u522b\u4e3a disk1 \u548c disk2\u3002\u4e24\u4e2a\u9a71\u52a8\u5668\u90fd\u6709\u4e00\u4e2a\u5305\u542b\u6587\u4ef6\u7684 Videos \u76ee\u5f55\u3002<\/p>\n

\u73b0\u5728\uff0c\u6211\u4eec\u5c06\u4f7f\u7528 mergefs \u6302\u8f7d\u8fd9\u4e9b\u9a71\u52a8\u5668\uff0c\u4f7f\u5b83\u4eec\u770b\u8d77\u6765\u50cf\u4e00\u4e2a\u66f4\u5927\u7684\u9a71\u52a8\u5668\u3002<\/p>\n

$ sudo mergerfs -o defaults,allow_other,use_ino,category.create=mfs,moveonenospc=true,minfreespace=1M \/disk1:\/disk2 \/media\r\n<\/pre>\n

mergefs \u624b\u518c\u9875\u975e\u5e38\u5e9e\u6742\uff0c\u56e0\u6b64\u6211\u4eec\u5c06\u8bf4\u660e\u4e0a\u9762\u63d0\u5230\u7684\u9009\u9879\u3002<\/p>\n

    \n
  • defaults\uff1a\u9664\u975e\u6307\u5b9a\uff0c\u5426\u5219\u5c06\u4f7f\u7528\u9ed8\u8ba4\u8bbe\u7f6e\u3002<\/li>\n
  • allow_other\uff1a\u5141\u8bb8 sudo \u6216 root \u4ee5\u5916\u7684\u7528\u6237\u67e5\u770b\u6587\u4ef6\u7cfb\u7edf\u3002<\/li>\n
  • use_ino\uff1a\u8ba9 mergefs \u63d0\u4f9b\u6587\u4ef6\/\u76ee\u5f55 inode \u800c\u4e0d\u662f libfuse\u3002\u867d\u7136\u4e0d\u662f\u9ed8\u8ba4\u503c\uff0c\u4f46\u5efa\u8bae\u4f60\u542f\u7528\u5b83\uff0c\u4ee5\u4fbf\u94fe\u63a5\u7684\u6587\u4ef6\u5171\u4eab\u76f8\u540c\u7684 inode \u503c\u3002<\/li>\n
  • category.create=mfs\uff1a\u6839\u636e\u53ef\u7528\u7a7a\u95f4\u5728\u9a71\u52a8\u5668\u95f4\u4f20\u64ad\u6587\u4ef6\u3002<\/li>\n
  • moveonenospc=true\uff1a\u5982\u679c\u542f\u7528\uff0c\u90a3\u4e48\u5982\u679c\u5199\u5165\u5931\u8d25\uff0c\u5c06\u8fdb\u884c\u626b\u63cf\u4ee5\u67e5\u627e\u5177\u6709\u6700\u5927\u53ef\u7528\u7a7a\u95f4\u7684\u9a71\u52a8\u5668\u3002<\/li>\n
  • minfreespace=1M\uff1a\u6700\u5c0f\u4f7f\u7528\u7a7a\u95f4\u503c\u3002<\/li>\n
  • disk1\uff1a\u7b2c\u4e00\u5757\u786c\u76d8\u3002<\/li>\n
  • disk2\uff1a\u7b2c\u4e8c\u5757\u786c\u76d8\u3002<\/li>\n
  • \/media\uff1a\u6302\u8f7d\u9a71\u52a8\u5668\u7684\u76ee\u5f55\u3002<\/li>\n<\/ul>\n

    \u770b\u8d77\u6765\u662f\u8fd9\u6837\u7684\uff1a<\/p>\n

    $ df -hT | grep disk\r\n\/dev\/sdb1  ext4           23M      386K 21M 2% \/disk1\r\n\/dev\/sdc1  ext4           44M      1.1M 40M 3% \/disk2\r\n$ df -hT | grep media\r\n1:2        fuse.mergerfs  66M      1.4M 60M 3% \/media<\/pre>\n

    \u4f60\u53ef\u4ee5\u770b\u5230\u73b0\u5728 mergefs \u6302\u8f7d\u663e\u793a\u7684\u603b\u5bb9\u91cf\u4e3a 66M\uff0c\u8fd9\u662f\u4e24\u5757\u786c\u76d8\u7684\u603b\u5bb9\u91cf\u3002<\/p>\n

    \u7ee7\u7eed\u793a\u4f8b\uff1a<\/p>\n

    \u6709\u4e00\u4e2a\u53eb Baby's second Xmas.mkv<\/strong> \u7684 30M \u89c6\u9891\u3002\u8ba9\u6211\u4eec\u5c06\u5176\u590d\u5236\u5230\u7528 mergerfs \u6302\u8f7d\u7684 \/media \u6587\u4ef6\u5939\u4e2d\u3002<\/p>\n

    $ ls -lh \"Baby's second Xmas.mkv\"\r\n-rw-rw-r--. 1 curt curt 30M Apr 20 08:45 Baby's second Xmas.mkv\r\n$ cp \"Baby's second Xmas.mkv\" \/media\/Videos\/<\/pre>\n

    \u8fd9\u662f\u6700\u7ec8\u7ed3\u679c\uff1a<\/p>\n

    $ df -hT | grep disk\r\n\/dev\/sdb1  ext4          23M 386K 21M 2% \/disk1\r\n\/dev\/sdc1  ext4          44M 31M 9.8M 76% \/disk2\r\n$ df -hT | grep media\r\n1:2        fuse.mergerfs 66M 31M 30M 51% \/media<\/pre>\n

    \u4ece\u78c1\u76d8\u7a7a\u95f4\u5229\u7528\u7387\u4e2d\u53ef\u4ee5\u770b\u5230\uff0c\u56e0\u4e3a disk1 \u6ca1\u6709\u8db3\u591f\u7684\u53ef\u7528\u7a7a\u95f4\uff0c\u6240\u4ee5 mergefs \u81ea\u52a8\u5c06\u6587\u4ef6\u590d\u5236\u5230 disk2\u3002<\/p>\n

    \u8fd9\u662f\u6240\u6709\u6587\u4ef6\u8be6\u60c5\uff1a<\/p>\n

    $ ls -l \/disk1\/Videos\/\r\ntotal 1\r\n-rw-r--r--. 1 curt curt 0 Mar 8 17:17 Our Wedding.mkv\r\n$ ls -l \/disk2\/Videos\/\r\ntotal 30003\r\n-rw-r--r--. 1 curt curt 0 Mar 8 17:17 Baby's first Xmas.mkv\r\n-rw-rw-r--. 1 curt curt 30720000 Apr 20 08:47 Baby's second Xmas.mkv\r\n-rw-rw-r--. 1 curt curt 0 Mar 8 17:21 Halloween hijinks.mkv\r\n$ ls -l \/media\/Videos\/\r\ntotal 30004\r\n-rw-r--r--. 1 curt curt 0 Mar 8 17:17 Baby's first Xmas.mkv\r\n-rw-rw-r--. 1 curt curt 30720000 Apr 20 08:47 Baby's second Xmas.mkv\r\n-rw-rw-r--. 1 curt curt 0 Mar 8 17:21 Halloween hijinks.mkv\r\n-rw-r--r--. 1 curt curt 0 Mar 8 17:17 Our Wedding.mkv<\/pre>\n

    \u5f53\u4f60\u5c06\u6587\u4ef6\u590d\u5236\u5230 mergefs \u6302\u8f7d\u70b9\u65f6\uff0c\u5b83\u5c06\u59cb\u7ec8\u5c06\u6587\u4ef6\u590d\u5236\u5230\u6709\u8db3\u591f\u53ef\u7528\u7a7a\u95f4\u7684\u786c\u76d8\u4e0a\u3002\u5982\u679c\u6c60\u4e2d\u7684\u6240\u6709\u9a71\u52a8\u5668\u90fd\u6ca1\u6709\u8db3\u591f\u7684\u53ef\u7528\u7a7a\u95f4\uff0c\u90a3\u4e48\u4f60\u5c06\u65e0\u6cd5\u590d\u5236\u5b83\u4eec\u3002<\/p>\n

    via: https:\/\/fedoramagazine.org\/using-mergerfs-to-increase-your-virtual-storage\/<\/p>\n

    \u4f5c\u8005\uff1aCurt Warfield \u9009\u9898\uff1alujun9972 \u8bd1\u8005\uff1ageekpi \u6821\u5bf9\uff1awxy<\/p>\n

    \u672c\u6587\u7531 LCTT \u539f\u521b\u7f16\u8bd1\uff0cLinux\u4e2d\u56fd \u8363\u8a89\u63a8\u51fa<\/p>\n","protected":false},"excerpt":{"rendered":"

    mergerfs \u662f\u4e00\u4e2a\u8054\u5408\u6587\u4ef6\u7cfb\u7edf\uff0c\u65e8\u5728\u7b80\u5316\u5b58\u50a8\u548c\u7ba1\u7406\u4f17\u591a\u5546\u4e1a\u5b58\u50a8\u8bbe\u5907\u4e0a\u7684\u6587\u4ef6\u3002 \u4f60\u9700\u8981\u4ece\u4ed6\u4eec\u7684 GitHu […]<\/p>\n","protected":false},"author":317,"featured_media":181907,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-181905","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/181905","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/317"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=181905"}],"version-history":[{"count":1,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/181905\/revisions"}],"predecessor-version":[{"id":181908,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/181905\/revisions\/181908"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/181907"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=181905"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=181905"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=181905"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}