{"id":181463,"date":"2020-05-06T00:43:01","date_gmt":"2020-05-05T16:43:01","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=181463"},"modified":"2022-10-28T00:24:38","modified_gmt":"2022-10-27T16:24:38","slug":"basic-learning-07","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/basic-learning-07.html","title":{"rendered":"\u7b2c7\u7ae0 \u4f7f\u7528RAID\u4e0eLVM\u78c1\u76d8\u9635\u5217\u6280\u672f"},"content":{"rendered":"

\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\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\u3002<\/p>\n

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

\u8fd1\u5e74\u6765\uff0cCPU\u7684\u5904\u7406\u6027\u80fd\u4fdd\u6301\u7740\u9ad8\u901f\u589e\u957f\u30022017\u5e74\uff0cIntel\u516c\u53f8\u53d1\u5e03\u4e86i9-7980XE\u5904\u7406\u5668\u82af\u7247\uff0c\u7387\u5148\u8ba9\u5bb6\u7528\u7535\u8111\u8fbe\u5230\u4e8618\u6838\u5fc336\u7ebf\u7a0b\u30022020\u5e74\u672b\uff0cAMD\u516c\u53f8\u53c8\u63a8\u51fa\u4e86\u201c\u7ebf\u7a0b\u6495\u88c2\u8005\u201d\u7cfb\u7edf\u5904\u7406\u56683990X\uff0c\u5bb6\u7528\u7535\u8111\u81ea\u6b64\u4e5f\u53ef\u4ee5\u8f7b\u677e\u9a7e\u9a6d64\u6838\u5fc3128\u7ebf\u7a0b\u7684\u5904\u7406\u5668\u5c0f\u602a\u517d\u4e86\u3002\u4f46\u4e0e\u6b64\u540c\u65f6\uff0c\u786c\u76d8\u8bbe\u5907\u7684\u6027\u80fd\u63d0\u5347\u5374\u4e0d\u662f\u5f88\u5927\uff0c\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

\u786c\u76d8\u8bbe\u5907\u662f\u8ba1\u7b97\u673a\u4e2d\u8f83\u5bb9\u6613\u51fa\u73b0\u6545\u969c\u7684\u5143\u5668\u4ef6\u4e4b\u4e00\uff0c\u52a0\u4e4b\u7531\u4e8e\u5176\u9700\u8981\u5b58\u50a8\u6570\u636e\u7684\u7279\u6b8a\u6027\u8d28\uff0c\u4e0d\u80fd\u50cfCPU\u3001\u5185\u5b58\u3001\u7535\u6e90\u751a\u81f3\u4e3b\u677f\u90a3\u6837\u5728\u51fa\u73b0\u6545\u969c\u540e\u66f4\u6362\u65b0\u7684\u5c31\u597d\uff0c\u6240\u4ee5\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u4e00\u5b9a\u8981\u672a\u96e8\u7ef8\u7f2a\uff0c\u63d0\u524d\u505a\u597d\u6570\u636e\u7684\u5197\u4f59\u53ca\u5f02\u5730\u5907\u4efd\u7b49\u5de5\u4f5c\u3002<\/p>\n

1988\u5e74\uff0c\u7f8e\u56fd\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\u628a\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\u5230\u4e86\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\u505a\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\u8fd94\u79cd\u65b9\u6848\u7684\u5bf9\u6bd4\u5982\u88687-1\u6240\u793a\uff0c\u5176\u4e2dn<\/em>\u4ee3\u8868\u786c\u76d8\u603b\u6570\u3002<\/p>\n

\u88687-3\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 RAID 0\u30011\u30015\u300110\u65b9\u6848\u6280\u672f\u5bf9\u6bd4<\/p>\n\n\n\n\n\n\n\n
RAID\u7ea7\u522b<\/td>\n\u6700\u5c11\u786c\u76d8<\/td>\n\u53ef\u7528\u5bb9\u91cf<\/td>\n\u8bfb\u5199\u6027\u80fd<\/td>\n\u5b89\u5168\u6027<\/td>\n\u7279\u70b9<\/td>\n<\/tr>\n
0<\/td>\n2<\/td>\nn<\/td>\nn<\/td>\n\u4f4e<\/td>\n\u8ffd\u6c42\u6700\u5927\u5bb9\u91cf\u548c\u901f\u5ea6\uff0c\u4efb\u4f55\u4e00\u5757\u76d8\u635f\u574f\uff0c\u6570\u636e\u5168\u90e8\u5f02\u5e38\u3002<\/td>\n<\/tr>\n
1<\/td>\n2<\/td>\nn\/2<\/td>\nn<\/td>\n\u9ad8<\/td>\n\u8ffd\u6c42\u6700\u5927\u5b89\u5168\u6027\uff0c\u53ea\u8981\u9635\u5217\u7ec4\u4e2d\u6709\u4e00\u5757\u786c\u76d8\u53ef\u7528\uff0c\u6570\u636e\u4e0d\u53d7\u5f71\u54cd\u3002<\/td>\n<\/tr>\n
5<\/td>\n3<\/td>\nn-1<\/td>\nn-1<\/td>\n\u4e2d<\/td>\n\u5728\u63a7\u5236\u6210\u672c\u7684\u524d\u63d0\u4e0b\uff0c\u8ffd\u6c42\u786c\u76d8\u7684\u6700\u5927\u5bb9\u91cf\u3001\u901f\u5ea6\u53ca\u5b89\u5168\u6027\uff0c\u5141\u8bb8\u6709\u4e00\u5757\u786c\u76d8\u5f02\u5e38\uff0c\u6570\u636e\u4e0d\u53d7\u5f71\u54cd\u3002<\/td>\n<\/tr>\n
10<\/td>\n4<\/td>\nn\/2<\/td>\nn\/2<\/td>\n\u9ad8<\/td>\n\u7efc\u5408RAID1\u548cRAID0\u7684\u4f18\u70b9\uff0c\u8ffd\u6c42\u786c\u76d8\u7684\u901f\u5ea6\u548c\u5b89\u5168\u6027\uff0c\u5141\u8bb8\u6709\u4e00\u534a\u786c\u76d8\u5f02\u5e38\uff08\u4e0d\u53ef\u540c\u7ec4\uff09\uff0c\u6570\u636e\u4e0d\u53d7\u5f71\u54cd<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/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\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\uff0c\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\u5373\u786c\u76d8A\u548c\u786c\u76d8B\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

\"\"<\/p>\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\u5b83\u662f\u5c06\u6570\u636e\u4f9d\u6b21\u5199\u5165\u5230\u5404\u4e2a\u7269\u7406\u786c\u76d8\u4e2d\u3002\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

\"\"<\/p>\n

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

\u8003\u8651\u5230\u5728\u8fdb\u884c\u5199\u5165\u64cd\u4f5c\u65f6\u56e0\u786c\u76d8\u5207\u6362\u5e26\u6765\u7684\u5f00\u9500\uff0c\u56e0\u6b64RAID 1\u7684\u901f\u5ea6\u4f1a\u6bd4RAID 0\u6709\u5fae\u5f31\u5730\u964d\u4f4e\u3002\u4f46\u5728\u8bfb\u53d6\u6570\u636e\u7684\u65f6\u5019\uff0c\u64cd\u4f5c\u7cfb\u7edf\u53ef\u4ee5\u5206\u522b\u4ece\u4e24\u5757\u786c\u76d8\u4e2d\u8bfb\u53d6\u4fe1\u606f\uff0c\u56e0\u6b64\u7406\u8bba\u8bfb\u53d6\u901f\u5ea6\u7684\u5cf0\u503c\u53ef\u4ee5\u662f\u786c\u76d8\u6570\u91cf\u7684\u500d\u6570\u3002\u53e6\u5916\uff0c\u5e73\u65f6\u53ea\u8981\u4fdd\u8bc1\u6709\u4e00\u5757\u786c\u76d8\u7a33\u5b9a\u8fd0\u884c\uff0c\u6570\u636e\u5c31\u4e0d\u4f1a\u51fa\u73b0\u635f\u574f\u7684\u60c5\u51b5\uff0c\u53ef\u9760\u6027\u8f83\u9ad8\u3002<\/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\u3002\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\u75313\u5757\u786c\u76d8\u8bbe\u5907\u7ec4\u6210\u7684RAID 1\u78c1\u76d8\u9635\u5217\u7684\u53ef\u7528\u7387\u53ea\u670933%\u5de6\u53f3\uff1b\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\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\u3002\u8fd9\u6837\u7684\u597d\u5904\u662f\uff0c\u5176\u4e2d\u4efb\u4f55\u4e00\u8bbe\u5907\u635f\u574f\u540e\u4e0d\u81f3\u4e8e\u51fa\u73b0\u81f4\u547d\u7f3a\u9677\u3002\u56fe7-3\u4e2dParity\u90e8\u5206\u5b58\u653e\u7684\u5c31\u662f\u6570\u636e\u7684\u5947\u5076\u6821\u9a8c\u4fe1\u606f\u3002\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

\"\"<\/p>\n

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

RAID 5\u6700\u5c11\u75313\u5757\u786c\u76d8\u7ec4\u6210\uff0c\u4f7f\u7528\u7684\u662f\u786c\u76d8\u5207\u5272\uff08Disk Striping\uff09\u6280\u672f\u3002\u76f8\u8f83\u4e8eRAID 1\u7ea7\u522b\uff0c\u597d\u5904\u5c31\u5728\u4e8e\u4fdd\u5b58\u7684\u662f\u5947\u5076\u6821\u9a8c\u4fe1\u606f\u800c\u4e0d\u662f\u4e00\u6a21\u4e00\u6837\u7684\u6587\u4ef6\u5185\u5bb9\uff0c\u6240\u4ee5\u5f53\u91cd\u590d\u5199\u5165\u67d0\u4e2a\u6587\u4ef6\u65f6\uff0cRAID 5\u7ea7\u522b\u7684\u78c1\u76d8\u9635\u5217\u7ec4\u53ea\u9700\u8981\u5bf9\u5e94\u4e00\u4e2a\u5947\u5076\u6821\u9a8c\u4fe1\u606f\u5c31\u53ef\u4ee5\uff0c\u6548\u7387\u66f4\u9ad8\uff0c\u5b58\u50a8\u6210\u672c\u4e5f\u4f1a\u968f\u4e4b\u964d\u4f4e\u3002<\/p>\n

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

RAID 5\u6280\u672f\u662f\u51fa\u4e8e\u786c\u76d8\u8bbe\u5907\u7684\u6210\u672c\u95ee\u9898\u5bf9\u8bfb\u5199\u901f\u5ea6\u548c\u6570\u636e\u7684\u5b89\u5168\u6027\u80fd\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\u5728\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\u9635\u5217\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\u4e5f\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

\"\"<\/p>\n

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

\n
\n

Tips<\/strong><\/h3>\n<\/div>\n
\n

\u7531\u4e8eRAID 10\u662f\u7531RAID 1\u548cRAID 0\u7ec4\u6210\u7684\uff0c\u56e0\u6b64\u6b63\u786e\u7684\u53eb\u6cd5\u662f\u201cRAID\u4e00\u96f6\u201d\uff0c\u800c\u4e0d\u662f\u201cRAID\u5341\u201d\u3002<\/p>\n<\/div>\n<\/div>\n

\u4ed4\u7ec6\u67e5\u770b\u56fe7-4\u53ef\u4ee5\u53d1\u73b0\uff0cRAID 10\u662f\u5148\u5bf9\u4fe1\u606f\u8fdb\u884c\u5206\u5272\uff0c\u7136\u540e\u518d\u4e24\u4e24\u4e00\u7ec4\u5236\u4f5c\u955c\u50cf\u3002\u4e5f\u5c31\u662f\u5148\u5c06RAID 1\u4f5c\u4e3a\u6700\u4f4e\u7ea7\u522b\u7684\u7ec4\u5408\uff0c\u7136\u540e\u518d\u4f7f\u7528RAID 0\u6280\u672f\u5c06RAID 1\u78c1\u76d8\u9635\u5217\u7ec4\u5408\u5230\u4e00\u8d77\uff0c\u5c06\u5b83\u4eec\u89c6\u4e3a\u201c\u4e00\u6574\u5757\u201d\u786c\u76d8\u3002\u800cRAID 01\u5219\u76f8\u53cd\uff0c\u5b83\u662f\u5148\u5c06\u786c\u76d8\u5206\u4e3a\u4e24\u7ec4\uff0c\u7136\u540e\u4f7f\u7528RAID 0\u4f5c\u4e3a\u6700\u4f4e\u7ea7\u522b\u7684\u7ec4\u5408\uff0c\u518d\u5c06\u8fd9\u4e24\u7ec4RAID 0\u786c\u76d8\u901a\u8fc7RAID 1\u6280\u672f\u7ec4\u5408\u5230\u4e00\u8d77\u3002<\/p>\n

RAID 10\u6280\u672f\u548cRAID 01\u6280\u672f\u7684\u533a\u522b\u975e\u5e38\u660e\u663e\u3002\u5728RAID 10\u4e2d\uff0c\u4efb\u4f55\u4e00\u5757\u786c\u76d8\u635f\u574f\u90fd\u4e0d\u4f1a\u5f71\u54cd\u5230\u6570\u636e\u5b89\u5168\u6027\uff0c\u5176\u4f59\u786c\u76d8\u5747\u4f1a\u6b63\u5e38\u8fd0\u4f5c\u3002\u4f46\u5728RAID 01\u4e2d\uff0c\u53ea\u8981\u6709\u4efb\u4f55\u4e00\u5757\u786c\u76d8\u635f\u574f\uff0c\u6700\u4f4e\u7ea7\u522b\u7684RAID 0\u78c1\u76d8\u9635\u5217\u9a6c\u4e0a\u4f1a\u505c\u6b62\u8fd0\u4f5c\uff0c\u8fd9\u53ef\u80fd\u9020\u6210\u4e25\u91cd\u9690\u60a3\u3002\u6240\u4ee5RAID 10\u8fdc\u6bd4RAID 01\u5e38\u89c1\uff0c\u5f88\u591a\u4e3b\u677f\u751a\u81f3\u4e0d\u652f\u6301RAID 01\u3002<\/p>\n

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

\u5728\u5177\u5907\u4e86\u7b2c6\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\u8fd9\u91cc\u4e0d\u518d\u8be6\u8ff0\u6dfb\u52a0\u786c\u76d8\u7684\u6b65\u9aa4\uff0c\u5927\u5bb6\u81ea\u5df1\u64cd\u4f5c\u5c31\u884c\u3002\u8bb0\u5f97\u786c\u76d8\u8981\u7528SCSI\u6216SATA\u63a5\u53e3\u7684\u7c7b\u578b\uff0c\u5927\u5c0f\u9ed8\u8ba420GB\u5c31\u53ef\u4ee5\u3002<\/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\u65b0\u6dfb\u52a0\u7684\u786c\u76d8\u8bbe\u5907\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\u4f7f\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\u548c\u64cd\u4f5c\u8fc7\u7a0b\u4e0e\u751f\u4ea7\u73af\u5883\u4e2d\u7684\u5b8c\u5168\u4e00\u81f4\u3002<\/p>\n

mdadm\u547d\u4ee4\u7528\u4e8e\u521b\u5efa\u3001\u8c03\u6574\u3001\u76d1\u63a7\u548c\u7ba1\u7406RAID\u8bbe\u5907\uff0c\u82f1\u6587\u5168\u79f0\u4e3a\u201cmultiple devices admin\u201d\uff0c\u8bed\u6cd5\u683c\u5f0f\u4e3a\u201cmdadm\u53c2\u6570 \u786c\u76d8\u540d\u79f0\u201d\u3002<\/p>\n

\"\"<\/p>\n

\u56fe7-5\u00a0 \u6dfb\u52a0\u56db\u5757\u786c\u76d8\u8bbe\u5907<\/p>\n

mdadm\u547d\u4ee4\u4e2d\u7684\u5e38\u7528\u53c2\u6570\u53ca\u4f5c\u7528\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 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\u8bb0\u5fc6\u548c\u9605\u8bfb\u3002\u66f4\u4f55\u51b5\u5982\u679c\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-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 -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 20954112K\r\nmdadm: Defaulting to version 1.2 metadata\r\nmdadm: array \/dev\/md0 started.<\/pre>\n

\u521d\u59cb\u5316\u8fc7\u7a0b\u5927\u7ea6\u9700\u89811\u5206\u949f\u5de6\u53f3\uff0c\u671f\u95f4\u53ef\u4ee5\u7528-D\u53c2\u6570\u8fdb\u884c\u67e5\u770b\u3002\u4e5f\u53ef\u4ee5\u7528-Q\u53c2\u6570\u67e5\u770b\u7b80\u8981\u4fe1\u606f\uff1a<\/p>\n

[root@linuxprobe ~]# mdadm -Q \/dev\/md0\r\n\/dev\/md0: 39.97GiB raid10 4 devices, 0 spares. Use mdadm --detail for more detail.<\/pre>\n

\u540c\u5b66\u4eec\u53ef\u80fd\u4f1a\u597d\u5947\uff0c\u4e3a\u4ec0\u4e484\u575720GB\u5927\u5c0f\u7684\u786c\u76d8\u7ec4\u6210\u7684\u78c1\u76d8\u9635\u5217\u7ec4\uff0c\u53ef\u7528\u7a7a\u95f4\u53ea\u670939.97GB\u5462\uff1f<\/p>\n

\u8fd9\u91cc\u4e0d\u5f97\u4e0d\u63d0\u5230RAID 10\u6280\u672f\u7684\u539f\u7406\u3002\u5b83\u901a\u8fc7\u4e24\u4e24\u4e00\u7ec4\u786c\u76d8\u7ec4\u6210\u7684RAID 1\u78c1\u76d8\u9635\u5217\u4fdd\u8bc1\u4e86\u6570\u636e\u7684\u53ef\u9760\u6027\uff0c\u5176\u4e2d\u6bcf\u4e00\u4efd\u6570\u636e\u90fd\u4f1a\u88ab\u4fdd\u5b58\u4e24\u6b21\uff0c\u56e0\u6b64\u5bfc\u81f4\u786c\u76d8\u5b58\u572850%\u7684\u4f7f\u7528\u7387\u548c50%\u7684\u5197\u4f59\u7387\u3002\u8fd9\u6837\u4e00\u6765\uff0c80GB\u7684\u786c\u76d8\u5bb9\u91cf\u4e5f\u5c31\u53ea\u6709\u4e00\u534a\u4e86\u3002<\/p>\n

\u7b49\u4e24\u4e09\u5206\u949f\u540e\uff0c\u628a\u5236\u4f5c\u597d\u7684RAID\u78c1\u76d8\u9635\u5217\u683c\u5f0f\u5316\u4e3aExt4\u683c\u5f0f\uff1a<\/p>\n

[root@linuxprobe ~]# mkfs.ext4 \/dev\/md0\r\nmke2fs 1.44.3 (10-July-2018)\r\nCreating filesystem with 10477056 4k blocks and 2621440 inodes\r\nFilesystem UUID: d1c68318-a919-4211-b4dc-c4437bcfe9da\r\nSuperblock backups stored on blocks: \r\n\t32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, \r\n\t4096000, 7962624\r\n\r\nAllocating group tables: done                            \r\nWriting inode tables: done                            \r\nCreating journal (65536 blocks): done\r\nWriting superblocks and filesystem accounting information: done   \r\n<\/pre>\n

\u968f\u540e\uff0c\u521b\u5efa\u6302\u8f7d\u70b9\uff0c\u5c06\u786c\u76d8\u8bbe\u5907\u8fdb\u884c\u6302\u8f7d\u64cd\u4f5c\uff1a<\/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\ndevtmpfs               969M     0  969M   0% \/dev\r\ntmpfs                  984M     0  984M   0% \/dev\/shm\r\ntmpfs                  984M  9.6M  975M   1% \/run\r\ntmpfs                  984M     0  984M   0% \/sys\/fs\/cgroup\r\n\/dev\/mapper\/rhel-root   17G  3.9G   14G  23% \/\r\n\/dev\/sr0               6.7G  6.7G     0 100% \/media\/cdrom\r\n\/dev\/sda1             1014M  152M  863M  15% \/boot\r\ntmpfs                  197M   16K  197M   1% \/run\/user\/42\r\ntmpfs                  197M  3.5M  194M   2% \/run\/user\/0\r\n\/dev\/md0                40G   49M   38G   1% \/RAID<\/strong><\/pre>\n

\u518d\u6765\u67e5\u770b\/dev\/md0\u78c1\u76d8\u9635\u5217\u8bbe\u5907\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u786e\u8ba4RAID\u7ea7\u522b\uff08Raid Level\uff09\u3001\u9635\u5217\u5927\u5c0f\uff08Array Size\uff09\u548c\u603b\u786c\u76d8\u6570\uff08Total Devices\uff09\u90fd\u662f\u5426\u6b63\u786e\uff1a<\/p>\n

[root@linuxprobe ~]# mdadm -D \/dev\/md0\r\n\/dev\/md0:\r\n           Version : 1.2\r\n     Creation Time : Wed Jan 13 08:24:58 2021\r\n        Raid Level : raid10\r\n        Array Size : 41908224 (39.97 GiB 42.91 GB)\r\n     Used Dev Size : 20954112 (19.98 GiB 21.46 GB)\r\n      Raid Devices : 4\r\n     Total Devices : 4\r\n       Persistence : Superblock is persistent\r\n\r\n       Update Time : Thu Jan 14 04:49:57 2021\r\n             State : clean \r\n    Active Devices : 4\r\n   Working Devices : 4\r\n    Failed Devices : 0\r\n     Spare Devices : 0\r\n\r\n            Layout : near=2\r\n        Chunk Size : 512K\r\n\r\nConsistency Policy : resync\r\n\r\n              Name : localhost.localdomain:0  (local to host lrxjmw.cn)\r\n              UUID : 289f501b:3f5f70f9:79189d77:f51ca11a\r\n            Events : 17\r\n\r\n    Number   Major   Minor   RaidDevice State\r\n       0       8       16        0      active sync set-A   \/dev\/sdb\r\n       1       8       32        1      active sync set-B   \/dev\/sdc\r\n       2       8       48        2      active sync set-A   \/dev\/sdd\r\n       3       8       64        3      active sync set-B   \/dev\/sde\r\n<\/pre>\n

\u5982\u679c\u60f3\u8ba9\u521b\u5efa\u597d\u7684RAID\u78c1\u76d8\u9635\u5217\u80fd\u591f\u4e00\u76f4\u63d0\u4f9b\u670d\u52a1\uff0c\u4e0d\u4f1a\u56e0\u6bcf\u6b21\u7684\u91cd\u542f\u64cd\u4f5c\u800c\u53d6\u6d88\uff0c\u90a3\u4e48\u4e00\u5b9a\u8981\u8bb0\u5f97\u5c06\u4fe1\u606f\u6dfb\u52a0\u5230\/etc\/fstab\u6587\u4ef6\u4e2d\uff0c\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u5728\u6bcf\u6b21\u91cd\u542f\u540eRAID\u78c1\u76d8\u9635\u5217\u90fd\u662f\u6709\u6548\u7684\u3002<\/p>\n

[root@linuxprobe ~]# echo \"\/dev\/md0 \/RAID ext4 defaults 0 0\" >> \/etc\/fstab\r\n[root@linuxprobe ~]# cat \/etc\/fstab\r\n#\r\n# \/etc\/fstab\r\n# Created by anaconda on Tue Jul 21 05:03:40 2020\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# After editing this file, run 'systemctl daemon-reload' to update systemd\r\n# units generated from this file.\r\n#\r\n\/dev\/mapper\/rhel-root                       \/                 xfs         defaults      0 0\r\nUUID=2db66eb4-d9c1-4522-8fab-ac074cd3ea0b   \/boot             xfs         defaults      0 0\r\n\/dev\/mapper\/rhel-swap                       swap              swap        defaults      0 0\r\n\/dev\/cdrom                                  \/media\/cdrom      iso9660     defaults      0 0 \r\n\/dev\/md0                                    \/RAID             ext4        defaults      0 0\r\n<\/strong><\/pre>\n
7.1.2 \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\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\u6211\u4eec\u7684\u786c\u76d8\u8bbe\u5907\u662f\u5728\u865a\u62df\u673a\u4e2d\u6a21\u62df\u51fa\u6765\u7684\uff0c\u6240\u4ee5\u5bf9\u4e8e\u8bfb\u5199\u901f\u5ea6\u7684\u6539\u5584\u53ef\u80fd\u5e76\u4e0d\u76f4\u89c2\u3002\u4e0b\u9762\u51b3\u5b9a\u7ed9\u540c\u5b66\u4eec\u8bb2\u89e3\u4e00\u4e0bRAID\u78c1\u76d8\u9635\u5217\u635f\u574f\u540e\u7684\u5904\u7406\u65b9\u6cd5\uff0c\u4ee5\u786e\u4fdd\u5927\u5bb6\u4ee5\u540e\u5728\u6b65\u5165\u8fd0\u7ef4\u5c97\u4f4d\u540e\u4e0d\u4f1a\u56e0\u4e3a\u7a81\u53d1\u4e8b\u4ef6\u800c\u624b\u5fd9\u811a\u4e71\u3002<\/p>\n

\u5728\u786e\u8ba4\u6709\u4e00\u5757\u7269\u7406\u786c\u76d8\u8bbe\u5907\u51fa\u73b0\u635f\u574f\u800c\u4e0d\u80fd\u518d\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\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\n           Version : 1.2\r\n     Creation Time : Thu Jan 14 05:12:20 2021\r\n        Raid Level : raid10\r\n        Array Size : 41908224 (39.97 GiB 42.91 GB)\r\n     Used Dev Size : 20954112 (19.98 GiB 21.46 GB)\r\n      Raid Devices : 4\r\n     Total Devices : 4\r\n       Persistence : Superblock is persistent\r\n\r\n       Update Time : Thu Jan 14 05:33:06 2021\r\n             State : clean, degraded \r\n    Active Devices : 3\r\n   Working Devices : 3\r\n    Failed Devices : 1\r\n     Spare Devices : 0\r\n\r\n            Layout : near=2\r\n        Chunk Size : 512K\r\n\r\nConsistency Policy : resync\r\n\r\n              Name : localhost.localdomain:0  (local to host localhost.localdomain)\r\n              UUID : 81ee0668:7627c733:0b170c41:cd12f376\r\n            Events : 19\r\n\r\n    Number   Major   Minor   RaidDevice State\r\n       -       0        0        0      removed\r\n       1       8       32        1      active sync set-B   \/dev\/sdc\r\n       2       8       48        2      active sync set-A   \/dev\/sdd\r\n       3       8       64        3      active sync set-B   \/dev\/sde\r\n\r\n       0       8       16        -      faulty   \/dev\/sdb\r\n<\/strong><\/pre>\n

\u521a\u521a\u4f7f\u7528\u7684-f\u53c2\u6570\u662f\u8ba9\u786c\u76d8\u6a21\u62df\u635f\u574f\u7684\u6548\u679c\u3002\u4e3a\u4e86\u80fd\u591f\u5f7b\u5e95\u5730\u5c06\u6545\u969c\u76d8\u79fb\u9664\uff0c\u8fd8\u8981\u518d\u6267\u884c\u4e00\u6b65\u64cd\u4f5c\uff1a<\/p>\n

[root@linuxprobe ~]# mdadm \/dev\/md0 -r \/dev\/sdb\r\nmdadm: hot removed \/dev\/sdb from \/dev\/md0<\/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\u4e88\u4ee5\u66ff\u6362\u5373\u53ef\uff0c\u5728\u6b64\u671f\u95f4\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

\u66f4\u6362\u786c\u76d8\u540e\u518d\u6b21\u4f7f\u7528-a\u53c2\u6570\u8fdb\u884c\u6dfb\u52a0\u64cd\u4f5c\uff0c\u7cfb\u7edf\u9ed8\u8ba4\u4f1a\u81ea\u52a8\u5f00\u59cb\u6570\u636e\u7684\u540c\u6b65\u5de5\u4f5c\u3002\u4f7f\u7528-D\u53c2\u6570\u5373\u53ef\u770b\u5230\u6574\u4e2a\u8fc7\u7a0b\u548c\u8fdb\u5ea6\uff08\u7528\u767e\u5206\u6bd4\u8868\u793a\uff09\uff1a<\/p>\n

[root@linuxprobe ~]# mdadm \/dev\/md0 -a \/dev\/sdb\r\nmdadm: added \/dev\/sdb\r\n[root@linuxprobe ~]# mdadm -D \/dev\/md0\r\n\/dev\/md0:\r\n           Version : 1.2\r\n     Creation Time : Thu Jan 14 05:12:20 2021\r\n        Raid Level : raid10\r\n        Array Size : 41908224 (39.97 GiB 42.91 GB)\r\n     Used Dev Size : 20954112 (19.98 GiB 21.46 GB)\r\n      Raid Devices : 4\r\n     Total Devices : 4\r\n       Persistence : Superblock is persistent\r\n\r\n       Update Time : Thu Jan 14 05:37:32 2021\r\n             State : clean, degraded, recovering \r\n    Active Devices : 3\r\n   Working Devices : 4\r\n    Failed Devices : 0\r\n     Spare Devices : 1\r\n\r\n            Layout : near=2\r\n        Chunk Size : 512K\r\n\r\nConsistency Policy : resync\r\n\r\n    Rebuild Status : 77% complete<\/strong>\r\n\r\n              Name : localhost.localdomain:0  (local to host localhost.localdomain)\r\n              UUID : 81ee0668:7627c733:0b170c41:cd12f376\r\n            Events : 34\r\n\r\n    Number   Major   Minor   RaidDevice State\r\n       4       8       16        0      spare rebuilding    \/dev\/sdb<\/strong>\r\n       1       8       32        1      active sync set-B   \/dev\/sdc\r\n       2       8       48        2      active sync set-A   \/dev\/sdd\r\n       3       8       64        3      active sync set-B   \/dev\/sde\r\n<\/pre>\n

\u8fd9\u65f6\u5019\u53ef\u80fd\u4f1a\u6709\u5b66\u751f\u4e3e\u624b\u63d0\u95ee\u4e86\uff1a\u201c\u8001\u5e08\uff0c\u6211\u4eec\u516c\u53f8\u673a\u623f\u7684\u9635\u5217\u5361\u4e0a\u670930\u591a\u5757\u786c\u76d8\u5462\uff0c\u5c31\u7b97\u77e5\u9053\/dev\/sdb\u786c\u76d8\u53d1\u751f\u4e86\u6545\u969c\uff0c\u6211\u4e5f\u4e0d\u77e5\u9053\u8be5\u66ff\u6362\u54ea\u4e00\u5757\u554a\uff0c\u8981\u662f\u9519\u62d4\u4e86\u597d\u8bbe\u5907\u90a3\u5c31\u9ebb\u70e6\u4e86\u3002\u201d\u5176\u5b9e\u4e0d\u7528\u62c5\u5fc3\uff0c\u56e0\u4e3a\u4e00\u65e6\u786c\u76d8\u53d1\u751f\u6545\u969c\uff0c\u670d\u52a1\u5668\u4e0a\u76f8\u5e94\u7684\u6307\u793a\u706f\u4e5f\u4f1a\u53d8\u6210\u7ea2\u706f\uff08\u6216\u8005\u53d8\u6210\u4e00\u76f4\u95ea\u70c1\u7684\u9ec4\u706f\uff09\uff0c\u5982\u56fe7-6\u6240\u793a\u3002<\/p>\n

\"\"<\/p>\n

7.1.3 \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\u8be5RAID 1\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\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\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\uff08\u4e5f\u53eb\u70ed\u5907\u76d8\uff09\uff0c\u6240\u4ee5\u603b\u8ba1\u9700\u8981\u5728\u865a\u62df\u673a\u4e2d\u6a21\u62df4\u5757\u786c\u76d8\u8bbe\u5907\uff0c\u5982\u56fe7-7\u6240\u793a\u3002<\/p>\n

\"\"<\/div>\n

\u56fe7-7 \u91cd\u7f6e\u865a\u62df\u673a\u540e\uff0c\u518d\u6dfb\u52a0\u56db\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\uff0c\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 20954112K\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\n           Version : 1.2\r\n     Creation Time : Thu Jan 14 06:12:32 2021\r\n        Raid Level : raid5\r\n        Array Size : 41908224 (39.97 GiB 42.91 GB)\r\n     Used Dev Size : 20954112 (19.98 GiB 21.46 GB)\r\n      Raid Devices : 3\r\n     Total Devices : 4\r\n       Persistence : Superblock is persistent\r\n\r\n       Update Time : Thu Jan 14 06:14:16 2021\r\n             State : clean \r\n    Active Devices : 3\r\n   Working Devices : 4\r\n    Failed Devices : 0\r\n     Spare Devices : 1\r\n\r\n            Layout : left-symmetric\r\n        Chunk Size : 512K\r\n\r\nConsistency Policy : resync\r\n\r\n              Name : localhost.localdomain:0  (local to host localhost.localdomain)\r\n              UUID : cf0c34b6:3b08edfb:85dfa14f:e2bffc1e\r\n            Events : 18\r\n\r\n    Number   Major   Minor   RaidDevice State\r\n       0       8       16        0      active sync   \/dev\/sdb\r\n       1       8       32        1      active sync   \/dev\/sdc\r\n       4       8       48        2      active sync   \/dev\/sdd\r\n\r\n       3       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\u80fd\u591f\u4f7f\u7528\u4e86\uff1a<\/p>\n

[root@linuxprobe ~]# mkfs.ext4 \/dev\/md0\r\nmke2fs 1.44.3 (10-July-2018)\r\nCreating filesystem with 10477056 4k blocks and 2621440 inodes\r\nFilesystem UUID: ff016386-1126-4799-8a5b-d716242276ec\r\nSuperblock backups stored on blocks: \r\n\t32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, \r\n\t4096000, 7962624\r\n\r\nAllocating group tables: done                            \r\nWriting inode tables: done                            \r\nCreating journal (65536 blocks): done\r\nWriting superblocks and filesystem accounting information: done   \r\n[root@linuxprobe ~]# mkdir \/RAID\r\n[root@linuxprobe ~]# echo \"\/dev\/md0 \/RAID ext4 defaults 0 0\" >> \/etc\/fstab\r\n<\/pre>\n

\u75313\u5757\u786c\u76d8\u7ec4\u6210\u7684RAID 5\u78c1\u76d8\u9635\u5217\uff0c\u5176\u5bf9\u5e94\u7684\u53ef\u7528\u7a7a\u95f4\u662fn<\/em>-1\uff0c\u4e5f\u5c31\u662f40GB\u3002\u70ed\u5907\u76d8\u7684\u7a7a\u95f4\u4e0d\u8ba1\u7b97\u8fdb\u6765\uff0c\u5e73\u65f6\u5b8c\u5168\u5c31\u662f\u5728\u201c\u7761\u89c9\u201d\uff0c\u53ea\u6709\u5728\u610f\u5916\u51fa\u73b0\u65f6\u624d\u4f1a\u5f00\u59cb\u5de5\u4f5c\u3002<\/p>\n

[root@linuxprobe ~]# mount -a\r\n[root@linuxprobe ~]# df -h\r\nFilesystem             Size  Used Avail Use% Mounted on\r\ndevtmpfs               969M     0  969M   0% \/dev\r\ntmpfs                  984M     0  984M   0% \/dev\/shm\r\ntmpfs                  984M  9.6M  974M   1% \/run\r\ntmpfs                  984M     0  984M   0% \/sys\/fs\/cgroup\r\n\/dev\/mapper\/rhel-root   17G  3.9G   14G  23% \/\r\n\/dev\/sr0               6.7G  6.7G     0 100% \/media\/cdrom\r\n\/dev\/sda1             1014M  152M  863M  15% \/boot\r\ntmpfs                  197M   16K  197M   1% \/run\/user\/42\r\ntmpfs                  197M  3.5M  194M   2% \/run\/user\/0\r\n\/dev\/md0                40G   49M   38G   1% \/RAID\r\n<\/strong><\/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\u3002\u6240\u4ee5\uff0c\u5982\u679c\u516c\u53f8\u4e0d\u5dee\u94b1\u7684\u8bdd\uff0c\u8fd8\u662f\u4e70\u4e0a\u4e00\u5757\u5907\u4efd\u76d8\u4ee5\u9632\u4e07\u4e00\u5427\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\n           Version : 1.2\r\n     Creation Time : Thu Jan 14 06:12:32 2021\r\n        Raid Level : raid5\r\n        Array Size : 41908224 (39.97 GiB 42.91 GB)\r\n     Used Dev Size : 20954112 (19.98 GiB 21.46 GB)\r\n      Raid Devices : 3\r\n     Total Devices : 4\r\n       Persistence : Superblock is persistent\r\n\r\n       Update Time : Thu Jan 14 06:24:38 2021\r\n             State : clean \r\n    Active Devices : 3\r\n   Working Devices : 3\r\n    Failed Devices : 1\r\n     Spare Devices : 0\r\n\r\n            Layout : left-symmetric\r\n        Chunk Size : 512K\r\n\r\nConsistency Policy : resync\r\n\r\n              Name : localhost.localdomain:0  (local to host localhost.localdomain)\r\n              UUID : cf0c34b6:3b08edfb:85dfa14f:e2bffc1e\r\n            Events : 37\r\n\r\n    Number   Major   Minor   RaidDevice State\r\n       3       8       64        0      active sync   \/dev\/sde\r\n       1       8       32        1      active sync   \/dev\/sdc\r\n       4       8       48        2      active sync   \/dev\/sdd\r\n\r\n       0       8       16        -      faulty   \/dev\/sdb<\/strong><\/pre>\n

\u662f\u4e0d\u662f\u611f\u89c9\u5f88\u6709\u610f\u601d\u5462\uff1f\u53e6\u5916\u8003\u8651\u5230\u7bc7\u5e45\u9650\u5236\uff0c\u6211\u4eec\u4e00\u76f4\u6ca1\u6709\u590d\u5236\u3001\u7c98\u8d34\/RAID\u76ee\u5f55\u4e2d\u6587\u4ef6\u7684\u4fe1\u606f\uff0c\u6709\u5174\u8da3\u7684\u540c\u5b66\u53ef\u4ee5\u81ea\u5df1\u52a8\u624b\u8bd5\u4e00\u4e0b\u3002\u91cc\u9762\u7684\u6587\u4ef6\u5185\u5bb9\u975e\u5e38\u5b89\u5168\uff0c\u4e0d\u4f1a\u51fa\u73b0\u4e22\u5931\u7684\u60c5\u51b5\u3002\u5982\u679c\u540e\u9762\u60f3\u518d\u6dfb\u52a0\u4e00\u5757\u70ed\u5907\u76d8\u8fdb\u6765\uff0c\u4f7f\u7528-a\u53c2\u6570\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n

7.1.4 \u5220\u9664\u78c1\u76d8\u9635\u5217<\/strong><\/span><\/h6>\n

\u5728\u751f\u4ea7\u73af\u5883\u4e2d\uff0cRAID\u78c1\u76d8\u9635\u5217\u90e8\u7f72\u540e\u4e00\u822c\u4e0d\u4f1a\u88ab\u8f7b\u6613\u505c\u7528\u3002\u4f46\u4e07\u4e00\u8d76\u4e0a\u4e86\uff0c\u8fd8\u662f\u8981\u77e5\u9053\u600e\u4e48\u5c06\u78c1\u76d8\u9635\u5217\u5220\u9664\u3002\u524d\u9762\u90a3\u79cdRAID 5+\u70ed\u5907\u76d8\u635f\u574f\u7684\u60c5\u51b5\u662f\u6bd4\u8f83\u590d\u6742\u7684\uff0c\u6240\u4ee5\u4ee5\u8fd9\u79cd\u60c5\u5f62\u6765\u8fdb\u884c\u8bb2\u89e3\u662f\u518d\u597d\u4e0d\u8fc7\u4e86\u3002<\/p>\n

\u9996\u5148\uff0c\u9700\u8981\u5c06\u6240\u6709\u7684\u78c1\u76d8\u90fd\u8bbe\u7f6e\u6210\u505c\u7528\u72b6\u6001\uff1a<\/p>\n

[root@linuxprobe ~]# umount \/RAID\r\n[root@linuxprobe ~]# mdadm \/dev\/md0 -f \/dev\/sdc\r\nmdadm: set \/dev\/sdc faulty in \/dev\/md0\r\n[root@linuxprobe ~]# mdadm \/dev\/md0 -f \/dev\/sdd\r\nmdadm: set \/dev\/sdd faulty in \/dev\/md0\r\n[root@linuxprobe ~]# mdadm \/dev\/md0 -f \/dev\/sde\r\nmdadm: set \/dev\/sde faulty in \/dev\/md0\r\n<\/pre>\n

\u7136\u540e\u518d\u9010\u4e00\u79fb\u9664\u51fa\u53bb\uff1a<\/p>\n

[root@linuxprobe ~]# mdadm \/dev\/md0 -r \/dev\/sdb\r\nmdadm: hot removed \/dev\/sdb from \/dev\/md0\r\n[root@linuxprobe ~]# mdadm \/dev\/md0 -r \/dev\/sdc\r\nmdadm: hot removed \/dev\/sdc from \/dev\/md0\r\n[root@linuxprobe ~]# mdadm \/dev\/md0 -r \/dev\/sdd\r\nmdadm: hot removed \/dev\/sdd from \/dev\/md0\r\n[root@linuxprobe ~]# mdadm \/dev\/md0 -r \/dev\/sde\r\nmdadm: hot removed \/dev\/sde from \/dev\/md0\r\n<\/pre>\n

\u5982\u679c\u7740\u6025\uff0c\u4e5f\u53ef\u4ee5\u7528\u201cmdadm \/dev\/md0 -f \/dev\/sdb -r \/dev\/sdb\u201d\u8fd9\u4e00\u6761\u547d\u4ee4\u641e\u5b9a\u3002\u4f46\u662f\uff0c\u5728\u65e9\u671f\u7248\u672c\u7684\u670d\u52a1\u5668\u4e2d\uff0c\u8fd9\u6761\u547d\u4ee4\u4e2d\u7684-f\u548c-r\u4e0d\u80fd\u4e00\u8d77\u4f7f\u7528\uff0c\u56e0\u6b64\u4fdd\u5b88\u8d77\u89c1\uff0c\u8fd8\u662f\u4e00\u6b65\u6b65\u5730\u64cd\u4f5c\u5427\u3002<\/p>\n

\u5c06\u6240\u6709\u7684\u786c\u76d8\u90fd\u79fb\u9664\u540e\uff0c\u518d\u6765\u67e5\u770b\u78c1\u76d8\u9635\u5217\u7ec4\u7684\u72b6\u6001\uff1a<\/p>\n

[root@linuxprobe ~]# mdadm -D \/dev\/md0\r\n\/dev\/md0:\r\n           Version : 1.2\r\n     Creation Time : Fri Jan 15 08:53:41 2021\r\n        Raid Level : raid5\r\n        Array Size : 41908224 (39.97 GiB 42.91 GB)\r\n     Used Dev Size : 20954112 (19.98 GiB 21.46 GB)\r\n      Raid Devices : 3\r\n     Total Devices : 0\r\n       Persistence : Superblock is persistent\r\n\r\n       Update Time : Fri Jan 15 09:00:57 2021\r\n             State : clean, FAILED \r\n    Active Devices : 0\r\n    Failed Devices : 0\r\n     Spare Devices : 0\r\n\r\n            Layout : left-symmetric\r\n        Chunk Size : 512K\r\n\r\nConsistency Policy : resync\r\n\r\n    Number   Major   Minor   RaidDevice State\r\n       -       0        0        0      removed<\/strong>\r\n       -       0        0        1      removed<\/strong>\r\n       -       0        0        2      removed<\/strong>\r\n<\/pre>\n

\u5f88\u68d2\uff01\u4e0b\u9762\u7ee7\u7eed\u505c\u7528\u6574\u4e2aRAID\u78c1\u76d8\u9635\u5217\uff0c\u54b1\u4eec\u7684\u5de5\u4f5c\u5c31\u5f7b\u5e95\u5b8c\u6210\u4e86\uff1a<\/p>\n

[root@linuxprobe ~]# mdadm --stop \/dev\/md0\r\nmdadm: stopped \/dev\/md0\r\n[root@linuxprobe ~]# ls \/dev\/md0\r\nls: cannot access '\/dev\/md0': No such file or directory<\/pre>\n

\u5728\u6709\u4e00\u4e9b\u8001\u7248\u672c\u7684\u670d\u52a1\u5668\u4e2d\uff0c\u5728\u4f7f\u7528--stop\u53c2\u6570\u540e\u4f9d\u7136\u4f1a\u4fdd\u7559\u8bbe\u5907\u6587\u4ef6\u3002\u8fd9\u5f88\u660e\u663e\u662f\u6ca1\u6709\u5904\u7406\u5e72\u51c0\uff0c\u8fd9\u65f6\u518d\u6267\u884c\u4e00\u4e0b\u201cmdadm --remove \/dev\/md0\u201d\u547d\u4ee4\u5373\u53ef\u3002\u540c\u5b66\u4eec\u53ef\u4ee5\u8bb0\u4e00\u4e0b\uff0c\u4ee5\u5907\u4e0d\u65f6\u4e4b\u9700\u3002<\/p>\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\u5b66\u4e60\u8bf7\u52a0\u8bfb\u8005\u7fa4\uff08\u63a8\u8350<\/span><\/strong>\uff09\uff1ahttps:\/\/lrxjmw.cn\/club<\/a><\/p>\n

*\u672c\u7fa4\u7279\u8272\uff1a\u786e\u4fdd\u6bcf\u4e00\u4f4d\u7fa4\u53cb\u90fd\u662f\u300aLinux\u5c31\u8be5\u8fd9\u4e48\u5b66\u300b\u7684\u8bfb\u8005\uff0c\u7b54\u7591\u66f4\u6709\u9488\u5bf9\u6027\uff0c\u4e0d\u5b9a\u671f\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\u2014\u903b\u8f91\u5377\u7ba1\u7406\u5668\uff08Logical Volume Manager\uff0cLVM\uff09\u3002LVM\u5141\u8bb8\u7528\u6237\u5bf9\u786c\u76d8\u8d44\u6e90\u8fdb\u884c\u52a8\u6001\u8c03\u6574\u3002<\/p>\n

LVM\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-8\u6240\u793a\u3002<\/p>\n

\u4e3a\u4e86\u5e2e\u52a9\u5927\u5bb6\u7406\u89e3\uff0c\u6211\u4eec\u6765\u770b\u4e00\u4e2a\u5403\u8d27\u7684\u4f8b\u5b50\u3002\u6bd4\u5982\u5c0f\u660e\u5bb6\u91cc\u60f3\u5403\u9992\u5934\uff0c\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[Physical Volume\uff0cPV]\uff09\u63c9\u6210\u4e00\u4e2a\u5927\u9762\u56e2\uff08\u5377\u7ec4[Volume Group]\uff0cVG\uff09\uff0c\u7136\u540e\u518d\u628a\u8fd9\u4e2a\u5927\u9762\u56e2\u5206\u5272\u6210\u4e00\u4e2a\u4e2a\u5c0f\u9992\u5934\uff08\u903b\u8f91\u5377[Logical Volume\uff0cLV]\uff09\uff0c\u800c\u4e14\u6bcf\u4e2a\u5c0f\u9992\u5934\u7684\u91cd\u91cf\u5fc5\u987b\u662f\u6bcf\u52fa\u9762\u7c89\uff08\u57fa\u672c\u5355\u5143[Physical Extent\uff0cPE]\uff09\u7684\u500d\u6570\u3002<\/p>\n

\u5728\u65e5\u5e38\u7684\u4f7f\u7528\u4e2d\uff0c\u5982\u679c\u5377\u7ec4\uff08VG\uff09\u7684\u5269\u4f59\u5bb9\u91cf\u4e0d\u8db3\uff0c\u53ef\u4ee5\u968f\u65f6\u5c06\u65b0\u7684\u7269\u7406\u5377\uff08PV\uff09\u52a0\u5165\u5230\u91cc\u9762\uff0c\u8fdb\u884c\u4e0d\u65ad\u5730\u6269\u5bb9\u3002\u7531\u4e8e\u62c5\u5fc3\u540c\u5b66\u4eec\u8fd8\u662f\u4e0d\u7406\u89e3\uff0c\u8fd9\u91cc\u51c6\u5907\u4e86\u4e00\u5f20\u903b\u8f91\u5377\u7ba1\u7406\u5668\u7684\u4f7f\u7528\u6d41\u7a0b\u793a\u610f\u56fe\uff0c\u5982\u56fe7-9\u6240\u793a\u3002<\/p>\n

\"\"<\/p>\n

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

\"\"<\/p>\n

\u56fe7-9 \u903b\u8f91\u5377\u7ba1\u7406\u5668\u4f7f\u7528\u6d41\u7a0b\u56fe<\/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\u3002\u5377\u7ec4\u5efa\u7acb\u5728\u7269\u7406\u5377\u4e4b\u4e0a\uff0c\u4e00\u4e2a\u5377\u7ec4\u80fd\u591f\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\u5728\u6700\u521d\u65f6\u5c31\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\u7f72\u65f6\uff0c\u9700\u8981\u9010\u4e2a\u914d\u7f6e\u7269\u7406\u5377\u3001\u5377\u7ec4\u548c\u903b\u8f91\u5377\uff0c\u5e38\u7528\u7684\u90e8\u7f72\u547d\u4ee4\u5982\u88687-3\u6240\u793a\u3002<\/p>\n

\u88687-3\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\u91cd\u65b0\u6dfb\u52a0\u4e24\u5757\u65b0\u786c\u76d8\u8bbe\u5907\uff0c\u5982\u56fe7-10\u6240\u793a\u3002\u7136\u540e\u5f00\u673a\u3002<\/p>\n

\"\"<\/p>\n

\u56fe7-10\u00a0 \u5728\u865a\u62df\u673a\u4e2d\u6dfb\u52a0\u4e24\u5757\u65b0\u7684\u786c\u76d8\u8bbe\u5907<\/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\u987b\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\u5141\u8bb8\u7531\u7528\u6237\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\u4e0b\u6587\u5c06\u5bf9\u6bcf\u4e00\u4e2a\u6b65\u9aa4\u505a\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

\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   \r\n  Free  PE \/ Size       10238 \/ 39.99 GiB<\/strong>\r\n  VG UUID               HPwsm4-lOvI-8O0Q-TG54-BkyI-ONYE-owlGLd\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\u518d\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                AsDGJj-G6Uo-HG4q-auD6-lmyn-aLY0-o36HEj\r\n  LV Write Access        read\/write\r\n  LV Creation host, time localhost.localdomain, 2021-01-15 00:47:35 +0800\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\u5c31\u662f\u4e2a\u5feb\u6377\u65b9\u5f0f\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<\/span>\uff09\u3002<\/p>\n

[root@linuxprobe\u00a0~]# mkfs.ext4 \/dev\/storage\/vo \r\nmke2fs 1.44.3 (10-July-2018)\r\nCreating filesystem with 151552 1k blocks and 38000 inodes\r\nFilesystem UUID: 429cbc28-4463-4a1b-b601-02a7cf81a1b2\r\nSuperblock backups stored on blocks: \r\n\t8193, 24577, 40961, 57345, 73729\r\n\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

\u5bf9\u4e86\uff0c\u5982\u679c\u4f7f\u7528\u4e86\u903b\u8f91\u5377\u7ba1\u7406\u5668\uff0c\u5219\u4e0d\u5efa\u8bae\u7528XFS\u6587\u4ef6\u7cfb\u7edf\uff0c\u56e0\u4e3aXFS\u6587\u4ef6\u7cfb\u7edf\u81ea\u8eab\u5c31\u53ef\u4ee5\u4f7f\u7528xfs_growfs\u547d\u4ee4\u8fdb\u884c\u78c1\u76d8\u6269\u5bb9\u3002\u8fd9\u867d\u7136\u4e0d\u6bd4LVM\u7075\u6d3b\uff0c\u4f46\u8d77\u7801\u4e5f\u591f\u7528\u3002\u5728\u5b9e\u6d4b\u9636\u6bb5\u6211\u4eec\u53d1\u73b0\uff0c\u5728\u6709\u4e00\u4e9b\u670d\u52a1\u5668\u4e0a\uff0cXFS\u4e0eLVM\u7684\u517c\u5bb9\u6027\u5e76\u4e0d\u597d\u3002<\/p>\n

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

[root@linuxprobe ~]# df -h\r\nFilesystem              Size  Used Avail Use% Mounted on\r\ndevtmpfs                969M     0  969M   0% \/dev\r\ntmpfs                   984M     0  984M   0% \/dev\/shm\r\ntmpfs                   984M  9.6M  974M   1% \/run\r\ntmpfs                   984M     0  984M   0% \/sys\/fs\/cgroup\r\n\/dev\/mapper\/rhel-root    17G  3.9G   14G  23% \/\r\n\/dev\/sr0                6.7G  6.7G     0 100% \/media\/cdrom\r\n\/dev\/sda1              1014M  152M  863M  15% \/boot\r\ntmpfs                   197M   16K  197M   1% \/run\/user\/42\r\ntmpfs                   197M  3.4M  194M   2% \/run\/user\/0\r\n\/dev\/mapper\/storage-vo  140M  1.6M  128M   2% \/linuxprobe<\/strong>\r\n[root@linuxprobe ~]# echo \"\/dev\/storage\/vo \/linuxprobe ext4 defaults 0 0\" >> \/etc\/fstab\r\n[root@linuxprobe ~]# cat \/etc\/fstab\r\n#\r\n# \/etc\/fstab\r\n# Created by anaconda on Tue Jul 21 05:03:40 2020\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# After editing this file, run 'systemctl daemon-reload' to update systemd\r\n# units generated from this file.\r\n#\r\n\/dev\/mapper\/rhel-root                       \/                       xfs      defaults        0 0\r\nUUID=2db66eb4-d9c1-4522-8fab-ac074cd3ea0b   \/boot                   xfs      defaults        0 0\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\r\n<\/strong><\/pre>\n<\/div>\n
\n
\n

Tips<\/strong><\/h3>\n<\/div>\n
\n

\u7ec6\u5fc3\u7684\u540c\u5b66\u5e94\u8be5\u53c8\u53d1\u73b0\u4e86\u4e00\u4e2a\u5c0f\u95ee\u9898\uff1a\u521a\u521a\u660e\u660e\u5199\u7684\u662f148MB\uff0c\u600e\u4e48\u8fd9\u91cc\u53ea\u6709140MB\u4e86\u5462\uff1f\u8fd9\u662f\u56e0\u4e3a\u786c\u4ef6\u5382\u5546\u7684\u5236\u9020\u6807\u51c6\u662f1GB=1,000MB\u30011MB\uff1d1,000KB\u30011KB\uff1d1,000B\uff0c\u800c\u8ba1\u7b97\u673a\u7cfb\u7edf\u7684\u7b97\u6cd5\u662f1GB=1,024MB\u30011MB\uff1d1,024KB\u30011KB\uff1d1,024B\uff0c\u56e0\u6b64\u67093%\u5de6\u53f3\u7684\u201c\u7f29\u6c34\u201d\u662f\u6b63\u5e38\u60c5\u51b5\u3002<\/p>\n<\/div>\n<\/div>\n

\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\u5bb9\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\nRounding size to boundary between physical extents: 292.00 MiB.\r\nSize of logical volume storage\/vo changed from 148 MiB (37 extents) to 292 MiB (73 extents).\r\nLogical volume storage\/vo successfully resized.\r\n<\/pre>\n

\u7b2c2\u6b65<\/strong>\uff1a\u68c0\u67e5\u786c\u76d8\u7684\u5b8c\u6574\u6027\uff0c\u786e\u8ba4\u76ee\u5f55\u7ed3\u6784\u3001\u5185\u5bb9\u548c\u6587\u4ef6\u5185\u5bb9\u6ca1\u6709\u4e22\u5931\u3002\u4e00\u822c\u60c5\u51b5\u4e0b\u6ca1\u6709\u62a5\u9519\uff0c\u5747\u4e3a\u6b63\u5e38\u60c5\u51b5\u3002<\/p>\n

[root@linuxprobe ~]# e2fsck -f \/dev\/storage\/vo\r\ne2fsck 1.44.3 (10-July-2018)\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<\/pre>\n

\u7b2c3\u6b65<\/strong>\uff1a\u91cd\u7f6e\u8bbe\u5907\u5728\u7cfb\u7edf\u4e2d\u7684\u5bb9\u91cf\u3002\u521a\u521a\u662f\u5bf9LV\uff08\u903b\u8f91\u5377\uff09\u8bbe\u5907\u8fdb\u884c\u4e86\u6269\u5bb9\u64cd\u4f5c\uff0c\u4f46\u7cfb\u7edf\u5185\u6838\u8fd8\u6ca1\u6709\u540c\u6b65\u5230\u8fd9\u90e8\u5206\u65b0\u4fee\u6539\u7684\u4fe1\u606f\uff0c\u9700\u8981\u624b\u52a8\u8fdb\u884c\u540c\u6b65\u3002<\/p>\n

[root@linuxprobe ~]# resize2fs \/dev\/storage\/vo\r\nresize2fs 1.44.3 (10-July-2018)\r\nResizing the filesystem on \/dev\/storage\/vo to 299008 (1k) blocks.\r\nThe filesystem on \/dev\/storage\/vo is now 299008 (1k) blocks long.\r\n<\/pre>\n

\u7b2c4\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\ndevtmpfs                969M     0  969M   0% \/dev\r\ntmpfs                   984M     0  984M   0% \/dev\/shm\r\ntmpfs                   984M  9.6M  974M   1% \/run\r\ntmpfs                   984M     0  984M   0% \/sys\/fs\/cgroup\r\n\/dev\/mapper\/rhel-root    17G  3.9G   14G  23% \/\r\n\/dev\/sr0                6.7G  6.7G     0 100% \/media\/cdrom\r\n\/dev\/sda1              1014M  152M  863M  15% \/boot\r\ntmpfs                   197M   16K  197M   1% \/run\/user\/42\r\ntmpfs                   197M  3.4M  194M   2% \/run\/user\/0\r\n\/dev\/mapper\/storage-vo  279M  2.1M  259M   1% \/linuxprobe\r\n<\/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\u6570\u636e\u4e22\u5931\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\u5916\uff0cLinux\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\u6570\u636e\u7684\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.44.3 (10-July-2018)\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\u901a\u77e5\u7cfb\u7edf\u5185\u6838\u5c06\u903b\u8f91\u5377vo\u7684\u5bb9\u91cf\u51cf\u5c0f\u5230120MB\u3002<\/p>\n

[root@linuxprobe ~]# resize2fs \/dev\/storage\/vo 120M\r\nresize2fs 1.44.3 (10-July-2018)\r\nResizing the filesystem on \/dev\/storage\/vo to 122880 (1k) blocks.\r\nThe filesystem on \/dev\/storage\/vo is now 122880 (1k) blocks long.\r\n<\/pre>\n

\u7b2c3\u6b65<\/strong>\uff1a\u5c06LV\u903b\u8f91\u5377\u7684\u5bb9\u91cf\u4fee\u6539\u4e3a120M\u3002<\/p>\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 storage\/vo? [y\/n]: y<\/strong>\r\n  Size of logical volume storage\/vo changed from 292 MiB (73 extents) to 120 MiB (30 extents).\r\n  Logical volume storage\/vo successfully resized.<\/pre>\n

\u54a6\uff1f\u7f29\u5bb9\u7684\u6b65\u9aa4\u8ddf\u6269\u5bb9\u7684\u6b65\u9aa4\u4e0d\u4e00\u6837\u554a\u3002\u7f29\u5bb9\u64cd\u4f5c\u4e3a\u4ec0\u4e48\u662f\u5148\u901a\u77e5\u7cfb\u7edf\u5185\u6838\u8bbe\u5907\u7684\u5bb9\u91cf\u8981\u6539\u53d8\u6210120MB\uff0c\u7136\u540e\u518d\u6b63\u5f0f\u8fdb\u884c\u7f29\u5bb9\u64cd\u4f5c\u5462\uff1f\u4e3e\u4e2a\u4f8b\u5b50\u5927\u5bb6\u5c31\u660e\u767d\u4e86\u3002\u5c0f\u5f3a\u662f\u4e00\u540d\u521d\u4e2d\u751f\uff0c\u5f00\u5b66\u540e\u770b\u5230\u73ed\u91cc\u6709\u4f4d\u540c\u5b66\u7eb9\u4e86\u8eab\uff0c\u4ed6\u611f\u89c9\u5f88\u9177\uff0c\u81ea\u5df1\u4e5f\u60f3\u7eb9\u4f46\u53c8\u6015\u5bb6\u91cc\u8d23\u9a82\uff0c\u4e8e\u662f\u4ed6\u56de\u5bb6\u540e\u5c31\u8bf4\uff1a\u201c\u5988\u5988\uff0c\u6211\u7eb9\u8eab\u4e86\u3002\u201d\u5982\u679c\u5988\u5988\u7684\u53cd\u5e94\u5f88\u5e73\u548c\uff0c\u90a3\u4e48\u4ed6\u5c31\u53ef\u4ee5\u653e\u5fc3\u5927\u80c6\u5730\u53bb\u7eb9\u8eab\u4e86\u3002\u5982\u679c\u5988\u5988\u5f3a\u70c8\u4e0d\u540c\u610f\uff0c\u4ed6\u9a6c\u4e0a\u5c31\u53ef\u4ee5\u54c8\u54c8\u4e00\u7b11\uff0c\u8bf4\uff1a\u201c\u9017\u7740\u73a9\u5462\u3002\u201d\u8fd9\u6837\u4e5f\u5c31\u4e0d\u4f1a\u6328\u6253\u4e86\u3002<\/p>\n

\u7f29\u5bb9\u64cd\u4f5c\u4e5f\u662f\u540c\u6837\u7684\u9053\u7406\uff0c\u5148\u901a\u77e5\u7cfb\u7edf\u5185\u6838\u81ea\u5df1\u60f3\u7f29\u5c0f\u903b\u8f91\u5377\uff0c\u5982\u679c\u5728\u6267\u884cresize2fs\u547d\u4ee4\u540e\u7cfb\u7edf\u6ca1\u6709\u62a5\u9519\uff0c\u518d\u6b63\u5f0f\u64cd\u4f5c\u3002<\/p>\n

\u7b2c4\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\ndevtmpfs                969M     0  969M   0% \/dev\r\ntmpfs                   984M     0  984M   0% \/dev\/shm\r\ntmpfs                   984M  9.6M  974M   1% \/run\r\ntmpfs                   984M     0  984M   0% \/sys\/fs\/cgroup\r\n\/dev\/mapper\/rhel-root    17G  3.9G   14G  23% \/\r\n\/dev\/sr0                6.7G  6.7G     0 100% \/media\/cdrom\r\n\/dev\/sda1              1014M  152M  863M  15% \/boot\r\ntmpfs                   197M   16K  197M   1% \/run\/user\/42\r\ntmpfs                   197M  3.4M  194M   2% \/run\/user\/0\r\n\/dev\/mapper\/storage-vo  113M  1.6M  103M   2% \/linuxprobe<\/strong>\r\n<\/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\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

\u5728\u6b63\u5f0f\u64cd\u4f5c\u524d\uff0c\u5148\u770b\u770bVG\uff08\u5377\u7ec4\uff09\u4e2d\u7684\u5bb9\u91cf\u662f\u5426\u591f\u7528\uff1a<\/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\r\n  Free  PE \/ Size       10208 \/ <39.88 GiB<\/strong>\r\n  VG UUID               k3ZnaP-wGPr-TQJ5-PCtA-0RgO-jvsi-9elZ5M\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 Jan 15 01:11 lost+found\r\n-rw-r--r--. 1 root root    26 Jan 15 07:01 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\uff0c\u9700\u8981\u4e0e\u8981\u505a\u5feb\u7167\u7684\u8bbe\u5907\u5bb9\u91cf\u4fdd\u6301\u4e00\u81f4\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\uff0c\u7a0d\u540e\u6570\u636e\u4e5f\u4f1a\u8fd8\u539f\u5230\u8fd9\u4e2a\u76f8\u5e94\u7684\u8bbe\u5907\u4e0a\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\r\n  LV UUID                qd7l6w-3Iv1-6E3X-RGkC-t5xl-170r-rDZSEf\r\n  LV Write Access        read\/write\r\n  LV Creation host, time localhost.localdomain, 2021-01-15 07:02:44 +0800\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<\/strong>\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%\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:5\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\u7684\u5360\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, 100 MiB) copied, 0.312057 s, 336 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                qd7l6w-3Iv1-6E3X-RGkC-t5xl-170r-rDZSEf\r\n  LV Write Access        read\/write\r\n  LV Creation host, time localhost.localdomain, 2021-01-15 07:02:44 +0800\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:5\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026\r\n<\/pre>\n

