{"id":17152,"date":"2022-10-12T05:07:54","date_gmt":"2022-10-11T21:07:54","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=17152"},"modified":"2022-10-12T05:08:43","modified_gmt":"2022-10-11T21:08:43","slug":"chapter-07","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/chapter-07.html","title":{"rendered":"\u7b2c7\u7ae0 \u4f7f\u7528RAID\u4e0eLVM\u78c1\u76d8\u9635\u5217\u6280\u672f\u3002"},"content":{"rendered":"

👇\u672c\u7ae0\u8282\u5185\u5bb9\u5df2\u66f4\u65b0\uff0c\u8bf7\u5728\u7ebf\u9605\u8bfb\u6700\u65b0RHEL 8\u7248\u672c\u4e66\u7c4d 👇<\/span><\/strong><\/span><\/p>\n

https:\/\/lrxjmw.cn\/basic-learning-07.html<\/span><\/strong><\/span><\/b><\/p>\n

\u7ae0\u8282\u7b80\u8ff0\uff1a<\/strong><\/span><\/p>\n

\u5728\u5b66\u4e60\u4e86\u7b2c6\u7ae0\u8bb2\u89e3\u7684\u786c\u76d8\u8bbe\u5907\u5206\u533a\u3001\u683c\u5f0f\u5316\u3001\u6302\u8f7d\u7b49\u77e5\u8bc6\u540e\uff0c\u672c\u7ae0\u5c06\u6df1\u5165\u8bb2\u89e3\u5404\u4e2a\u5e38\u7528RAID\uff08Redundant Array of Independent Disks\uff0c\u72ec\u7acb\u5197\u4f59\u78c1\u76d8\u9635\u5217\uff09\u6280\u672f\u65b9\u6848\u7684\u7279\u6027\uff0c\u5e76\u901a\u8fc7\u5b9e\u9645\u90e8\u7f72RAID 10\u3001RAID 5+\u5907\u4efd\u76d8\u7b49\u65b9\u6848\u6765\u66f4\u76f4\u89c2\u5730\u67e5\u770bRAID\u7684\u5f3a\u5927\u6548\u679c\uff0c\u4ee5\u4fbf\u8fdb\u4e00\u6b65\u6ee1\u8db3\u751f\u4ea7\u73af\u5883\u5bf9\u786c\u76d8\u8bbe\u5907\u7684IO\u8bfb\u5199\u901f\u5ea6\u548c\u6570\u636e\u5197\u4f59\u5907\u4efd\u673a\u5236\u7684\u9700\u6c42\u3002\u540c\u65f6\uff0c\u8003\u8651\u5230\u7528\u6237\u53ef\u80fd\u4f1a\u52a8\u6001\u8c03\u6574\u5b58\u50a8\u8d44\u6e90\uff0c\u672c\u7ae0\u8fd8\u5c06\u4ecb\u7ecdLVM\uff08Logical Volume Manager\uff0c\u903b\u8f91\u5377\u7ba1\u7406\u5668\uff09\u7684\u90e8\u7f72\u3001\u6269\u5bb9\u3001\u7f29\u5c0f\u3001\u5feb\u7167\u4ee5\u53ca\u5378\u8f7d\u5220\u9664\u7684\u76f8\u5173\u77e5\u8bc6\u3002\u76f8\u4fe1\u8bfb\u8005\u5728\u5b66\u5b8c\u672c\u7ae0\u5185\u5bb9\u540e\uff0c\u4fbf\u53ef\u4ee5\u5728\u4f01\u4e1a\u7ea7\u751f\u4ea7\u73af\u5883\u4e2d\u7075\u6d3b\u8fd0\u7528RAID\u548cLVM\u6765\u6ee1\u8db3\u5bf9\u5b58\u50a8\u8d44\u6e90\u7684\u9ad8\u7ea7\u7ba1\u7406\u9700\u6c42\u4e86\u3002<\/p>\n

7.1 RAID\u78c1\u76d8\u5197\u4f59\u9635\u5217<\/strong><\/span><\/h5>\n

\u8fd1\u5e74\u6765\uff0c CPU\u7684\u5904\u7406\u6027\u80fd\u4fdd\u6301\u7740\u9ad8\u901f\u589e\u957f\uff0cIntel\u516c\u53f8\u57282017\u5e74\u6700\u65b0\u53d1\u5e03\u7684i9-7980XE\u5904\u7406\u5668\u82af\u7247\u66f4\u662f\u8fbe\u5230\u4e8618\u6838\u5fc336\u7ebf\u7a0b\u3002\u4f46\u4e0e\u6b64\u540c\u65f6\uff0c\u786c\u76d8\u8bbe\u5907\u7684\u6027\u80fd\u63d0\u5347\u5374\u4e0d\u662f\u5f88\u5927\uff0c\u56e0\u6b64\u9010\u6e10\u6210\u4e3a\u5f53\u4ee3\u8ba1\u7b97\u673a\u6574\u4f53\u6027\u80fd\u7684\u74f6\u9888\u3002\u800c\u4e14\uff0c\u7531\u4e8e\u786c\u76d8\u8bbe\u5907\u9700\u8981\u8fdb\u884c\u6301\u7eed\u3001\u9891\u7e41\u3001\u5927\u91cf\u7684IO\u64cd\u4f5c\uff0c\u76f8\u8f83\u4e8e\u5176\u4ed6\u8bbe\u5907\uff0c\u5176\u635f\u574f\u51e0\u7387\u4e5f\u5927\u5e45\u589e\u52a0\uff0c\u5bfc\u81f4\u91cd\u8981\u6570\u636e\u4e22\u5931\u7684\u51e0\u7387\u4e5f\u968f\u4e4b\u589e\u52a0\u3002<\/p>\n

1988\u5e74\uff0c\u52a0\u5229\u798f\u5c3c\u4e9a\u5927\u5b66\u4f2f\u514b\u5229\u5206\u6821\u9996\u6b21\u63d0\u51fa\u5e76\u5b9a\u4e49\u4e86RAID\u6280\u672f\u7684\u6982\u5ff5\u3002RAID\u6280\u672f\u901a\u8fc7\u628a\u591a\u4e2a\u786c\u76d8\u8bbe\u5907\u7ec4\u5408\u6210\u4e00\u4e2a\u5bb9\u91cf\u66f4\u5927\u3001\u5b89\u5168\u6027\u66f4\u597d\u7684\u78c1\u76d8\u9635\u5217\uff0c\u5e76\u628a\u6570\u636e\u5207\u5272\u6210\u591a\u4e2a\u533a\u6bb5\u540e\u5206\u522b\u5b58\u653e\u5728\u5404\u4e2a\u4e0d\u540c\u7684\u7269\u7406\u786c\u76d8\u8bbe\u5907\u4e0a\uff0c\u7136\u540e\u5229\u7528\u5206\u6563\u8bfb\u5199\u6280\u672f\u6765\u63d0\u5347\u78c1\u76d8\u9635\u5217\u6574\u4f53\u7684\u6027\u80fd\uff0c\u540c\u65f6\u628a\u591a\u4e2a\u91cd\u8981\u6570\u636e\u7684\u526f\u672c\u540c\u6b65\u5230\u4e0d\u540c\u7684\u7269\u7406\u786c\u76d8\u8bbe\u5907\u4e0a\uff0c\u4ece\u800c\u8d77\u5230\u4e86\u975e\u5e38\u597d\u7684\u6570\u636e\u5197\u4f59\u5907\u4efd\u6548\u679c\u3002<\/p>\n

\u4efb\u4f55\u4e8b\u7269\u90fd\u6709\u5b83\u7684\u4e24\u9762\u6027\u3002RAID\u6280\u672f\u786e\u5b9e\u5177\u6709\u975e\u5e38\u597d\u7684\u6570\u636e\u5197\u4f59\u5907\u4efd\u529f\u80fd\uff0c\u4f46\u662f\u5b83\u4e5f\u76f8\u5e94\u5730\u63d0\u9ad8\u4e86\u6210\u672c\u652f\u51fa\u3002\u5c31\u50cf\u539f\u672c\u6211\u4eec\u53ea\u6709\u4e00\u4e2a\u7535\u8bdd\u672c\uff0c\u4f46\u662f\u4e3a\u4e86\u907f\u514d\u9057\u5931\uff0c\u6211\u4eec\u5c06\u8054\u7cfb\u4eba\u53f7\u7801\u4fe1\u606f\u5199\u6210\u4e86\u4e24\u4efd\uff0c\u81ea\u7136\u8981\u4e3a\u6b64\u591a\u4e70\u4e00\u4e2a\u7535\u8bdd\u672c\uff0c\u8fd9\u4e5f\u5c31\u76f8\u5e94\u5730\u63d0\u5347\u4e86\u6210\u672c\u652f\u51fa\u3002RAID\u6280\u672f\u7684\u8bbe\u8ba1\u521d\u8877\u662f\u51cf\u5c11\u56e0\u4e3a\u91c7\u8d2d\u786c\u76d8\u8bbe\u5907\u5e26\u6765\u7684\u8d39\u7528\u652f\u51fa\uff0c\u4f46\u662f\u4e0e\u6570\u636e\u672c\u8eab\u7684\u4ef7\u503c\u76f8\u6bd4\u8f83\uff0c\u73b0\u4ee3\u4f01\u4e1a\u66f4\u770b\u91cd\u7684\u5219\u662fRAID\u6280\u672f\u6240\u5177\u5907\u7684\u5197\u4f59\u5907\u4efd\u673a\u5236\u4ee5\u53ca\u5e26\u6765\u7684\u786c\u76d8\u541e\u5410\u91cf\u7684\u63d0\u5347\u3002\u4e5f\u5c31\u662f\u8bf4\uff0cRAID\u4e0d\u4ec5\u964d\u4f4e\u4e86\u786c\u76d8\u8bbe\u5907\u635f\u574f\u540e\u4e22\u5931\u6570\u636e\u7684\u51e0\u7387\uff0c\u8fd8\u63d0\u5347\u4e86\u786c\u76d8\u8bbe\u5907\u7684\u8bfb\u5199\u901f\u5ea6\uff0c\u6240\u4ee5\u5b83\u5728\u7edd\u5927\u591a\u6570\u8fd0\u8425\u5546\u6216\u5927\u4e2d\u578b\u4f01\u4e1a\u4e2d\u5f97\u4ee5\u5e7f\u6cdb\u90e8\u7f72\u548c\u5e94\u7528\u3002<\/p>\n

\u51fa\u4e8e\u6210\u672c\u548c\u6280\u672f\u65b9\u9762\u7684\u8003\u8651\uff0c\u9700\u8981\u9488\u5bf9\u4e0d\u540c\u7684\u9700\u6c42\u5728\u6570\u636e\u53ef\u9760\u6027\u53ca\u8bfb\u5199\u6027\u80fd\u4e0a\u4f5c\u51fa\u6743\u8861\uff0c\u5236\u5b9a\u51fa\u6ee1\u8db3\u5404\u81ea\u9700\u6c42\u7684\u4e0d\u540c\u65b9\u6848\u3002\u76ee\u524d\u5df2\u6709\u7684RAID\u78c1\u76d8\u9635\u5217\u7684\u65b9\u6848\u81f3\u5c11\u6709\u5341\u51e0\u79cd\uff0c\u800c\u5218\u9044<\/a>\u8001\u5e08\u63a5\u4e0b\u6765\u4f1a\u8be6\u7ec6\u8bb2\u89e3RAID 0\u3001RAID 1\u3001RAID 5\u4e0eRAID 10\u8fd94\u79cd\u6700\u5e38\u89c1\u7684\u65b9\u6848\u3002<\/p>\n

1. RAID 0<\/strong><\/span><\/p>\n

RAID 0\u6280\u672f\u628a\u591a\u5757\u7269\u7406\u786c\u76d8\u8bbe\u5907\uff08\u81f3\u5c11\u4e24\u5757\uff09\u901a\u8fc7\u786c\u4ef6\u6216\u8f6f\u4ef6\u7684\u65b9\u5f0f\u4e32\u8054\u5728\u4e00\u8d77\uff0c\u7ec4\u6210\u4e00\u4e2a\u5927\u7684\u5377\u7ec4\uff0c\u5e76\u5c06\u6570\u636e\u4f9d\u6b21\u5199\u5165\u5230\u5404\u4e2a\u7269\u7406\u786c\u76d8\u4e2d\u3002\u8fd9\u6837\u4e00\u6765\uff0c\u5728\u6700\u7406\u60f3\u7684\u72b6\u6001\u4e0b\uff0c\u786c\u76d8\u8bbe\u5907\u7684\u8bfb\u5199\u6027\u80fd\u4f1a\u63d0\u5347\u6570\u500d\uff0c\u4f46\u662f\u82e5\u4efb\u610f\u4e00\u5757\u786c\u76d8\u53d1\u751f\u6545\u969c\u5c06\u5bfc\u81f4\u6574\u4e2a\u7cfb\u7edf\u7684\u6570\u636e\u90fd\u53d7\u5230\u7834\u574f\u3002\u901a\u4fd7\u6765\u8bf4\uff0cRAID 0\u6280\u672f\u80fd\u591f\u6709\u6548\u5730\u63d0\u5347\u786c\u76d8\u6570\u636e\u7684\u541e\u5410\u901f\u5ea6\uff0c\u4f46\u662f\u4e0d\u5177\u5907\u6570\u636e\u5907\u4efd\u548c\u9519\u8bef\u4fee\u590d\u80fd\u529b\u3002\u5982\u56fe7-1\u6240\u793a\uff0c\u6570\u636e\u88ab\u5206\u522b\u5199\u5165\u5230\u4e0d\u540c\u7684\u786c\u76d8\u8bbe\u5907\u4e2d\uff0c\u5373disk1\u548cdisk2\u786c\u76d8\u8bbe\u5907\u4f1a\u5206\u522b\u4fdd\u5b58\u6570\u636e\u8d44\u6599\uff0c\u6700\u7ec8\u5b9e\u73b0\u63d0\u5347\u8bfb\u53d6\u3001\u5199\u5165\u901f\u5ea6\u7684\u6548\u679c\u3002<\/p>\n

\"\"<\/div>\n

\u56fe7-1\u00a0 RAID 0\u6280\u672f\u793a\u610f\u56fe<\/p>\n

2. RAID 1<\/strong><\/span><\/p>\n

\u5c3d\u7ba1RAID 0\u6280\u672f\u63d0\u5347\u4e86\u786c\u76d8\u8bbe\u5907\u7684\u8bfb\u5199\u901f\u5ea6\uff0c\u4f46\u662f\u5b83\u662f\u5c06\u6570\u636e\u4f9d\u6b21\u5199\u5165\u5230\u5404\u4e2a\u7269\u7406\u786c\u76d8\u4e2d\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u5b83\u7684\u6570\u636e\u662f\u5206\u5f00\u5b58\u653e\u7684\uff0c\u5176\u4e2d\u4efb\u4f55\u4e00\u5757\u786c\u76d8\u53d1\u751f\u6545\u969c\u90fd\u4f1a\u635f\u574f\u6574\u4e2a\u7cfb\u7edf\u7684\u6570\u636e\u3002\u56e0\u6b64\uff0c\u5982\u679c\u751f\u4ea7\u73af\u5883\u5bf9\u786c\u76d8\u8bbe\u5907\u7684\u8bfb\u5199\u901f\u5ea6\u6ca1\u6709\u8981\u6c42\uff0c\u800c\u662f\u5e0c\u671b\u589e\u52a0\u6570\u636e\u7684\u5b89\u5168\u6027\u65f6\uff0c\u5c31\u9700\u8981\u7528\u5230RAID 1\u6280\u672f\u4e86\u3002<\/p>\n

\u5728\u56fe7-2\u6240\u793a\u7684RAID 1\u6280\u672f\u793a\u610f\u56fe\u4e2d\u53ef\u4ee5\u770b\u5230\uff0c\u5b83\u662f\u628a\u4e24\u5757\u4ee5\u4e0a\u7684\u786c\u76d8\u8bbe\u5907\u8fdb\u884c\u7ed1\u5b9a\uff0c\u5728\u5199\u5165\u6570\u636e\u65f6\uff0c\u662f\u5c06\u6570\u636e\u540c\u65f6\u5199\u5165\u5230\u591a\u5757\u786c\u76d8\u8bbe\u5907\u4e0a\uff08\u53ef\u4ee5\u5c06\u5176\u89c6\u4e3a\u6570\u636e\u7684\u955c\u50cf\u6216\u5907\u4efd\uff09\u3002\u5f53\u5176\u4e2d\u67d0\u4e00\u5757\u786c\u76d8\u53d1\u751f\u6545\u969c\u540e\uff0c\u4e00\u822c\u4f1a\u7acb\u5373\u81ea\u52a8\u4ee5\u70ed\u4ea4\u6362\u7684\u65b9\u5f0f\u6765\u6062\u590d\u6570\u636e\u7684\u6b63\u5e38\u4f7f\u7528\u3002<\/p>\n

\"\"<\/div>\n

\u56fe7-2\u00a0 RAID 1\u6280\u672f\u793a\u610f\u56fe<\/p>\n

RAID 1\u6280\u672f\u867d\u7136\u5341\u5206\u6ce8\u91cd\u6570\u636e\u7684\u5b89\u5168\u6027\uff0c\u4f46\u662f\u56e0\u4e3a\u662f\u5728\u591a\u5757\u786c\u76d8\u8bbe\u5907\u4e2d\u5199\u5165\u4e86\u76f8\u540c\u7684\u6570\u636e\uff0c\u56e0\u6b64\u786c\u76d8\u8bbe\u5907\u7684\u5229\u7528\u7387\u5f97\u4ee5\u4e0b\u964d\uff0c\u4ece\u7406\u8bba\u4e0a\u6765\u8bf4\uff0c\u56fe7-2\u6240\u793a\u7684\u786c\u76d8\u7a7a\u95f4\u7684\u771f\u5b9e\u53ef\u7528\u7387\u53ea\u670950%\uff0c\u7531\u4e09\u5757\u786c\u76d8\u8bbe\u5907\u7ec4\u6210\u7684RAID 1\u78c1\u76d8\u9635\u5217\u7684\u53ef\u7528\u7387\u53ea\u670933%\u5de6\u53f3\uff0c\u4ee5\u6b64\u7c7b\u63a8\u3002\u800c\u4e14\uff0c\u7531\u4e8e\u9700\u8981\u628a\u6570\u636e\u540c\u65f6\u5199\u5165\u5230\u4e24\u5757\u4ee5\u4e0a\u7684\u786c\u76d8\u8bbe\u5907\uff0c\u8fd9\u65e0\u7591\u4e5f\u5728\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u589e\u5927\u4e86\u7cfb\u7edf\u8ba1\u7b97\u529f\u80fd\u7684\u8d1f\u8f7d\u3002<\/p>\n

\u90a3\u4e48\uff0c\u6709\u6ca1\u6709\u4e00\u79cdRAID\u65b9\u6848\u65e2\u8003\u8651\u5230\u4e86\u786c\u76d8\u8bbe\u5907\u7684\u8bfb\u5199\u901f\u5ea6\u548c\u6570\u636e\u5b89\u5168\u6027\uff0c\u8fd8\u517c\u987e\u4e86\u6210\u672c\u95ee\u9898\u5462\uff1f\u5b9e\u9645\u4e0a\uff0c\u5355\u4ece\u6570\u636e\u5b89\u5168\u548c\u6210\u672c\u95ee\u9898\u4e0a\u6765\u8bb2\uff0c\u5c31\u4e0d\u53ef\u80fd\u5728\u4fdd\u6301\u539f\u6709\u786c\u76d8\u8bbe\u5907\u7684\u5229\u7528\u7387\u4e14\u8fd8\u4e0d\u589e\u52a0\u65b0\u8bbe\u5907\u7684\u60c5\u51b5\u4e0b\uff0c\u80fd\u5927\u5e45\u63d0\u5347\u6570\u636e\u7684\u5b89\u5168\u6027\u3002\u5218\u9044\u8001\u5e08\u4e5f\u6ca1\u6709\u5fc5\u8981\u5ffd\u60a0\u5404\u4f4d\u8bfb\u8005\uff0c\u4e0b\u9762\u5c06\u8981\u8bb2\u89e3\u7684RAID 5\u6280\u672f\u867d\u7136\u5728\u7406\u8bba\u4e0a\u517c\u987e\u4e86\u4e09\u8005\uff08\u8bfb\u5199\u901f\u5ea6\u3001\u6570\u636e\u5b89\u5168\u6027\u3001\u6210\u672c\uff09\uff0c\u4f46\u5b9e\u9645\u4e0a\u66f4\u50cf\u662f\u5bf9\u8fd9\u4e09\u8005\u7684\u201c\u76f8\u4e92\u59a5\u534f\u201d\u3002<\/p>\n

3. RAID 5<\/span><\/strong><\/p>\n

\u5982\u56fe7-3\u6240\u793a\uff0cRAID5\u6280\u672f\u662f\u628a\u786c\u76d8\u8bbe\u5907\u7684\u6570\u636e\u5947\u5076\u6821\u9a8c\u4fe1\u606f\u4fdd\u5b58\u5230\u5176\u4ed6\u786c\u76d8\u8bbe\u5907\u4e2d\u3002RAID 5\u78c1\u76d8\u9635\u5217\u7ec4\u4e2d\u6570\u636e\u7684\u5947\u5076\u6821\u9a8c\u4fe1\u606f\u5e76\u4e0d\u662f\u5355\u72ec\u4fdd\u5b58\u5230\u67d0\u4e00\u5757\u786c\u76d8\u8bbe\u5907\u4e2d\uff0c\u800c\u662f\u5b58\u50a8\u5230\u9664\u81ea\u8eab\u4ee5\u5916\u7684\u5176\u4ed6\u6bcf\u4e00\u5757\u786c\u76d8\u8bbe\u5907\u4e0a\uff0c\u8fd9\u6837\u7684\u597d\u5904\u662f\u5176\u4e2d\u4efb\u4f55\u4e00\u8bbe\u5907\u635f\u574f\u540e\u4e0d\u81f3\u4e8e\u51fa\u73b0\u81f4\u547d\u7f3a\u9677\uff1b\u56fe7-3\u4e2dparity\u90e8\u5206\u5b58\u653e\u7684\u5c31\u662f\u6570\u636e\u7684\u5947\u5076\u6821\u9a8c\u4fe1\u606f\uff0c\u6362\u53e5\u8bdd\u8bf4\uff0c\u5c31\u662fRAID 5\u6280\u672f\u5b9e\u9645\u4e0a\u6ca1\u6709\u5907\u4efd\u786c\u76d8\u4e2d\u7684\u771f\u5b9e\u6570\u636e\u4fe1\u606f\uff0c\u800c\u662f\u5f53\u786c\u76d8\u8bbe\u5907\u51fa\u73b0\u95ee\u9898\u540e\u901a\u8fc7\u5947\u5076\u6821\u9a8c\u4fe1\u606f\u6765\u5c1d\u8bd5\u91cd\u5efa\u635f\u574f\u7684\u6570\u636e\u3002RAID\u8fd9\u6837\u7684\u6280\u672f\u7279\u6027\u201c\u59a5\u534f\u201d\u5730\u517c\u987e\u4e86\u786c\u76d8\u8bbe\u5907\u7684\u8bfb\u5199\u901f\u5ea6\u3001\u6570\u636e\u5b89\u5168\u6027\u4e0e\u5b58\u50a8\u6210\u672c\u95ee\u9898\u3002<\/p>\n

<\/div>\n

\u56fe7-3\u00a0 RAID5\u6280\u672f\u793a\u610f\u56fe<\/p>\n

4. \u00a0RAID 10<\/strong><\/span><\/p>\n

\u9274\u4e8eRAID 5\u6280\u672f\u662f\u56e0\u4e3a\u786c\u76d8\u8bbe\u5907\u7684\u6210\u672c\u95ee\u9898\u5bf9\u8bfb\u5199\u901f\u5ea6\u548c\u6570\u636e\u7684\u5b89\u5168\u6027\u80fd\u800c\u6709\u4e86\u4e00\u5b9a\u7684\u59a5\u534f\uff0c\u4f46\u662f\u5927\u90e8\u5206\u4f01\u4e1a\u66f4\u5728\u4e4e\u7684\u662f\u6570\u636e\u672c\u8eab\u7684\u4ef7\u503c\u800c\u975e\u786c\u76d8\u4ef7\u683c\uff0c\u56e0\u6b64\u751f\u4ea7\u73af\u5883\u4e2d\u4e3b\u8981\u4f7f\u7528RAID 10\u6280\u672f\u3002<\/p>\n

\u987e\u540d\u601d\u4e49\uff0cRAID 10\u6280\u672f\u662fRAID 1+RAID 0\u6280\u672f\u7684\u4e00\u4e2a\u201c\u7ec4\u5408\u4f53\u201d\u3002\u5982\u56fe7-4\u6240\u793a\uff0cRAID 10\u6280\u672f\u9700\u8981\u81f3\u5c114\u5757\u786c\u76d8\u6765\u7ec4\u5efa\uff0c\u5176\u4e2d\u5148\u5206\u522b\u4e24\u4e24\u5236\u4f5c\u6210RAID 1\u78c1\u76d8\u9635\u5217\uff0c\u4ee5\u4fdd\u8bc1\u6570\u636e\u7684\u5b89\u5168\u6027\uff1b\u7136\u540e\u518d\u5bf9\u4e24\u4e2aRAID 1\u78c1\u76d8\u9635\u5217\u5b9e\u65bdRAID 0\u6280\u672f\uff0c\u8fdb\u4e00\u6b65\u63d0\u9ad8\u786c\u76d8\u8bbe\u5907\u7684\u8bfb\u5199\u901f\u5ea6\u3002\u8fd9\u6837\u4ece\u7406\u8bba\u4e0a\u6765\u8bb2\uff0c\u53ea\u8981\u574f\u7684\u4e0d\u662f\u540c\u4e00\u7ec4\u4e2d\u7684\u6240\u6709\u786c\u76d8\uff0c\u90a3\u4e48\u6700\u591a\u53ef\u4ee5\u635f\u574f50%\u7684\u786c\u76d8\u8bbe\u5907\u800c\u4e0d\u4e22\u5931\u6570\u636e\u3002\u7531\u4e8eRAID 10\u6280\u672f\u7ee7\u627f\u4e86RAID 0\u7684\u9ad8\u8bfb\u5199\u901f\u5ea6\u548cRAID 1\u7684\u6570\u636e\u5b89\u5168\u6027\uff0c\u5728\u4e0d\u8003\u8651\u6210\u672c\u7684\u60c5\u51b5\u4e0bRAID 10\u7684\u6027\u80fd\u90fd\u8d85\u8fc7\u4e86RAID 5\uff0c\u56e0\u6b64\u5f53\u524d\u6210\u4e3a\u5e7f\u6cdb\u4f7f\u7528\u7684\u4e00\u79cd\u5b58\u50a8\u6280\u672f\u3002<\/p>\n

\"\"<\/div>\n

\u56fe7-4\u00a0 RAID 10\u6280\u672f\u793a\u610f\u56fe<\/p>\n

7.1.1\u00a0 \u90e8\u7f72\u78c1\u76d8\u9635\u5217<\/strong><\/span><\/h6>\n

\u5728\u5177\u5907\u4e86\u4e0a\u4e00\u7ae0\u7684\u786c\u76d8\u8bbe\u5907\u7ba1\u7406\u57fa\u7840\u4e4b\u540e\uff0c\u518d\u6765\u90e8\u7f72RAID\u548cLVM\u5c31\u53d8\u5f97\u5341\u5206\u8f7b\u677e\u4e86\u3002\u9996\u5148\uff0c\u9700\u8981\u5728\u865a\u62df\u673a\u4e2d\u6dfb\u52a04\u5757\u786c\u76d8\u8bbe\u5907\u6765\u5236\u4f5c\u4e00\u4e2aRAID 10\u78c1\u76d8\u9635\u5217\uff0c\u5982\u56fe7-5\u6240\u793a\u3002<\/p>\n

\"\u865a\u62df\u673a\u6dfb\u52a0\u786c\u76d8\"<\/div>\n

\u56fe7-5\u00a0 \u4e3a\u865a\u62df\u673a\u7cfb\u7edf\u6a21\u62df\u6dfb\u52a04\u5757\u786c\u76d8\u8bbe\u5907<\/p>\n

\u8fd9\u51e0\u5757\u786c\u76d8\u8bbe\u5907\u662f\u6a21\u62df\u51fa\u6765\u7684\uff0c\u4e0d\u9700\u8981\u7279\u610f\u53bb\u4e70\u51e0\u5757\u771f\u5b9e\u7684\u7269\u7406\u786c\u76d8\u63d2\u5230\u7535\u8111\u4e0a\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u4e00\u5b9a\u8981\u8bb0\u5f97\u5728\u5173\u95ed\u7cfb\u7edf\u4e4b\u540e\uff0c\u518d\u5728\u865a\u62df\u673a\u4e2d\u6dfb\u52a0\u786c\u76d8\u8bbe\u5907\uff0c\u5426\u5219\u53ef\u80fd\u4f1a\u56e0\u4e3a\u8ba1\u7b97\u673a\u67b6\u6784\u7684\u4e0d\u540c\u800c\u5bfc\u81f4\u865a\u62df\u673a\u7cfb\u7edf\u65e0\u6cd5\u8bc6\u522b\u6dfb\u52a0\u7684\u786c\u76d8\u8bbe\u5907\u3002<\/p>\n

mdadm\u547d\u4ee4\u7528\u4e8e\u7ba1\u7406Linux\u7cfb\u7edf\u4e2d\u7684\u8f6f\u4ef6RAID\u786c\u76d8\u9635\u5217\uff0c\u683c\u5f0f\u4e3a\u201cmdadm [\u6a21\u5f0f] <RAID\u8bbe\u5907\u540d\u79f0> [\u9009\u9879] [\u6210\u5458\u8bbe\u5907\u540d\u79f0]\u201d\u3002<\/p>\n

\u5f53\u524d\uff0c\u751f\u4ea7\u73af\u5883\u4e2d\u7528\u5230\u7684\u670d\u52a1\u5668\u4e00\u822c\u90fd\u914d\u5907RAID\u9635\u5217\u5361\uff0c\u5c3d\u7ba1\u670d\u52a1\u5668\u7684\u4ef7\u683c\u8d8a\u6765\u8d8a\u4fbf\u5b9c\uff0c\u4f46\u662f\u6211\u4eec\u6ca1\u6709\u5fc5\u8981\u4e3a\u4e86\u505a\u4e00\u4e2a\u5b9e\u9a8c\u800c\u53bb\u5355\u72ec\u8d2d\u4e70\u4e00\u53f0\u670d\u52a1\u5668\uff0c\u800c\u662f\u53ef\u4ee5\u5b66\u4f1a\u7528mdadm\u547d\u4ee4\u5728Linux\u7cfb\u7edf\u4e2d\u521b\u5efa\u548c\u7ba1\u7406\u8f6f\u4ef6RAID\u78c1\u76d8\u9635\u5217\uff0c\u800c\u4e14\u5b83\u6d89\u53ca\u7684\u7406\u8bba\u77e5\u8bc6\u7684\u64cd\u4f5c\u8fc7\u7a0b\u4e0e\u751f\u4ea7\u73af\u5883\u4e2d\u7684\u5b8c\u5168\u4e00\u81f4\u3002mdadm\u547d\u4ee4\u7684\u5e38\u7528\u53c2\u6570\u4ee5\u53ca\u4f5c\u7528\u5982\u88687-1\u6240\u793a\u3002<\/p>\n

\u88687-1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 mdadm\u547d\u4ee4\u7684\u5e38\u7528\u53c2\u6570\u548c\u4f5c\u7528<\/p>\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u53c2\u6570<\/td>\n\u4f5c\u7528<\/td>\n<\/tr>\n
-a<\/td>\n\u81ea\u52a8\u68c0\u6d4b\u8bbe\u5907\u540d\u79f0<\/td>\n<\/tr>\n
-n<\/td>\n\u6307\u5b9a\u8bbe\u5907\u6570\u91cf<\/td>\n<\/tr>\n
-l<\/td>\n\u6307\u5b9aRAID\u7ea7\u522b<\/td>\n<\/tr>\n
-C<\/td>\n\u521b\u5efa\u65b0\u7684RAID\u9635\u5217<\/td>\n<\/tr>\n
-v<\/td>\n\u663e\u793a\u8be6\u7ec6\u8fc7\u7a0b\u4fe1\u606f<\/td>\n<\/tr>\n
-f<\/td>\n\u6a21\u62df\u8bbe\u5907\u635f\u574f<\/td>\n<\/tr>\n
-r<\/td>\n\u79fb\u9664\u8bbe\u5907<\/td>\n<\/tr>\n
-Q<\/td>\n\u67e5\u770b\u6458\u8981\u4fe1\u606f<\/td>\n<\/tr>\n
-D<\/td>\n\u67e5\u770b\u8be6\u7ec6\u4fe1\u606f<\/td>\n<\/tr>\n
-S<\/td>\n\u505c\u6b62RAID\u9635\u5217<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/div>\n

\u63a5\u4e0b\u6765\uff0c\u4f7f\u7528mdadm\u547d\u4ee4\u521b\u5efaRAID 10\uff0c\u540d\u79f0\u4e3a\u201c\/dev\/md0\u201d\u3002<\/p>\n

\u7b2c6\u7ae0\u4e2d\u8bb2\u5230\uff0cudev\u662fLinux\u7cfb\u7edf\u5185\u6838\u4e2d\u7528\u6765\u7ed9\u786c\u4ef6\u547d\u540d\u7684\u670d\u52a1\uff0c\u5176\u547d\u540d\u89c4\u5219\u4e5f\u975e\u5e38\u7b80\u5355\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u547d\u540d\u89c4\u5219\u731c\u6d4b\u5230\u7b2c\u4e8c\u4e2aSCSI\u5b58\u50a8\u8bbe\u5907\u7684\u540d\u79f0\u4f1a\u662f\/dev\/sdb\uff0c\u7136\u540e\u4f9d\u6b64\u7c7b\u63a8\u3002\u4f7f\u7528\u786c\u76d8\u8bbe\u5907\u6765\u90e8\u7f72RAID\u78c1\u76d8\u9635\u5217\u5f88\u50cf\u662f\u5c06\u51e0\u4f4d\u540c\u5b66\u7ec4\u6210\u4e00\u4e2a\u73ed\u7ea7\uff0c\u4f46\u603b\u4e0d\u80fd\u5c06\u73ed\u7ea7\u547d\u540d\u4e3a\/dev\/sdbcde\u5427\u3002\u5c3d\u7ba1\u8fd9\u6837\u53ef\u4ee5\u4e00\u773c\u770b\u51fa\u5b83\u662f\u7531\u54ea\u4e9b\u5143\u7d20\u7ec4\u6210\u7684\uff0c\u4f46\u662f\u5e76\u4e0d\u5229\u4e8e\u6211\u4eec\u7684\u8bb0\u5fc6\u548c\u9605\u8bfb\u3002\u66f4\u4f55\u51b5\u5982\u679c\u6211\u4eec\u662f\u4f7f\u752810\u300150\u3001100\u4e2a\u786c\u76d8\u6765\u90e8\u7f72RAID\u78c1\u76d8\u9635\u5217\u5462\uff1f<\/p>\n

\u6b64\u65f6\uff0c\u5c31\u9700\u8981\u4f7f\u7528mdadm\u4e2d\u7684\u53c2\u6570\u4e86\u3002\u5176\u4e2d\uff0c-C\u53c2\u6570\u4ee3\u8868\u521b\u5efa\u4e00\u4e2aRAID\u9635\u5217\u5361\uff1b-v\u53c2\u6570\u663e\u793a\u521b\u5efa\u7684\u8fc7\u7a0b\uff0c\u540c\u65f6\u5728\u540e\u9762\u8ffd\u52a0\u4e00\u4e2a\u8bbe\u5907\u540d\u79f0\/dev\/md0\uff0c\u8fd9\u6837\/dev\/md0\u5c31\u662f\u521b\u5efa\u540e\u7684RAID\u78c1\u76d8\u9635\u5217\u7684\u540d\u79f0\uff1b-a yes\u53c2\u6570\u4ee3\u8868\u81ea\u52a8\u521b\u5efa\u8bbe\u5907\u6587\u4ef6\uff1b-n 4\u53c2\u6570\u4ee3\u8868\u4f7f\u75284\u5757\u786c\u76d8\u6765\u90e8\u7f72\u8fd9\u4e2aRAID\u78c1\u76d8\u9635\u5217\uff1b\u800c-l 10\u53c2\u6570\u5219\u4ee3\u8868RAID 10\u65b9\u6848\uff1b\u6700\u540e\u518d\u52a0\u4e0a4\u5757\u786c\u76d8\u8bbe\u5907\u7684\u540d\u79f0\u5c31\u641e\u5b9a\u4e86\u3002<\/p>\n

[root@linuxprobe ~]# mdadm -Cv \/dev\/md0 -a yes -n 4 -l 10 \/dev\/sdb \/dev\/sdc \/dev\/sdd \/dev\/sde\r\nmdadm: layout defaults to n2\r\nmdadm: layout defaults to n2\r\nmdadm: chunk size defaults to 512K\r\nmdadm: size set to 20954624K\r\nmdadm: Defaulting to version 1.2 metadata\r\nmdadm: array \/dev\/md0 started.\r\n<\/pre>\n

\u5176\u6b21\uff0c\u628a\u5236\u4f5c\u597d\u7684RAID\u78c1\u76d8\u9635\u5217\u683c\u5f0f\u5316\u4e3aext4\u683c\u5f0f\u3002<\/p>\n

[root@linuxprobe ~]# mkfs.ext4 \/dev\/md0\r\nmke2fs 1.42.9 (28-Dec-2013)\r\nFilesystem label=\r\nOS type: Linux\r\nBlock size=4096 (log=2)\r\nFragment size=4096 (log=2)\r\nStride=128 blocks, Stripe width=256 blocks\r\n2621440 inodes, 10477312 blocks\r\n523865 blocks (5.00%) reserved for the super user\r\nFirst data block=0\r\nMaximum filesystem blocks=2157969408\r\n320 block groups\r\n32768 blocks per group, 32768 fragments per group\r\n8192 inodes per group\r\nSuperblock backups stored on blocks:\r\n32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,\r\n4096000, 7962624\r\nAllocating group tables: done\r\nWriting inode tables: done\r\nCreating journal (32768 blocks): done\r\nWriting superblocks and filesystem accounting information: done\r\n<\/pre>\n

\u518d\u6b21\uff0c\u521b\u5efa\u6302\u8f7d\u70b9\u7136\u540e\u628a\u786c\u76d8\u8bbe\u5907\u8fdb\u884c\u6302\u8f7d\u64cd\u4f5c\u3002\u6302\u8f7d\u6210\u529f\u540e\u53ef\u770b\u5230\u53ef\u7528\u7a7a\u95f4\u4e3a40GB\u3002<\/p>\n

[root@linuxprobe ~]# mkdir \/RAID\r\n[root@linuxprobe ~]# mount \/dev\/md0 \/RAID\r\n[root@linuxprobe ~]# df -h\r\nFilesystem Size Used Avail Use% Mounted on\r\n\/dev\/mapper\/rhel-root 18G 3.0G 15G 17% \/\r\ndevtmpfs 905M 0 905M 0% \/dev\r\ntmpfs 914M 84K 914M 1% \/dev\/shm\r\ntmpfs 914M 8.9M 905M 1% \/run\r\ntmpfs 914M 0 914M 0% \/sys\/fs\/cgroup\r\n\/dev\/sr0 3.5G 3.5G 0 100% \/media\/cdrom\r\n\/dev\/sda1 497M 119M 379M 24% \/boot\r\n\/dev\/md0 40G 49M 38G 1% \/RAID\r\n<\/strong><\/pre>\n

\u6700\u540e\uff0c\u67e5\u770b\/dev\/md0\u78c1\u76d8\u9635\u5217\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u5e76\u628a\u6302\u8f7d\u4fe1\u606f\u5199\u5165\u5230\u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u4f7f\u5176\u6c38\u4e45\u751f\u6548\u3002<\/p>\n

[root@linuxprobe ~]# mdadm -D \/dev\/md0\r\n\/dev\/md0:\r\nVersion : 1.2\r\nCreation Time : Tue May 5 07:43:26 2017\r\nRaid Level : raid10\r\nArray Size : 41909248 (39.97 GiB 42.92 GB)\r\nUsed Dev Size : 20954624 (19.98 GiB 21.46 GB)\r\nRaid Devices : 4\r\nTotal Devices : 4\r\nPersistence : Superblock is persistent\r\nUpdate Time : Tue May 5 07:46:59 2017\r\nState : clean\r\nActive Devices : 4\r\nWorking Devices : 4\r\nFailed Devices : 0\r\nSpare Devices : 0\r\nLayout : near=2\r\nChunk Size : 512K\r\nName : localhost.localdomain:0 (local to host localhost.localdomain)\r\nUUID : cc9a87d4:1e89e175:5383e1e8:a78ec62c\r\nEvents : 17\r\nNumber Major Minor RaidDevice State\r\n0 8 16 0 active sync \/dev\/sdb\r\n1 8 32 1 active sync \/dev\/sdc\r\n2 8 48 2 active sync \/dev\/sdd\r\n3 8 64 3 active sync \/dev\/sde\r\n[root@linuxprobe ~]# echo \"\/dev\/md0 \/RAID ext4 defaults 0 0\" >> \/etc\/fstab\r\n<\/pre>\n
7.1.2\u00a0 \u635f\u574f\u78c1\u76d8\u9635\u5217\u53ca\u4fee\u590d<\/strong><\/span><\/h6>\n

\u4e4b\u6240\u4ee5\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u90e8\u7f72RAID 10\u78c1\u76d8\u9635\u5217\uff0c\u662f\u4e3a\u4e86\u63d0\u9ad8\u786c\u76d8\u5b58\u50a8\u8bbe\u5907\u7684\u8bfb\u5199\u901f\u5ea6\u53ca\u6570\u636e\u7684\u5b89\u5168\u6027\uff0c\u4f46\u7531\u4e8e\u6211\u4eec\u7684\u786c\u76d8\u8bbe\u5907\u662f\u5728\u865a\u62df\u673a\u4e2d\u6a21\u62df\u51fa\u6765\u7684\uff0c\u56e0\u6b64\u5bf9\u8bfb\u5199\u901f\u5ea6\u7684\u6539\u5584\u53ef\u80fd\u5e76\u4e0d\u76f4\u89c2\uff0c\u56e0\u6b64\u5218\u9044\u8001\u5e08\u51b3\u5b9a\u7ed9\u5404\u4f4d\u8bfb\u8005\u8bb2\u89e3\u4e00\u4e0bRAID\u78c1\u76d8\u9635\u5217\u635f\u574f\u540e\u7684\u5904\u7406\u65b9\u6cd5\uff0c\u8fd9\u6837\u5927\u5bb6\u5728\u6b65\u5165\u8fd0\u7ef4\u5c97\u4f4d\u540e\u9047\u5230\u7c7b\u4f3c\u95ee\u9898\u65f6\uff0c\u4e5f\u53ef\u4ee5\u8f7b\u677e\u89e3\u51b3\u3002<\/p>\n

\u5728\u786e\u8ba4\u6709\u4e00\u5757\u7269\u7406\u786c\u76d8\u8bbe\u5907\u51fa\u73b0\u635f\u574f\u800c\u4e0d\u80fd\u7ee7\u7eed\u6b63\u5e38\u4f7f\u7528\u540e\uff0c\u5e94\u8be5\u4f7f\u7528mdadm\u547d\u4ee4\u5c06\u5176\u79fb\u9664\uff0c\u7136\u540e\u67e5\u770bRAID\u78c1\u76d8\u9635\u5217\u7684\u72b6\u6001\uff0c\u53ef\u4ee5\u53d1\u73b0\u72b6\u6001\u5df2\u7ecf\u6539\u53d8\u3002<\/p>\n

\u54b1\u4eec\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u90e8\u7f72RAID10\u78c1\u76d8\u9635\u5217\u7ec4\u76ee\u7684\u5c31\u662f\u4e3a\u4e86\u63d0\u9ad8\u5b58\u50a8\u8bbe\u5907\u7684IO\u8bfb\u5199\u901f\u5ea6\u53ca\u6570\u636e\u7684\u5b89\u5168\u6027\uff0c\u4f46\u56e0\u4e3a\u8fd9\u6b21\u662f\u5728\u672c\u673a\u7535\u8111\u4e0a\u6a21\u62df\u51fa\u6765\u7684\u786c\u76d8\u8bbe\u5907\u6240\u4ee5\u5bf9\u4e8e\u8bfb\u5199\u901f\u5ea6\u7684\u6539\u5584\u53ef\u80fd\u5e76\u4e0d\u76f4\u89c2\uff0c\u56e0\u6b64\u5218\u9044\u8001\u5e08\u51b3\u5b9a\u7ed9\u540c\u5b66\u4eec\u8bb2\u89e3\u4e0bRAID\u78c1\u76d8\u9635\u5217\u7ec4\u635f\u574f\u540e\u7684\u5904\u7406\u65b9\u6cd5\uff0c\u8fd9\u6837\u4ee5\u540e\u6b65\u5165\u4e86\u8fd0\u7ef4\u5c97\u4f4d\u540e\u4e0d\u4f1a\u56e0\u4e3a\u7a81\u53d1\u4e8b\u4ef6\u800c\u624b\u5fd9\u811a\u4e71\u3002\u9996\u5148\u786e\u8ba4\u6709\u4e00\u5757\u7269\u7406\u786c\u76d8\u8bbe\u5907\u51fa\u73b0\u635f\u574f\u4e0d\u80fd\u518d\u7ee7\u7eed\u6b63\u5e38\u4f7f\u7528\u540e\uff0c\u5e94\u8be5\u4f7f\u7528mdadm\u547d\u4ee4\u6765\u4e88\u4ee5\u79fb\u9664\u4e4b\u540e\u67e5\u770b\u4e0bRAID\u78c1\u76d8\u9635\u5217\u7ec4\u7684\u72b6\u6001\u5df2\u7ecf\u88ab\u6539\u53d8\uff1a<\/p>\n

[root@linuxprobe ~]# mdadm \/dev\/md0 -f \/dev\/sdb\r\nmdadm: set \/dev\/sdb faulty in \/dev\/md0\r\n[root@linuxprobe ~]# mdadm -D \/dev\/md0\r\n\/dev\/md0:\r\nVersion : 1.2\r\nCreation Time : Fri May 8 08:11:00 2017\r\nRaid Level : raid10\r\nArray Size : 41909248 (39.97 GiB 42.92 GB)\r\nUsed Dev Size : 20954624 (19.98 GiB 21.46 GB)\r\nRaid Devices : 4\r\nTotal Devices : 4\r\nPersistence : Superblock is persistent\r\nUpdate Time : Fri May 8 08:27:18 2017\r\nState : clean, degraded\r\nActive Devices : 3\r\nWorking Devices : 3\r\nFailed Devices : 1\r\nSpare Devices : 0\r\nLayout : near=2\r\nChunk Size : 512K\r\nName : lrxjmw.cn:0 (local to host lrxjmw.cn)\r\nUUID : f2993bbd:99c1eb63:bd61d4d4:3f06c3b0\r\nEvents : 21\r\nNumber Major Minor RaidDevice State\r\n0 0 0 0 removed\r\n1 8 32 1 active sync \/dev\/sdc\r\n2 8 48 2 active sync \/dev\/sdd\r\n3 8 64 3 active sync \/dev\/sde\r\n0 8 16 - faulty \/dev\/sdb\r\n<\/strong><\/pre>\n

\u5728RAID 10\u7ea7\u522b\u7684\u78c1\u76d8\u9635\u5217\u4e2d\uff0c\u5f53RAID 1\u78c1\u76d8\u9635\u5217\u4e2d\u5b58\u5728\u4e00\u4e2a\u6545\u969c\u76d8\u65f6\u5e76\u4e0d\u5f71\u54cdRAID 10\u78c1\u76d8\u9635\u5217\u7684\u4f7f\u7528\u3002\u5f53\u8d2d\u4e70\u4e86\u65b0\u7684\u786c\u76d8\u8bbe\u5907\u540e\u518d\u4f7f\u7528mdadm\u547d\u4ee4\u6765\u4e88\u4ee5\u66ff\u6362\u5373\u53ef\uff0c\u5728\u6b64\u671f\u95f4\u6211\u4eec\u53ef\u4ee5\u5728\/RAID\u76ee\u5f55\u4e2d\u6b63\u5e38\u5730\u521b\u5efa\u6216\u5220\u9664\u6587\u4ef6\u3002\u7531\u4e8e\u6211\u4eec\u662f\u5728\u865a\u62df\u673a\u4e2d\u6a21\u62df\u786c\u76d8\uff0c\u6240\u4ee5\u5148\u91cd\u542f\u7cfb\u7edf\uff0c\u7136\u540e\u518d\u628a\u65b0\u7684\u786c\u76d8\u6dfb\u52a0\u5230RAID\u78c1\u76d8\u9635\u5217\u4e2d\u3002<\/p>\n

[root@linuxprobe ~]# umount \/RAID\r\n[root@linuxprobe ~]# mdadm \/dev\/md0 -a \/dev\/sdb\r\n[root@linuxprobe ~]# mdadm -D \/dev\/md0\r\n\/dev\/md0:\r\n Version : 1.2\r\n Creation Time : Mon Jan 30 00:08:56 2017\r\n Raid Level : raid10\r\n Array Size : 41909248 (39.97 GiB 42.92 GB)\r\n Used Dev Size : 20954624 (19.98 GiB 21.46 GB)\r\n Raid Devices : 4\r\n Total Devices : 4\r\n Persistence : Superblock is persistent\r\n Update Time : Mon Jan 30 00:19:53 2017\r\n State : clean \r\n Active Devices : 4\r\nWorking Devices : 4\r\n Failed Devices : 0\r\n Spare Devices : 0\r\n Layout : near=2\r\n Chunk Size : 512K\r\n Name : localhost.localdomain:0 (local to host localhost.localdomain)\r\n UUID : d3491c05:cfc81ca0:32489f04:716a2cf0\r\n Events : 56\r\n Number Major Minor RaidDevice State<\/strong>\r\n 4 8 16 0 active sync \/dev\/sdb<\/strong>\r\n 1 8 32 1 active sync \/dev\/sdc<\/strong>\r\n 2 8 48 2 active sync \/dev\/sdd<\/strong>\r\n 3 8 64 3 active sync \/dev\/sde\r\n<\/strong>[root@linuxprobe ~]# mount -a<\/pre>\n
7.1.3\u00a0 \u78c1\u76d8\u9635\u5217+\u5907\u4efd\u76d8<\/strong><\/span><\/h6>\n

RAID 10\u78c1\u76d8\u9635\u5217\u4e2d\u6700\u591a\u5141\u8bb850%\u7684\u786c\u76d8\u8bbe\u5907\u53d1\u751f\u6545\u969c\uff0c\u4f46\u662f\u5b58\u5728\u8fd9\u6837\u4e00\u79cd\u6781\u7aef\u60c5\u51b5\uff0c\u5373\u540c\u4e00RAID 1\u78c1\u76d8\u9635\u5217\u4e2d\u7684\u786c\u76d8\u8bbe\u5907\u82e5\u5168\u90e8\u635f\u574f\uff0c\u4e5f\u4f1a\u5bfc\u81f4\u6570\u636e\u4e22\u5931\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u5728RAID 10\u78c1\u76d8\u9635\u5217\u4e2d\uff0c\u5982\u679cRAID 1\u4e2d\u7684\u67d0\u4e00\u5757\u786c\u76d8\u51fa\u73b0\u4e86\u6545\u969c\uff0c\u800c\u6211\u4eec\u6b63\u5728\u524d\u5f80\u4fee\u590d\u7684\u8def\u4e0a\uff0c\u6070\u5de7\u8be5RAID1\u78c1\u76d8\u9635\u5217\u4e2d\u7684\u53e6\u4e00\u5757\u786c\u76d8\u8bbe\u5907\u4e5f\u51fa\u73b0\u6545\u969c\uff0c\u90a3\u4e48\u6570\u636e\u5c31\u88ab\u5f7b\u5e95\u4e22\u5931\u4e86\u3002\u5218\u9044\u8001\u5e08\u53ef\u771f\u4e0d\u662f\u4e4c\u9e26\u5634\uff0c\u8fd9\u79cdRAID 1\u78c1\u76d8\u9635\u5217\u4e2d\u7684\u786c\u76d8\u8bbe\u5907\u540c\u65f6\u635f\u574f\u7684\u60c5\u51b5\u8fd8\u771f\u88ab\u6211\u7684\u5b66\u751f\u9047\u5230\u8fc7\u3002<\/p>\n

\u5728\u8fd9\u6837\u7684\u60c5\u51b5\u4e0b\uff0c\u8be5\u600e\u4e48\u529e\u5462\uff1f\u5176\u5b9e\uff0c\u6211\u4eec\u5b8c\u5168\u53ef\u4ee5\u4f7f\u7528RAID\u5907\u4efd\u76d8\u6280\u672f\u6765\u9884\u9632\u8fd9\u7c7b\u4e8b\u6545\u3002\u8be5\u6280\u672f\u7684\u6838\u5fc3\u7406\u5ff5\u5c31\u662f\u51c6\u5907\u4e00\u5757\u8db3\u591f\u5927\u7684\u786c\u76d8\uff0c\u8fd9\u5757\u786c\u76d8\u5e73\u65f6\u5904\u4e8e\u95f2\u7f6e\u72b6\u6001\uff0c\u4e00\u65e6RAID\u78c1\u76d8\u9635\u5217\u4e2d\u6709\u786c\u76d8\u51fa\u73b0\u6545\u969c\u540e\u5219\u4f1a\u9a6c\u4e0a\u81ea\u52a8\u9876\u66ff\u4e0a\u53bb\u3002\u8fd9\u6837\u5f88\u68d2\u5427\uff01<\/p>\n

\u4e3a\u4e86\u907f\u514d\u591a\u4e2a\u5b9e\u9a8c\u4e4b\u95f4\u76f8\u4e92\u53d1\u751f\u51b2\u7a81\uff0c\u6211\u4eec\u9700\u8981\u4fdd\u8bc1\u6bcf\u4e2a\u5b9e\u9a8c\u7684\u76f8\u5bf9\u72ec\u7acb\u6027\uff0c\u4e3a\u6b64\u9700\u8981\u5927\u5bb6\u81ea\u884c\u5c06\u865a\u62df\u673a\u8fd8\u539f\u5230\u521d\u59cb\u72b6\u6001\u3002\u53e6\u5916\uff0c\u7531\u4e8e\u521a\u624d\u5df2\u7ecf\u6f14\u793a\u4e86RAID 10\u78c1\u76d8\u9635\u5217\u7684\u90e8\u7f72\u65b9\u6cd5\uff0c\u6211\u4eec\u73b0\u5728\u6765\u770b\u4e00\u4e0bRAID 5\u7684\u90e8\u7f72\u6548\u679c\u3002\u90e8\u7f72RAID 5\u78c1\u76d8\u9635\u5217\u65f6\uff0c\u81f3\u5c11\u9700\u8981\u7528\u52303\u5757\u786c\u76d8\uff0c\u8fd8\u9700\u8981\u518d\u52a0\u4e00\u5757\u5907\u4efd\u786c\u76d8\uff0c\u6240\u4ee5\u603b\u8ba1\u9700\u8981\u5728\u865a\u62df\u673a\u4e2d\u6a21\u62df4\u5757\u786c\u76d8\u8bbe\u5907\uff0c\u5982\u56fe7-6\u6240\u793a\u3002<\/p>\n

\"\u7b2c7\u7ae0<\/div>\n

\u56fe7-6\u00a0 \u5728\u865a\u62df\u673a\u4e2d\u6a21\u62df\u6dfb\u52a04\u5757\u786c\u76d8\u8bbe\u5907<\/p>\n

\u73b0\u5728\u521b\u5efa\u4e00\u4e2aRAID 5\u78c1\u76d8\u9635\u5217+\u5907\u4efd\u76d8\u3002\u5728\u4e0b\u9762\u7684\u547d\u4ee4\u4e2d\uff0c\u53c2\u6570-n 3\u4ee3\u8868\u521b\u5efa\u8fd9\u4e2aRAID 5\u78c1\u76d8\u9635\u5217\u6240\u9700\u7684\u786c\u76d8\u6570\uff0c\u53c2\u6570-l 5\u4ee3\u8868RAID\u7684\u7ea7\u522b\uff0c\u800c\u53c2\u6570-x 1\u5219\u4ee3\u8868\u6709\u4e00\u5757\u5907\u4efd\u76d8\u3002\u5f53\u67e5\u770b\/dev\/md0\uff08\u5373RAID 5\u78c1\u76d8\u9635\u5217\u7684\u540d\u79f0\uff09\u78c1\u76d8\u9635\u5217\u7684\u65f6\u5019\u5c31\u80fd\u770b\u5230\u6709\u4e00\u5757\u5907\u4efd\u76d8\u5728\u7b49\u5f85\u4e2d\u4e86\u3002<\/p>\n

[root@linuxprobe ~]# mdadm -Cv \/dev\/md0 -n 3 -l 5 -x 1 \/dev\/sdb \/dev\/sdc \/dev\/sdd \/dev\/sde\r\nmdadm: layout defaults to left-symmetric\r\nmdadm: layout defaults to left-symmetric\r\nmdadm: chunk size defaults to 512K\r\nmdadm: size set to 20954624K\r\nmdadm: Defaulting to version 1.2 metadata\r\nmdadm: array \/dev\/md0 started.\r\n[root@linuxprobe ~]# mdadm -D \/dev\/md0\r\n\/dev\/md0:\r\nVersion : 1.2\r\nCreation Time : Fri May 8 09:20:35 2017\r\nRaid Level : raid5\r\nArray Size : 41909248 (39.97 GiB 42.92 GB)\r\nUsed Dev Size : 20954624 (19.98 GiB 21.46 GB)\r\nRaid Devices : 3\r\nTotal Devices : 4\r\nPersistence : Superblock is persistent\r\nUpdate Time : Fri May 8 09:22:22 2017\r\nState : clean\r\nActive Devices : 3\r\nWorking Devices : 4\r\nFailed Devices : 0\r\nSpare Devices : 1\r\nLayout : left-symmetric\r\nChunk Size : 512K\r\nName : lrxjmw.cn:0 (local to host lrxjmw.cn)\r\nUUID : 44b1a152:3f1809d3:1d234916:4ac70481\r\nEvents : 18\r\nNumber Major Minor RaidDevice State\r\n0 8 16 0 active sync \/dev\/sdb\r\n1 8 32 1 active sync \/dev\/sdc\r\n4 8 48 2 active sync \/dev\/sdd\r\n3 8 64 - spare \/dev\/sde\r\n<\/strong><\/pre>\n

\u73b0\u5728\u5c06\u90e8\u7f72\u597d\u7684RAID 5\u78c1\u76d8\u9635\u5217\u683c\u5f0f\u5316\u4e3aext4\u6587\u4ef6\u683c\u5f0f\uff0c\u7136\u540e\u6302\u8f7d\u5230\u76ee\u5f55\u4e0a\uff0c\u4e4b\u540e\u5c31\u53ef\u4ee5\u4f7f\u7528\u4e86\u3002<\/p>\n

[root@linuxprobe ~]# mkfs.ext4 \/dev\/md0\r\nmke2fs 1.42.9 (28-Dec-2013)\r\nFilesystem label=\r\nOS type: Linux\r\nBlock size=4096 (log=2)\r\nFragment size=4096 (log=2)\r\nStride=128 blocks, Stripe width=256 blocks\r\n2621440 inodes, 10477312 blocks\r\n523865 blocks (5.00%) reserved for the super user\r\nFirst data block=0\r\nMaximum filesystem blocks=2157969408\r\n320 block groups\r\n32768 blocks per group, 32768 fragments per group\r\n8192 inodes per group\r\nSuperblock backups stored on blocks:\r\n32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,\r\n4096000, 7962624\r\nAllocating group tables: done\r\nWriting inode tables: done\r\nCreating journal (32768 blocks): done\r\nWriting superblocks and filesystem accounting information: done\r\n[root@linuxprobe ~]# echo \"\/dev\/md0 \/RAID ext4 defaults 0 0\" >> \/etc\/fstab\r\n[root@linuxprobe ~]# mkdir \/RAID\r\n[root@linuxprobe ~]# mount -a<\/pre>\n

\u6700\u540e\u662f\u89c1\u8bc1\u5947\u8ff9\u7684\u65f6\u523b\uff01\u6211\u4eec\u518d\u6b21\u628a\u786c\u76d8\u8bbe\u5907\/dev\/sdb\u79fb\u51fa\u78c1\u76d8\u9635\u5217\uff0c\u7136\u540e\u8fc5\u901f\u67e5\u770b\/dev\/md0\u78c1\u76d8\u9635\u5217\u7684\u72b6\u6001\uff0c\u5c31\u4f1a\u53d1\u73b0\u5907\u4efd\u76d8\u5df2\u7ecf\u88ab\u81ea\u52a8\u9876\u66ff\u4e0a\u53bb\u5e76\u5f00\u59cb\u4e86\u6570\u636e\u540c\u6b65\u3002RAID\u4e2d\u7684\u8fd9\u79cd\u5907\u4efd\u76d8\u6280\u672f\u975e\u5e38\u5b9e\u7528\uff0c\u53ef\u4ee5\u5728\u4fdd\u8bc1RAID\u78c1\u76d8\u9635\u5217\u6570\u636e\u5b89\u5168\u6027\u7684\u57fa\u7840\u4e0a\u8fdb\u4e00\u6b65\u63d0\u9ad8\u6570\u636e\u53ef\u9760\u6027\uff0c\u6240\u4ee5\uff0c\u5982\u679c\u516c\u53f8\u4e0d\u5dee\u94b1\u7684\u8bdd\u8fd8\u662f\u518d\u4e70\u4e0a\u4e00\u5757\u5907\u4efd\u76d8\u4ee5\u9632\u4e07\u4e00\u3002<\/p>\n

[root@linuxprobe ~]# mdadm \/dev\/md0 -f \/dev\/sdb\r\nmdadm: set \/dev\/sdb faulty in \/dev\/md0\r\n[root@linuxprobe ~]# mdadm -D \/dev\/md0\r\n\/dev\/md0:\r\nVersion : 1.2\r\nCreation Time : Fri May 8 09:20:35 2017\r\nRaid Level : raid5\r\nArray Size : 41909248 (39.97 GiB 42.92 GB)\r\nUsed Dev Size : 20954624 (19.98 GiB 21.46 GB)\r\nRaid Devices : 3\r\nTotal Devices : 4\r\nPersistence : Superblock is persistent\r\nUpdate Time : Fri May 8 09:23:51 2017\r\nState : active, degraded, recovering\r\nActive Devices : 2\r\nWorking Devices : 3\r\nFailed Devices : 1\r\nSpare Devices : 1\r\nLayout : left-symmetric\r\nChunk Size : 512K\r\nRebuild Status : 0% complete\r\nName : lrxjmw.cn:0 (local to host lrxjmw.cn)\r\nUUID : 44b1a152:3f1809d3:1d234916:4ac70481\r\nEvents : 21\r\nNumber Major Minor RaidDevice State\r\n3 8 64 0 spare rebuilding \/dev\/sde\r\n1 8 32 1 active sync \/dev\/sdc\r\n4 8 48 2 active sync \/dev\/sdd\r\n0 8 16 - faulty \/dev\/sdb\r\n<\/strong><\/pre>\n

\u51fa\u73b0\u95ee\u9898?\u5927\u80c6\u63d0\u95ee!<\/strong><\/span><\/p>\n

\u56e0\u8bfb\u8005\u4eec\u786c\u4ef6\u4e0d\u540c\u6216\u64cd\u4f5c\u9519\u8bef\u90fd\u53ef\u80fd\u5bfc\u81f4\u5b9e\u9a8c\u914d\u7f6e\u51fa\u9519\uff0c\u8bf7\u8010\u5fc3\u518d\u4ed4\u7ec6\u770b\u770b\u64cd\u4f5c\u6b65\u9aa4\u5427\uff0c\u4e0d\u8981\u6c14\u9981~<\/p>\n

Linux\u6280\u672f\u4ea4\u6d41\u8bf7\u52a0A\u7fa4\uff1a560843(\u6ee1<\/span><\/strong>)\uff0cB\u7fa4\uff1a340829(\u63a8\u8350<\/span><\/strong>)\uff0cC\u7fa4\uff1a463590\uff08\u63a8\u8350<\/span><\/strong>\uff09\uff0c\u70b9\u6b64\u67e5\u770b\u5168\u56fd\u7fa4<\/a>\u3002<\/p>\n

*\u672c\u7fa4\u7279\u8272\uff1a\u901a\u8fc7\u53e3\u4ee4\u9a8c\u8bc1\u786e\u4fdd\u6bcf\u4e00\u4e2a\u7fa4\u5458\u90fd\u662f\u300aLinux\u5c31\u8be5\u8fd9\u4e48\u5b66\u300b\u7684\u8bfb\u8005\uff0c\u7b54\u7591\u66f4\u6709\u9488\u5bf9\u6027\uff0c\u4e0d\u5b9a\u671f\u514d\u8d39\u9886\u53d6\u5b9a\u5236\u793c\u54c1\u3002<\/p><\/blockquote>\n

\n
7.2 LVM\u903b\u8f91\u5377\u7ba1\u7406\u5668<\/strong><\/span><\/h5>\n

\u524d\u9762\u5b66\u4e60\u7684\u786c\u76d8\u8bbe\u5907\u7ba1\u7406\u6280\u672f\u867d\u7136\u80fd\u591f\u6709\u6548\u5730\u63d0\u9ad8\u786c\u76d8\u8bbe\u5907\u7684\u8bfb\u5199\u901f\u5ea6\u4ee5\u53ca\u6570\u636e\u7684\u5b89\u5168\u6027\uff0c\u4f46\u662f\u5728\u786c\u76d8\u5206\u597d\u533a\u6216\u8005\u90e8\u7f72\u4e3aRAID\u78c1\u76d8\u9635\u5217\u4e4b\u540e\uff0c\u518d\u60f3\u4fee\u6539\u786c\u76d8\u5206\u533a\u5927\u5c0f\u5c31\u4e0d\u5bb9\u6613\u4e86\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u5f53\u7528\u6237\u60f3\u8981\u968f\u7740\u5b9e\u9645\u9700\u6c42\u7684\u53d8\u5316\u8c03\u6574\u786c\u76d8\u5206\u533a\u7684\u5927\u5c0f\u65f6\uff0c\u4f1a\u53d7\u5230\u786c\u76d8\u201c\u7075\u6d3b\u6027\u201d\u7684\u9650\u5236\u3002\u8fd9\u65f6\u5c31\u9700\u8981\u7528\u5230\u53e6\u5916\u4e00\u9879\u975e\u5e38\u666e\u53ca\u7684\u786c\u76d8\u8bbe\u5907\u8d44\u6e90\u7ba1\u7406\u6280\u672f\u4e86\u2014LVM\uff08\u903b\u8f91\u5377\u7ba1\u7406\u5668\uff09\u3002LVM\u53ef\u4ee5\u5141\u8bb8\u7528\u6237\u5bf9\u786c\u76d8\u8d44\u6e90\u8fdb\u884c\u52a8\u6001\u8c03\u6574\u3002<\/p>\n

\u903b\u8f91\u5377\u7ba1\u7406\u5668\u662fLinux\u7cfb\u7edf\u7528\u4e8e\u5bf9\u786c\u76d8\u5206\u533a\u8fdb\u884c\u7ba1\u7406\u7684\u4e00\u79cd\u673a\u5236\uff0c\u7406\u8bba\u6027\u8f83\u5f3a\uff0c\u5176\u521b\u5efa\u521d\u8877\u662f\u4e3a\u4e86\u89e3\u51b3\u786c\u76d8\u8bbe\u5907\u5728\u521b\u5efa\u5206\u533a\u540e\u4e0d\u6613\u4fee\u6539\u5206\u533a\u5927\u5c0f\u7684\u7f3a\u9677\u3002\u5c3d\u7ba1\u5bf9\u4f20\u7edf\u7684\u786c\u76d8\u5206\u533a\u8fdb\u884c\u5f3a\u5236\u6269\u5bb9\u6216\u7f29\u5bb9\u4ece\u7406\u8bba\u4e0a\u6765\u8bb2\u662f\u53ef\u884c\u7684\uff0c\u4f46\u662f\u5374\u53ef\u80fd\u9020\u6210\u6570\u636e\u7684\u4e22\u5931\u3002\u800cLVM\u6280\u672f\u662f\u5728\u786c\u76d8\u5206\u533a\u548c\u6587\u4ef6\u7cfb\u7edf\u4e4b\u95f4\u6dfb\u52a0\u4e86\u4e00\u4e2a\u903b\u8f91\u5c42\uff0c\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e2a\u62bd\u8c61\u7684\u5377\u7ec4\uff0c\u53ef\u4ee5\u628a\u591a\u5757\u786c\u76d8\u8fdb\u884c\u5377\u7ec4\u5408\u5e76\u3002\u8fd9\u6837\u4e00\u6765\uff0c\u7528\u6237\u4e0d\u5fc5\u5173\u5fc3\u7269\u7406\u786c\u76d8\u8bbe\u5907\u7684\u5e95\u5c42\u67b6\u6784\u548c\u5e03\u5c40\uff0c\u5c31\u53ef\u4ee5\u5b9e\u73b0\u5bf9\u786c\u76d8\u5206\u533a\u7684\u52a8\u6001\u8c03\u6574\u3002LVM\u7684\u6280\u672f\u67b6\u6784\u5982\u56fe7-7\u6240\u793a\u3002<\/p>\n

\"\u903b\u8f91\u5377\"<\/p>\n

\u56fe7-7\u00a0 \u903b\u8f91\u5377\u7ba1\u7406\u5668\u7684\u6280\u672f\u7ed3\u6784<\/p>\n

\u4e3a\u4e86\u5e2e\u52a9\u5927\u5bb6\u7406\u89e3\uff0c\u5218\u9044\u8001\u5e08\u6765\u4e3e\u4e00\u4e2a\u5403\u8d27\u7684\u4f8b\u5b50\u3002\u6bd4\u5982\u5c0f\u660e\u5bb6\u91cc\u60f3\u5403\u9992\u5934\u4f46\u662f\u9762\u7c89\u4e0d\u591f\u4e86\uff0c\u4e8e\u662f\u5988\u5988\u4ece\u9694\u58c1\u8001\u738b\u5bb6\u3001\u8001\u674e\u5bb6\u3001\u8001\u5f20\u5bb6\u5206\u522b\u501f\u6765\u4e00\u4e9b\u9762\u7c89\uff0c\u51c6\u5907\u84b8\u9992\u5934\u5403\u3002\u9996\u5148\u9700\u8981\u628a\u8fd9\u4e9b\u9762\u7c89\uff08\u7269\u7406\u5377[PV\uff0cPhysical Volume]\uff09\u63c9\u6210\u4e00\u4e2a\u5927\u9762\u56e2\uff08\u5377\u7ec4[VG\uff0cVolume Group]\uff09\uff0c\u7136\u540e\u518d\u628a\u8fd9\u4e2a\u5927\u9762\u56e2\u5206\u5272\u6210\u4e00\u4e2a\u4e2a\u5c0f\u9992\u5934\uff08\u903b\u8f91\u5377[LV\uff0cLogical Volume]\uff09\uff0c\u800c\u4e14\u6bcf\u4e2a\u5c0f\u9992\u5934\u7684\u91cd\u91cf\u5fc5\u987b\u662f\u6bcf\u52fa\u9762\u7c89\uff08\u57fa\u672c\u5355\u5143[PE\uff0cPhysical Extent]\uff09\u7684\u500d\u6570\u3002<\/p>\n

\u7269\u7406\u5377\u5904\u4e8eLVM\u4e2d\u7684\u6700\u5e95\u5c42\uff0c\u53ef\u4ee5\u5c06\u5176\u7406\u89e3\u4e3a\u7269\u7406\u786c\u76d8\u3001\u786c\u76d8\u5206\u533a\u6216\u8005RAID\u78c1\u76d8\u9635\u5217\uff0c\u8fd9\u90fd\u53ef\u4ee5\u3002\u5377\u7ec4\u5efa\u7acb\u5728\u7269\u7406\u5377\u4e4b\u4e0a\uff0c\u4e00\u4e2a\u5377\u7ec4\u53ef\u4ee5\u5305\u542b\u591a\u4e2a\u7269\u7406\u5377\uff0c\u800c\u4e14\u5728\u5377\u7ec4\u521b\u5efa\u4e4b\u540e\u4e5f\u53ef\u4ee5\u7ee7\u7eed\u5411\u5176\u4e2d\u6dfb\u52a0\u65b0\u7684\u7269\u7406\u5377\u3002\u903b\u8f91\u5377\u662f\u7528\u5377\u7ec4\u4e2d\u7a7a\u95f2\u7684\u8d44\u6e90\u5efa\u7acb\u7684\uff0c\u5e76\u4e14\u903b\u8f91\u5377\u5728\u5efa\u7acb\u540e\u53ef\u4ee5\u52a8\u6001\u5730\u6269\u5c55\u6216\u7f29\u5c0f\u7a7a\u95f4\u3002\u8fd9\u5c31\u662fLVM\u7684\u6838\u5fc3\u7406\u5ff5\u3002<\/p>\n<\/div>\n

\n
7.2.1 \u90e8\u7f72\u903b\u8f91\u5377<\/strong><\/span><\/h6>\n

\u4e00\u822c\u800c\u8a00\uff0c\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u65e0\u6cd5\u7cbe\u786e\u5730\u8bc4\u4f30\u6bcf\u4e2a\u786c\u76d8\u5206\u533a\u5728\u65e5\u540e\u7684\u4f7f\u7528\u60c5\u51b5\uff0c\u56e0\u6b64\u4f1a\u5bfc\u81f4\u539f\u5148\u5206\u914d\u7684\u786c\u76d8\u5206\u533a\u4e0d\u591f\u7528\u3002\u6bd4\u5982\uff0c\u4f34\u968f\u7740\u4e1a\u52a1\u91cf\u7684\u589e\u52a0\uff0c\u7528\u4e8e\u5b58\u653e\u4ea4\u6613\u8bb0\u5f55\u7684\u6570\u636e\u5e93\u76ee\u5f55\u7684\u4f53\u79ef\u4e5f\u968f\u4e4b\u589e\u52a0\uff1b\u56e0\u4e3a\u5206\u6790\u5e76\u8bb0\u5f55\u7528\u6237\u7684\u884c\u4e3a\u4ece\u800c\u5bfc\u81f4\u65e5\u5fd7\u76ee\u5f55\u7684\u4f53\u79ef\u4e0d\u65ad\u53d8\u5927\uff0c\u8fd9\u4e9b\u90fd\u4f1a\u5bfc\u81f4\u539f\u6709\u7684\u786c\u76d8\u5206\u533a\u5728\u4f7f\u7528\u4e0a\u6349\u895f\u89c1\u8098\u3002\u800c\u4e14\uff0c\u8fd8\u5b58\u5728\u5bf9\u8f83\u5927\u7684\u786c\u76d8\u5206\u533a\u8fdb\u884c\u7cbe\u7b80\u7f29\u5bb9\u7684\u60c5\u51b5\u3002<\/p>\n

\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u90e8\u7f72LVM\u6765\u89e3\u51b3\u4e0a\u8ff0\u95ee\u9898\u3002\u90e8\u7f72LVM\u65f6\uff0c\u9700\u8981\u9010\u4e2a\u914d\u7f6e\u7269\u7406\u5377\u3001\u5377\u7ec4\u548c\u903b\u8f91\u5377\u3002\u5e38\u7528\u7684\u90e8\u7f72\u547d\u4ee4\u5982\u88687-2\u6240\u793a\u3002<\/p>\n

\u88687-2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u5e38\u7528\u7684LVM\u90e8\u7f72\u547d\u4ee4<\/p>\n\n\n\n\n\n\n\n\n\n
\u529f\u80fd\/\u547d\u4ee4<\/td>\n\u7269\u7406\u5377\u7ba1\u7406<\/td>\n\u5377\u7ec4\u7ba1\u7406<\/td>\n\u903b\u8f91\u5377\u7ba1\u7406<\/td>\n<\/tr>\n
\u626b\u63cf<\/td>\npvscan<\/td>\nvgscan<\/td>\nlvscan<\/td>\n<\/tr>\n
\u5efa\u7acb<\/td>\npvcreate<\/td>\nvgcreate<\/td>\nlvcreate<\/td>\n<\/tr>\n
\u663e\u793a<\/td>\npvdisplay<\/td>\nvgdisplay<\/td>\nlvdisplay<\/td>\n<\/tr>\n
\u5220\u9664<\/td>\npvremove<\/td>\nvgremove<\/td>\nlvremove<\/td>\n<\/tr>\n
\u6269\u5c55<\/td>\n<\/td>\nvgextend<\/td>\nlvextend<\/td>\n<\/tr>\n
\u7f29\u5c0f<\/td>\n<\/td>\nvgreduce<\/td>\nlvreduce<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

\u4e3a\u4e86\u907f\u514d\u591a\u4e2a\u5b9e\u9a8c\u4e4b\u95f4\u76f8\u4e92\u53d1\u751f\u51b2\u7a81\uff0c\u8bf7\u5927\u5bb6\u81ea\u884c\u5c06\u865a\u62df\u673a\u8fd8\u539f\u5230\u521d\u59cb\u72b6\u6001\uff0c\u5e76\u5728\u865a\u62df\u673a\u4e2d\u6dfb\u52a0\u4e24\u5757\u65b0\u786c\u76d8\u8bbe\u5907\uff0c\u7136\u540e\u5f00\u673a\uff0c\u5982\u56fe7-8\u6240\u793a\u3002<\/p>\n

\u5728\u865a\u62df\u673a\u4e2d\u6dfb\u52a0\u4e24\u5757\u65b0\u786c\u76d8\u8bbe\u5907\u7684\u76ee\u7684\uff0c\u662f\u4e3a\u4e86\u66f4\u597d\u5730\u6f14\u793aLVM\u7406\u5ff5\u4e2d\u7528\u6237\u65e0\u9700\u5173\u5fc3\u5e95\u5c42\u7269\u7406\u786c\u76d8\u8bbe\u5907\u7684\u7279\u6027\u3002\u6211\u4eec\u5148\u5bf9\u8fd9\u4e24\u5757\u65b0\u786c\u76d8\u8fdb\u884c\u521b\u5efa\u7269\u7406\u5377\u7684\u64cd\u4f5c\uff0c\u53ef\u4ee5\u5c06\u8be5\u64cd\u4f5c\u7b80\u5355\u7406\u89e3\u6210\u8ba9\u786c\u76d8\u8bbe\u5907\u652f\u6301LVM\u6280\u672f\uff0c\u6216\u8005\u7406\u89e3\u6210\u662f\u628a\u786c\u76d8\u8bbe\u5907\u52a0\u5165\u5230LVM\u6280\u672f\u53ef\u7528\u7684\u786c\u4ef6\u8d44\u6e90\u6c60\u4e2d\uff0c\u7136\u540e\u5bf9\u8fd9\u4e24\u5757\u786c\u76d8\u8fdb\u884c\u5377\u7ec4\u5408\u5e76\uff0c\u5377\u7ec4\u7684\u540d\u79f0\u53ef\u4ee5\u7531\u7528\u6237\u6765\u81ea\u5b9a\u4e49\u3002\u63a5\u4e0b\u6765\uff0c\u6839\u636e\u9700\u6c42\u628a\u5408\u5e76\u540e\u7684\u5377\u7ec4\u5207\u5272\u51fa\u4e00\u4e2a\u7ea6\u4e3a150MB\u7684\u903b\u8f91\u5377\u8bbe\u5907\uff0c\u6700\u540e\u628a\u8fd9\u4e2a\u903b\u8f91\u5377\u8bbe\u5907\u683c\u5f0f\u5316\u6210EXT4\u6587\u4ef6\u7cfb\u7edf\u540e\u6302\u8f7d\u4f7f\u7528\u3002\u5728\u4e0b\u6587\u4e2d\uff0c\u5218\u9044\u8001\u5e08\u5c06\u5bf9\u6bcf\u4e00\u4e2a\u6b65\u9aa4\u518d\u4f5c\u4e00\u4e9b\u7b80\u5355\u7684\u63cf\u8ff0\u3002<\/p>\n

\u7b2c1\u6b65<\/strong>\uff1a\u8ba9\u65b0\u6dfb\u52a0\u7684\u4e24\u5757\u786c\u76d8\u8bbe\u5907\u652f\u6301LVM\u6280\u672f\u3002<\/p>\n

[root@linuxprobe ~]# pvcreate \/dev\/sdb \/dev\/sdc\r\n Physical volume \"\/dev\/sdb\" successfully created\r\n Physical volume \"\/dev\/sdc\" successfully created\r\n<\/pre>\n

\"\"<\/p>\n

\u56fe7-8\u00a0 \u5728\u865a\u62df\u673a\u4e2d\u6dfb\u52a0\u4e24\u5757\u65b0\u7684\u786c\u76d8\u8bbe\u5907<\/p>\n

\u7b2c2\u6b65<\/strong>\uff1a\u628a\u4e24\u5757\u786c\u76d8\u8bbe\u5907\u52a0\u5165\u5230storage\u5377\u7ec4\u4e2d\uff0c\u7136\u540e\u67e5\u770b\u5377\u7ec4\u7684\u72b6\u6001\u3002<\/p>\n

[root@linuxprobe ~]# vgcreate storage \/dev\/sdb \/dev\/sdc\r\n Volume group \"storage\" successfully created\r\n[root@linuxprobe ~]# vgdisplay\r\n--- Volume group ---\r\n VG Name storage\r\n System ID \r\n Format lvm2\r\n Metadata Areas 2\r\n Metadata Sequence No 1\r\n VG Access read\/write\r\n VG Status resizable\r\n MAX LV 0\r\n Cur LV 0\r\n Open LV 0\r\n Max PV 0\r\n Cur PV 2\r\n Act PV 2\r\n VG Size 39.99 GiB\r\n PE Size 4.00 MiB\r\n Total PE 10238\r\n Alloc PE \/ Size 0 \/ 0 <\/strong> Free PE \/ Size 10238 \/ 39.99 GiB<\/strong>\r\n VG UUID KUeAMF-qMLh-XjQy-ArUo-LCQI-YF0o-pScxm1\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026<\/pre>\n

\u7b2c3\u6b65<\/strong>\uff1a\u5207\u5272\u51fa\u4e00\u4e2a\u7ea6\u4e3a150MB\u7684\u903b\u8f91\u5377\u8bbe\u5907\u3002<\/p>\n

\u8fd9\u91cc\u9700\u8981\u6ce8\u610f\u5207\u5272\u5355\u4f4d\u7684\u95ee\u9898\u3002\u5728\u5bf9\u903b\u8f91\u5377\u8fdb\u884c\u5207\u5272\u65f6\u6709\u4e24\u79cd\u8ba1\u91cf\u5355\u4f4d\u3002\u7b2c\u4e00\u79cd\u662f\u4ee5\u5bb9\u91cf\u4e3a\u5355\u4f4d\uff0c\u6240\u4f7f\u7528\u7684\u53c2\u6570\u4e3a-L\u3002\u4f8b\u5982\uff0c\u4f7f\u7528-L 150M\u751f\u6210\u4e00\u4e2a\u5927\u5c0f\u4e3a150MB\u7684\u903b\u8f91\u5377\u3002\u53e6\u5916\u4e00\u79cd\u662f\u4ee5\u57fa\u672c\u5355\u5143\u7684\u4e2a\u6570\u4e3a\u5355\u4f4d\uff0c\u6240\u4f7f\u7528\u7684\u53c2\u6570\u4e3a-l\u3002\u6bcf\u4e2a\u57fa\u672c\u5355\u5143\u7684\u5927\u5c0f\u9ed8\u8ba4\u4e3a4MB\u3002\u4f8b\u5982\uff0c\u4f7f\u7528-l 37\u53ef\u4ee5\u751f\u6210\u4e00\u4e2a\u5927\u5c0f\u4e3a37\u00d74MB=148MB\u7684\u903b\u8f91\u5377\u3002<\/p>\n

[root@linuxprobe ~]# lvcreate -n vo -l 37 storage\r\n Logical volume \"vo\" created\r\n[root@linuxprobe ~]# lvdisplay \r\n --- Logical volume ---\r\n LV Path \/dev\/storage\/vo\r\n LV Name vo\r\n VG Name storage\r\n LV UUID D09HYI-BHBl-iXGr-X2n4-HEzo-FAQH-HRcM2I\r\n LV Write Access read\/write\r\n LV Creation host, time localhost.localdomain, 2017-02-01 01:22:54 -0500\r\n LV Status available\r\n # open 0\r\n LV Size 148.00 MiB<\/strong>\r\n Current LE 37\r\n Segments 1\r\n Allocation inherit\r\n Read ahead sectors auto\r\n - currently set to 8192\r\n Block device 253:2\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026<\/pre>\n

\u7b2c4\u6b65<\/strong>\uff1a\u628a\u751f\u6210\u597d\u7684\u903b\u8f91\u5377\u8fdb\u884c\u683c\u5f0f\u5316\uff0c\u7136\u540e\u6302\u8f7d\u4f7f\u7528\u3002<\/p>\n

Linux\u7cfb\u7edf\u4f1a\u628aLVM\u4e2d\u7684\u903b\u8f91\u5377\u8bbe\u5907\u5b58\u653e\u5728\/dev\u8bbe\u5907\u76ee\u5f55\u4e2d\uff08\u5b9e\u9645\u4e0a\u662f\u505a\u4e86\u4e00\u4e2a\u7b26\u53f7\u94fe\u63a5\uff09\uff0c\u540c\u65f6\u4f1a\u4ee5\u5377\u7ec4\u7684\u540d\u79f0\u6765\u5efa\u7acb\u4e00\u4e2a\u76ee\u5f55\uff0c\u5176\u4e2d\u4fdd\u5b58\u4e86\u903b\u8f91\u5377\u7684\u8bbe\u5907\u6620\u5c04\u6587\u4ef6\uff08\u5373\/dev\/\u5377\u7ec4\u540d\u79f0\/\u903b\u8f91\u5377\u540d\u79f0\uff09\u3002<\/p>\n

[root@linuxprobe\u00a0~]# mkfs.ext4 \/dev\/storage\/vo \r\nmke2fs 1.42.9 (28-Dec-2013)\r\nFilesystem label=\r\nOS type: Linux\r\nBlock size=1024 (log=0)\r\nFragment size=1024 (log=0)\r\nStride=0 blocks, Stripe width=0 blocks\r\n38000 inodes, 151552 blocks\r\n7577 blocks (5.00%) reserved for the super user\r\nFirst data block=1\r\nMaximum filesystem blocks=33816576\r\n19 block groups\r\n8192 blocks per group, 8192 fragments per group\r\n2000 inodes per group\r\nSuperblock backups stored on blocks: \r\n 8193, 24577, 40961, 57345, 73729\r\nAllocating group tables: done \r\nWriting inode tables: done \r\nCreating journal (4096 blocks): done\r\nWriting superblocks and filesystem accounting information: done \r\n[root@linuxprobe\u00a0~]# mkdir \/linuxprobe\r\n[root@linuxprobe ~]# mount \/dev\/storage\/vo \/linuxprobe\r\n<\/pre>\n

\u7b2c5\u6b65<\/strong>\uff1a\u67e5\u770b\u6302\u8f7d\u72b6\u6001\uff0c\u5e76\u5199\u5165\u5230\u914d\u7f6e\u6587\u4ef6\uff0c\u4f7f\u5176\u6c38\u4e45\u751f\u6548\u3002<\/p>\n

[root@linuxprobe ~]# df -h\r\n Filesystem Size Used Avail Use% Mounted on\r\n \/dev\/mapper\/rhel-root 18G 3.0G 15G 17% \/\r\n devtmpfs 905M 0 905M 0% \/dev\r\n tmpfs 914M 140K 914M 1% \/dev\/shm\r\n tmpfs 914M 8.8M 905M 1% \/run\r\n tmpfs 914M 0 914M 0% \/sys\/fs\/cgroup\r\n \/dev\/sr0 3.5G 3.5G 0 100% \/media\/cdrom\r\n \/dev\/sda1 497M 119M 379M 24% \/boot\r\n \/dev\/mapper\/storage-vo 145M 7.6M 138M 6% \/linuxprobe<\/strong>\r\n [root@linuxprobe ~]# echo \"\/dev\/storage\/vo \/linuxprobe ext4 defaults 0 0\" >> \/etc\/fstab<\/pre>\n
7.2.2 \u6269\u5bb9\u903b\u8f91\u5377<\/span><\/strong><\/h6>\n

\u5728\u524d\u9762\u7684\u5b9e\u9a8c\u4e2d\uff0c\u5377\u7ec4\u662f\u7531\u4e24\u5757\u786c\u76d8\u8bbe\u5907\u5171\u540c\u7ec4\u6210\u7684\u3002\u7528\u6237\u5728\u4f7f\u7528\u5b58\u50a8\u8bbe\u5907\u65f6\u611f\u77e5\u4e0d\u5230\u8bbe\u5907\u5e95\u5c42\u7684\u67b6\u6784\u548c\u5e03\u5c40\uff0c\u66f4\u4e0d\u7528\u5173\u5fc3\u5e95\u5c42\u662f\u7531\u591a\u5c11\u5757\u786c\u76d8\u7ec4\u6210\u7684\uff0c\u53ea\u8981\u5377\u7ec4\u4e2d\u6709\u8db3\u591f\u7684\u8d44\u6e90\uff0c\u5c31\u53ef\u4ee5\u4e00\u76f4\u4e3a\u903b\u8f91\u5377\u6269\u5bb9\u3002\u6269\u5c55\u524d\u8bf7\u4e00\u5b9a\u8981\u8bb0\u5f97\u5378\u8f7d\u8bbe\u5907\u548c\u6302\u8f7d\u70b9\u7684\u5173\u8054\u3002<\/p>\n

[root@linuxprobe ~]# umount \/linuxprobe\r\n<\/pre>\n

\u7b2c1\u6b65<\/strong>\uff1a\u628a\u4e0a\u4e00\u4e2a\u5b9e\u9a8c\u4e2d\u7684\u903b\u8f91\u5377vo\u6269\u5c55\u81f3290MB\u3002<\/p>\n

[root@linuxprobe ~]# lvextend -L 290M \/dev\/storage\/vo\r\n Rounding size to boundary between physical extents: 292.00 MiB\r\n Extending logical volume vo to 292.00 MiB\r\n Logical volume vo successfully resized\r\n<\/pre>\n

\u7b2c2\u6b65<\/strong>\uff1a\u68c0\u67e5\u786c\u76d8\u5b8c\u6574\u6027\uff0c\u5e76\u91cd\u7f6e\u786c\u76d8\u5bb9\u91cf\u3002<\/p>\n

[root@linuxprobe ~]# e2fsck -f \/dev\/storage\/vo\r\ne2fsck 1.42.9 (28-Dec-2013)\r\nPass 1: Checking inodes, blocks, and sizes\r\nPass 2: Checking directory structure\r\nPass 3: Checking directory connectivity\r\nPass 4: Checking reference counts\r\nPass 5: Checking group summary information\r\n\/dev\/storage\/vo: 11\/38000 files (0.0% non-contiguous), 10453\/151552 blocks\r\n[root@linuxprobe ~]# resize2fs \/dev\/storage\/vo\r\nresize2fs 1.42.9 (28-Dec-2013)\r\nResizing the filesystem on \/dev\/storage\/vo to 299008 (1k) blocks.\r\nThe filesystem on \/dev\/storage\/vo is now 299008 blocks long.\r\n<\/pre>\n

\u7b2c3\u6b65<\/strong>\uff1a\u91cd\u65b0\u6302\u8f7d\u786c\u76d8\u8bbe\u5907\u5e76\u67e5\u770b\u6302\u8f7d\u72b6\u6001\u3002<\/p>\n

[root@linuxprobe ~]# mount -a\r\n[root@linuxprobe ~]# df -h\r\nFilesystem Size Used Avail Use% Mounted on\r\n\/dev\/mapper\/rhel-root 18G 3.0G 15G 17% \/\r\ndevtmpfs 985M 0 985M 0% \/dev\r\ntmpfs 994M 80K 994M 1% \/dev\/shm\r\ntmpfs 994M 8.8M 986M 1% \/run\r\ntmpfs 994M 0 994M 0% \/sys\/fs\/cgroup\r\n\/dev\/sr0 3.5G 3.5G 0 100% \/media\/cdrom\r\n\/dev\/sda1 497M 119M 379M 24% \/boot\r\n\/dev\/mapper\/storage-vo 279M 2.1M 259M 1% \/linuxprobe<\/strong><\/pre>\n
7.2.3 \u7f29\u5c0f\u903b\u8f91\u5377<\/span><\/strong><\/h6>\n

\u76f8\u8f83\u4e8e\u6269\u5bb9\u903b\u8f91\u5377\uff0c\u5728\u5bf9\u903b\u8f91\u5377\u8fdb\u884c\u7f29\u5bb9\u64cd\u4f5c\u65f6\uff0c\u5176\u4e22\u5931\u6570\u636e\u7684\u98ce\u9669\u66f4\u5927\u3002\u6240\u4ee5\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u6267\u884c\u76f8\u5e94\u64cd\u4f5c\u65f6\uff0c\u4e00\u5b9a\u8981\u63d0\u524d\u5907\u4efd\u597d\u6570\u636e\u3002\u53e6\u5916Linux\u7cfb\u7edf\u89c4\u5b9a\uff0c\u5728\u5bf9LVM\u903b\u8f91\u5377\u8fdb\u884c\u7f29\u5bb9\u64cd\u4f5c\u4e4b\u524d\uff0c\u8981\u5148\u68c0\u67e5\u6587\u4ef6\u7cfb\u7edf\u7684\u5b8c\u6574\u6027\uff08\u5f53\u7136\u8fd9\u4e5f\u662f\u4e3a\u4e86\u4fdd\u8bc1\u6211\u4eec\u7684\u6570\u636e\u5b89\u5168\uff09\u3002\u5728\u6267\u884c\u7f29\u5bb9\u64cd\u4f5c\u524d\u8bb0\u5f97\u5148\u628a\u6587\u4ef6\u7cfb\u7edf\u5378\u8f7d\u6389\u3002<\/p>\n

[root@linuxprobe ~]# umount \/linuxprobe\r\n<\/pre>\n

\u7b2c1\u6b65<\/strong>\uff1a\u68c0\u67e5\u6587\u4ef6\u7cfb\u7edf\u7684\u5b8c\u6574\u6027\u3002<\/p>\n

[root@linuxprobe ~]# e2fsck -f \/dev\/storage\/vo\r\ne2fsck 1.42.9 (28-Dec-2013)\r\nPass 1: Checking inodes, blocks, and sizes\r\nPass 2: Checking directory structure\r\nPass 3: Checking directory connectivity\r\nPass 4: Checking reference counts\r\nPass 5: Checking group summary information\r\n\/dev\/storage\/vo: 11\/74000 files (0.0% non-contiguous), 15507\/299008 blocks\r\n<\/pre>\n

\u7b2c2\u6b65<\/strong>\uff1a\u628a\u903b\u8f91\u5377vo\u7684\u5bb9\u91cf\u51cf\u5c0f\u5230120MB\u3002<\/p>\n

[root@linuxprobe ~]# resize2fs \/dev\/storage\/vo 120M\r\nresize2fs 1.42.9 (28-Dec-2013)\r\nResizing the filesystem on \/dev\/storage\/vo to 122880 (1k) blocks.\r\nThe filesystem on \/dev\/storage\/vo is now 122880 blocks long.\r\n[root@linuxprobe ~]# lvreduce -L 120M \/dev\/storage\/vo\r\n WARNING: Reducing active logical volume to 120.00 MiB\r\n THIS MAY DESTROY YOUR DATA (filesystem etc.)\r\nDo you really want to reduce vo? [y\/n]: y\r\n Reducing logical volume vo to 120.00 MiB\r\n Logical volume vo successfully resized\r\n<\/pre>\n

\u7b2c3\u6b65<\/strong>\uff1a\u91cd\u65b0\u6302\u8f7d\u6587\u4ef6\u7cfb\u7edf\u5e76\u67e5\u770b\u7cfb\u7edf\u72b6\u6001\u3002<\/p>\n

[root@linuxprobe ~]# mount -a\r\n[root@linuxprobe ~]# df -h\r\nFilesystem Size Used Avail Use% Mounted on\r\n\/dev\/mapper\/rhel-root 18G 3.0G 15G 17% \/\r\ndevtmpfs 985M 0 985M 0% \/dev\r\ntmpfs 994M 80K 994M 1% \/dev\/shm\r\ntmpfs 994M 8.8M 986M 1% \/run\r\ntmpfs 994M 0 994M 0% \/sys\/fs\/cgroup\r\n\/dev\/sr0 3.5G 3.5G 0 100% \/media\/cdrom\r\n\/dev\/sda1 497M 119M 379M 24% \/boot\r\n\/dev\/mapper\/storage-vo 113M 1.6M 103M 2% \/linuxprobe<\/pre>\n
\n
7.2.4 \u903b\u8f91\u5377\u5feb\u7167<\/strong><\/span><\/h6>\n

LVM\u8fd8\u5177\u5907\u6709\u201c\u5feb\u7167\u5377\u201d\u529f\u80fd\uff0c\u8be5\u529f\u80fd\u7c7b\u4f3c\u4e8e\u865a\u62df\u673a\u8f6f\u4ef6\u7684\u8fd8\u539f\u65f6\u95f4\u70b9\u529f\u80fd\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u5bf9\u67d0\u4e00\u4e2a\u903b\u8f91\u5377\u8bbe\u5907\u505a\u4e00\u6b21\u5feb\u7167\uff0c\u5982\u679c\u65e5\u540e\u53d1\u73b0\u6570\u636e\u88ab\u6539\u9519\u4e86\uff0c\u5c31\u53ef\u4ee5\u5229\u7528\u4e4b\u524d\u505a\u597d\u7684\u5feb\u7167\u5377\u8fdb\u884c\u8986\u76d6\u8fd8\u539f\u3002LVM\u7684\u5feb\u7167\u5377\u529f\u80fd\u6709\u4e24\u4e2a\u7279\u70b9\uff1a<\/p>\n

\u5feb\u7167\u5377\u7684\u5bb9\u91cf\u5fc5\u987b\u7b49\u540c\u4e8e\u903b\u8f91\u5377\u7684\u5bb9\u91cf\uff1b<\/p>\n

\u5feb\u7167\u5377\u4ec5\u4e00\u6b21\u6709\u6548\uff0c\u4e00\u65e6\u6267\u884c\u8fd8\u539f\u64cd\u4f5c\u540e\u5219\u4f1a\u88ab\u7acb\u5373\u81ea\u52a8\u5220\u9664\u3002<\/p><\/blockquote>\n

\u9996\u5148\u67e5\u770b\u5377\u7ec4\u7684\u4fe1\u606f\u3002<\/p>\n

[root@linuxprobe ~]# vgdisplay\r\n --- Volume group ---\r\n VG Name storage\r\n System ID \r\n Format lvm2\r\n Metadata Areas 2\r\n Metadata Sequence No 4\r\n VG Access read\/write\r\n VG Status resizable\r\n MAX LV 0\r\n Cur LV 1\r\n Open LV 1\r\n Max PV 0\r\n Cur PV 2\r\n Act PV 2\r\n VG Size 39.99 GiB\r\n PE Size 4.00 MiB\r\n Total PE 10238\r\n Alloc PE \/ Size 30 \/ 120.00 MiB<\/strong> Free PE \/ Size 10208 \/ 39.88 GiB<\/strong>\r\n VG UUID CTaHAK-0TQv-Abdb-R83O-RU6V-YYkx-8o2R0e\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026<\/pre>\n

\u901a\u8fc7\u5377\u7ec4\u7684\u8f93\u51fa\u4fe1\u606f\u53ef\u4ee5\u6e05\u6670\u770b\u5230\uff0c\u5377\u7ec4\u4e2d\u5df2\u7ecf\u4f7f\u7528\u4e86120MB\u7684\u5bb9\u91cf\uff0c\u7a7a\u95f2\u5bb9\u91cf\u8fd8\u670939.88GB\u3002\u63a5\u4e0b\u6765\u7528\u91cd\u5b9a\u5411\u5f80\u903b\u8f91\u5377\u8bbe\u5907\u6240\u6302\u8f7d\u7684\u76ee\u5f55\u4e2d\u5199\u5165\u4e00\u4e2a\u6587\u4ef6\u3002<\/p>\n

[root@linuxprobe ~]# echo \"Welcome to lrxjmw.cn\" > \/linuxprobe\/readme.txt\r\n[root@linuxprobe ~]# ls -l \/linuxprobe\r\ntotal 14\r\ndrwx------. 2 root root 12288 Feb 1 07:18 lost+found\r\n-rw-r--r--. 1 root root 26 Feb 1 07:38 readme.txt\r\n<\/pre>\n

\u7b2c1\u6b65<\/strong>\uff1a\u4f7f\u7528-s\u53c2\u6570\u751f\u6210\u4e00\u4e2a\u5feb\u7167\u5377\uff0c\u4f7f\u7528-L\u53c2\u6570\u6307\u5b9a\u5207\u5272\u7684\u5927\u5c0f\u3002\u53e6\u5916\uff0c\u8fd8\u9700\u8981\u5728\u547d\u4ee4\u540e\u9762\u5199\u4e0a\u662f\u9488\u5bf9\u54ea\u4e2a\u903b\u8f91\u5377\u6267\u884c\u7684\u5feb\u7167\u64cd\u4f5c\u3002<\/p>\n

[root@linuxprobe ~]#  lvcreate -L 120M -s -n SNAP \/dev\/storage\/vo\r\n Logical volume \"SNAP\" created\r\n[root@linuxprobe ~]# lvdisplay\r\n--- Logical volume ---\r\n LV Path \/dev\/storage\/SNAP<\/strong>\r\n LV Name SNAP\r\n VG Name storage<\/strong>\r\n LV UUID BC7WKg-fHoK-Pc7J-yhSd-vD7d-lUnl-TihKlt\r\n LV Write Access read\/write\r\n LV Creation host, time localhost.localdomain, 2017-02-01 07:42:31 -0500\r\n LV snapshot status active destination for vo<\/strong>\r\n LV Status available\r\n # open 0\r\n LV Size 120.00 MiB\r\n Current LE 30\r\n COW-table size 120.00 MiB\r\n COW-table LE 30\r\n Allocated to snapshot 0.01%<\/strong>\r\n Snapshot chunk size 4.00 KiB\r\n Segments 1\r\n Allocation inherit\r\n Read ahead sectors auto\r\n - currently set to 8192\r\n Block device 253:3\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026<\/pre>\n

\u7b2c2\u6b65<\/strong>\uff1a\u5728\u903b\u8f91\u5377\u6240\u6302\u8f7d\u7684\u76ee\u5f55\u4e2d\u521b\u5efa\u4e00\u4e2a100MB\u7684\u5783\u573e\u6587\u4ef6\uff0c\u7136\u540e\u518d\u67e5\u770b\u5feb\u7167\u5377\u7684\u72b6\u6001\u3002\u53ef\u4ee5\u53d1\u73b0\u5b58\u50a8\u7a7a\u95f4\u5360\u7684\u7528\u91cf\u4e0a\u5347\u4e86\u3002<\/p>\n

[root@linuxprobe ~]# dd if=\/dev\/zero of=\/linuxprobe\/files count=1 bs=100M\r\n1+0 records in\r\n1+0 records out\r\n104857600 bytes (105 MB) copied, 3.35432 s, 31.3 MB\/s\r\n[root@linuxprobe ~]# lvdisplay\r\n --- Logical volume ---\r\n LV Path \/dev\/storage\/SNAP\r\n LV Name SNAP\r\n VG Name storage\r\n LV UUID BC7WKg-fHoK-Pc7J-yhSd-vD7d-lUnl-TihKlt\r\n LV Write Access read\/write\r\n LV Creation host, time localhost.localdomain, 2017-02-01 07:42:31 -0500\r\n LV snapshot status active destination for vo\r\n LV Status available\r\n # open 0\r\n LV Size 120.00 MiB\r\n Current LE 30\r\n COW-table size 120.00 MiB\r\n COW-table LE 30\r\n Allocated to snapshot 83.71%<\/strong>\r\n Snapshot chunk size 4.00 KiB\r\n Segments 1\r\n Allocation inherit\r\n Read ahead sectors auto\r\n - currently set to 8192\r\n Block device 253:3<\/pre>\n

\u7b2c3\u6b65<\/strong>\uff1a\u4e3a\u4e86\u6821\u9a8cSNAP\u5feb\u7167\u5377\u7684\u6548\u679c\uff0c\u9700\u8981\u5bf9\u903b\u8f91\u5377\u8fdb\u884c\u5feb\u7167\u8fd8\u539f\u64cd\u4f5c\u3002\u5728\u6b64\u4e4b\u524d\u8bb0\u5f97\u5148\u5378\u8f7d\u6389\u903b\u8f91\u5377\u8bbe\u5907\u4e0e\u76ee\u5f55\u7684\u6302\u8f7d\u3002<\/p>\n

[root@linuxprobe ~]# umount \/linuxprobe\r\n[root@linuxprobe ~]# lvconvert --merge \/dev\/storage\/SNAP\r\n Merging of volume SNAP started.\r\n vo: Merged: 21.4%\r\n vo: Merged: 100.0%\r\n Merge of snapshot into logical volume vo has finished.\r\n Logical volume \"SNAP\" successfully removed\r\n<\/pre>\n

\u7b2c4\u6b65<\/strong>\uff1a\u5feb\u7167\u5377\u4f1a\u88ab\u81ea\u52a8\u5220\u9664\u6389\uff0c\u5e76\u4e14\u521a\u521a\u5728\u903b\u8f91\u5377\u8bbe\u5907\u88ab\u6267\u884c\u5feb\u7167\u64cd\u4f5c\u540e\u518d\u521b\u5efa\u51fa\u6765\u7684100MB\u7684\u5783\u573e\u6587\u4ef6\u4e5f\u88ab\u6e05\u9664\u4e86\u3002<\/p>\n

[root@linuxprobe ~]# mount -a\r\n[root@linuxprobe ~]# ls \/linuxprobe\/\r\nlost+found readme.txt<\/pre>\n
7.2.5 \u5220\u9664\u903b\u8f91\u5377<\/strong><\/span><\/h6>\n

\u5f53\u751f\u4ea7\u73af\u5883\u4e2d\u60f3\u8981\u91cd\u65b0\u90e8\u7f72LVM\u6216\u8005\u4e0d\u518d\u9700\u8981\u4f7f\u7528LVM\u65f6\uff0c\u5219\u9700\u8981\u6267\u884cLVM\u7684\u5220\u9664\u64cd\u4f5c\u3002\u4e3a\u6b64\uff0c\u9700\u8981\u63d0\u524d\u5907\u4efd\u597d\u91cd\u8981\u7684\u6570\u636e\u4fe1\u606f\uff0c\u7136\u540e\u4f9d\u6b21\u5220\u9664\u903b\u8f91\u5377\u3001\u5377\u7ec4\u3001\u7269\u7406\u5377\u8bbe\u5907\uff0c\u8fd9\u4e2a\u987a\u5e8f\u4e0d\u53ef\u98a0\u5012\u3002<\/p>\n

\u7b2c1\u6b65<\/strong>\uff1a\u53d6\u6d88\u903b\u8f91\u5377\u4e0e\u76ee\u5f55\u7684\u6302\u8f7d\u5173\u8054\uff0c\u5220\u9664\u914d\u7f6e\u6587\u4ef6\u4e2d\u6c38\u4e45\u751f\u6548\u7684\u8bbe\u5907\u53c2\u6570\u3002<\/p>\n

[root@linuxprobe ~]# umount \/linuxprobe\r\n[root@linuxprobe ~]# vim \/etc\/fstab\r\n#\r\n# \/etc\/fstab\r\n# Created by anaconda on Fri Feb 19 22:08:59 2017\r\n#\r\n# Accessible filesystems, by reference, are maintained under '\/dev\/disk'\r\n# See man pages fstab(5), findfs(8), mount(8) and\/or blkid(8) for more info\r\n#\r\n\/dev\/mapper\/rhel-root \/ xfs defaults 1 1\r\nUUID=50591e35-d47a-4aeb-a0ca-1b4e8336d9b1 \/boot xfs defaults 1 2\r\n\/dev\/mapper\/rhel-swap swap swap defaults 0 0\r\n\/dev\/cdrom \/media\/cdrom iso9660 defaults 0 0 \r\n\/dev\/storage\/vo \/linuxprobe ext4 defaults 0 0<\/del><\/pre>\n

\u7b2c2\u6b65<\/strong>\uff1a\u5220\u9664\u903b\u8f91\u5377\u8bbe\u5907\uff0c\u9700\u8981\u8f93\u5165y\u6765\u786e\u8ba4\u64cd\u4f5c\u3002<\/p>\n

[root@linuxprobe ~]# lvremove \/dev\/storage\/vo \r\nDo you really want to remove active logical volume vo? [y\/n]: y<\/strong>\r\n Logical volume \"vo\" successfully removed\r\n<\/pre>\n

\u7b2c3\u6b65<\/strong>\uff1a\u5220\u9664\u5377\u7ec4\uff0c\u6b64\u5904\u53ea\u5199\u5377\u7ec4\u540d\u79f0\u5373\u53ef\uff0c\u4e0d\u9700\u8981\u8bbe\u5907\u7684\u7edd\u5bf9\u8def\u5f84\u3002<\/p>\n

[root@linuxprobe ~]# vgremove storage\r\n Volume group \"storage\" successfully removed<\/pre>\n<\/div>\n

\u7b2c4\u6b65<\/strong>\uff1a\u5220\u9664\u7269\u7406\u5377\u8bbe\u5907\u3002<\/p>\n

[root@linuxprobe ~]# pvremove \/dev\/sdb \/dev\/sdc\r\n Labels on physical volume \"\/dev\/sdb\" successfully wiped\r\n Labels on physical volume \"\/dev\/sdc\" successfully wiped<\/pre>\n

\u5728\u4e0a\u8ff0\u64cd\u4f5c\u6267\u884c\u5b8c\u6bd5\u4e4b\u540e\uff0c\u518d\u6267\u884clvdisplay\u3001vgdisplay\u3001pvdisplay\u547d\u4ee4\u6765\u67e5\u770bLVM\u7684\u4fe1\u606f\u65f6\u5c31\u4e0d\u4f1a\u518d\u770b\u5230\u4fe1\u606f\u4e86\uff08\u524d\u63d0\u662f\u4e0a\u8ff0\u6b65\u9aa4\u7684\u64cd\u4f5c\u662f\u6b63\u786e\u7684\uff09\u3002<\/p>\n

\u672c\u7ae0\u8282\u7684\u590d\u4e60\u4f5c\u4e1a(\u7b54\u6848\u5c31\u5728\u95ee\u9898\u7684\u4e0b\u4e00\u884c\u54e6\uff0c\u7528\u9f20\u6807\u9009\u4e2d\u5373\u53ef\u770b\u5230\u7684~)<\/span><\/span><\/strong><\/p>\n

1\uff0e\u00a0RAID\u6280\u672f\u4e3b\u8981\u662f\u4e3a\u4e86\u89e3\u51b3\u4ec0\u4e48\u95ee\u9898\u5462\uff1f<\/p>\n

\u7b54\uff1a<\/strong>RAID\u6280\u672f\u53ef\u4ee5\u89e3\u51b3\u5b58\u50a8\u8bbe\u5907\u7684\u8bfb\u5199\u901f\u5ea6\u95ee\u9898\u53ca\u6570\u636e\u7684\u5197\u4f59\u5907\u4efd\u95ee\u9898\u3002<\/span><\/p>\n

2\uff0e\u00a0RAID 0\u548cRAID 5\u54ea\u4e2a\u66f4\u5b89\u5168\uff1f<\/p>\n

\u7b54\uff1a<\/strong>RAID 0\u6ca1\u6709\u6570\u636e\u5197\u4f59\u529f\u80fd\uff0c\u56e0\u6b64RAID 5\u66f4\u5b89\u5168\u3002<\/span><\/p>\n

3\uff0e\u5047\u8bbe\u4f7f\u75284\u5757\u786c\u76d8\u6765\u90e8\u7f72RAID 10\u65b9\u6848\uff0c\u5916\u52a0\u4e00\u5757\u5907\u4efd\u76d8\uff0c\u6700\u591a\u53ef\u4ee5\u5141\u8bb8\u51e0\u5757\u786c\u76d8\u540c\u65f6\u635f\u574f\u5462\uff1f<\/p>\n

\u7b54\uff1a<\/strong>\u6700\u591a\u5141\u8bb85\u5757\u786c\u76d8\u8bbe\u5907\u4e2d\u76843\u5757\u8bbe\u5907\u540c\u65f6\u635f\u574f\u3002<\/span><\/p>\n

4\uff0e\u4f4d\u4e8eLVM\u6700\u5e95\u5c42\u7684\u662f\u7269\u7406\u5377\u8fd8\u662f\u5377\u7ec4\uff1f<\/p>\n

\u7b54\uff1a<\/strong>\u6700\u5e95\u5c42\u7684\u662f\u7269\u7406\u5377\uff0c\u7136\u540e\u5728\u901a\u8fc7\u7269\u7406\u5377\u7ec4\u6210\u5377\u7ec4\u3002<\/span><\/p>\n

5\uff0e\u00a0LVM\u5bf9\u903b\u8f91\u5377\u7684\u6269\u5bb9\u548c\u7f29\u5bb9\u64cd\u4f5c\u6709\u4f55\u5f02\u540c\u70b9\u5462\uff1f<\/p>\n

\u7b54\uff1a<\/strong>\u6269\u5bb9\u548c\u7f29\u5bb9\u64cd\u4f5c\u90fd\u9700\u8981\u5148\u53d6\u6d88\u903b\u8f91\u5377\u4e0e\u76ee\u5f55\u7684\u6302\u8f7d\u5173\u8054\uff1b\u6269\u5bb9\u64cd\u4f5c\u662f\u5148\u6269\u5bb9\u540e\u68c0\u67e5\u6587\u4ef6\u7cfb\u7edf\u5b8c\u6574\u6027\uff0c\u800c\u7f29\u5bb9\u64cd\u4f5c\u4e3a\u4e86\u4fdd\u8bc1\u6570\u636e\u7684\u5b89\u5168\uff0c\u9700\u8981\u5148\u68c0\u67e5\u6587\u4ef6\u7cfb\u7edf\u5b8c\u6574\u6027\u518d\u7f29\u5bb9\u3002<\/span><\/p>\n

6\uff0e\u00a0LVM\u7684\u5feb\u7167\u5377\u80fd\u4f7f\u7528\u51e0\u6b21\uff1f<\/p>\n

\u7b54\uff1a<\/strong>\u53ea\u53ef\u4f7f\u7528\u4e00\u6b21\uff0c\u800c\u4e14\u4f7f\u7528\u540e\u5373\u81ea\u52a8\u5220\u9664\u3002<\/span><\/p>\n

7\uff0e\u00a0LVM\u7684\u5220\u9664\u987a\u5e8f\u662f\u600e\u4e48\u6837\u7684\uff1f<\/p>\n

\u7b54\uff1a<\/strong>\u4f9d\u6b21\u79fb\u9664\u903b\u8f91\u5377\u3001\u5377\u7ec4\u548c\u7269\u7406\u5377\u3002<\/span><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"

👇\u672c\u7ae0\u8282\u5185\u5bb9\u5df2\u66f4\u65b0\uff0c\u8bf7\u5728\u7ebf\u9605\u8bfb\u6700\u65b0RHEL 8\u7248\u672c\u4e66\u7c4d 👇 https:\/\/w […]<\/p>\n","protected":false},"author":1,"featured_media":17172,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[558],"tags":[],"class_list":["post-17152","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-rhel7"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/17152","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=17152"}],"version-history":[{"count":83,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/17152\/revisions"}],"predecessor-version":[{"id":218015,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/17152\/revisions\/218015"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/17172"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=17152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=17152"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=17152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}