\u7b2c3\u6b65<\/strong>\uff1a\u4e3a\u4e86\u6821\u9a8c\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

lvconvert\u547d\u4ee4\u7528\u4e8e\u7ba1\u7406\u903b\u8f91\u5377\u7684\u5feb\u7167\uff0c\u8bed\u6cd5\u683c\u5f0f\u4e3a\u201clvconvert [\u53c2\u6570]\u5feb\u7167\u5377\u540d\u79f0\u201d\u3002<\/p>\n

\u4f7f\u7528lvconvert\u547d\u4ee4\u80fd\u81ea\u52a8\u6062\u590d\u903b\u8f91\u5377\u7684\u5feb\u7167\uff0c\u5728\u65e9\u671f\u7684RHEL\/CentOS 5\u7248\u672c\u4e2d\u8981\u5199\u5168\u683c\u5f0f\uff1a\u201c--mergesnapshot\u201d\uff0c\u800c\u4eceRHEL 6\u5230RHEL 8\uff0c\u5df2\u7ecf\u5141\u8bb8\u7528\u6237\u53ea\u8f93\u5165--merge\u53c2\u6570\u8fdb\u884c\u64cd\u4f5c\u4e86\uff0c\u7cfb\u7edf\u4f1a\u81ea\u52a8\u5206\u8fa8\u8bbe\u5907\u7684\u7c7b\u578b\u3002<\/p>\n<\/div>\n

\n
[root@linuxprobe ~]# umount \/linuxprobe\r\n[root@linuxprobe ~]# lvconvert --merge \/dev\/storage\/SNAP\r\n  Merging of volume storage\/SNAP started.\r\n  storage\/vo: Merged: 36.41%\r\n  storage\/vo: Merged: 100.00%\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 ~]# cd \/linuxprobe\/\r\n[root@linuxprobe linuxprobe]# ls\r\nlost+found readme.txt<\/strong>\r\n[root@linuxprobe linuxprobe]# cat readme.txt \r\nWelcome to lrxjmw.cn<\/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 Tue Jul 21 05:03:40 2020\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# After editing this file, run 'systemctl daemon-reload' to update systemd\r\n# units generated from this file.\r\n#\r\n\/dev\/mapper\/rhel-root                       \/                       xfs      defaults        0 0\r\nUUID=2db66eb4-d9c1-4522-8fab-ac074cd3ea0b   \/boot                   xfs      defaults        0 0\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\r\n<\/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 storage\/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\r\n<\/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.\r\n<\/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\u76f8\u5173\u4fe1\u606f\u4e86\uff08\u524d\u63d0\u662f\u4e0a\u8ff0\u6b65\u9aa4\u7684\u64cd\u4f5c\u662f\u6b63\u786e\u7684\uff09\u3002\u5e72\u51c0\u5229\u843d\uff01<\/p>\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\u5b66\u4e60\u8bf7\u52a0\u8bfb\u8005\u7fa4\uff08\u63a8\u8350<\/span><\/strong>\uff09\uff1ahttps:\/\/lrxjmw.cn\/club<\/a><\/p>\n

*\u672c\u7fa4\u7279\u8272\uff1a\u786e\u4fdd\u6bcf\u4e00\u4f4d\u7fa4\u53cb\u90fd\u662f\u300aLinux\u5c31\u8be5\u8fd9\u4e48\u5b66\u300b\u7684\u8bfb\u8005\uff0c\u7b54\u7591\u66f4\u6709\u9488\u5bf9\u6027\uff0c\u4e0d\u5b9a\u671f\u9886\u53d6\u5b9a\u5236\u793c\u54c1\u3002<\/p><\/blockquote>\n<\/div>\n

\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\uff0eRAID\u6280\u672f\u4e3b\u8981\u662f\u4e3a\u4e86\u89e3\u51b3\u4ec0\u4e48\u95ee\u9898\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\uff0eRAID 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\u518d\u901a\u8fc7\u7269\u7406\u5377\u7ec4\u6210\u5377\u7ec4\u3002<\/span><\/p>\n

5\uff0eLVM\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\uff0eLVM\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\uff0eLVM\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":"

\u7ae0\u8282\u7b80\u8ff0\uff1a \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\uff08Redun […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[559],"tags":[],"class_list":["post-181463","post","type-post","status-publish","format-standard","hentry","category-rhel8"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/181463","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=181463"}],"version-history":[{"count":90,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/181463\/revisions"}],"predecessor-version":[{"id":209154,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/181463\/revisions\/209154"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=181463"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=181463"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=181463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}