{"id":3819,"date":"2019-08-26T20:33:08","date_gmt":"2019-08-26T12:33:08","guid":{"rendered":"https:\/\/damogame.cn\/wordpress\/?p=3819"},"modified":"2019-08-26T20:33:08","modified_gmt":"2019-08-26T12:33:08","slug":"pc-%e4%b8%8a%e7%9a%84-lvm-%e7%81%be%e9%9a%be%e4%bf%ae%e5%a4%8d","status":"publish","type":"post","link":"https:\/\/i007.cc\/wordpress\/archives\/3819","title":{"rendered":"PC \u4e0a\u7684 LVM \u707e\u96be\u4fee\u590d"},"content":{"rendered":"<p><a href=\"https:\/\/www.cnblogs.com\/drgcaosheng\/p\/5010042.html\">\u539f\u6587\u5730\u5740<\/a><\/p>\n<p>&nbsp;<\/p>\n<div id=\"cnblogs_post_body\" class=\"blogpost-body \">\n<h3 id=\"minor1.1\">LVM \u7b80\u4ecb<\/h3>\n<p>LVM \u662f\u903b\u8f91\u76d8\u5377\u7ba1\u7406\uff08Logical Volume Manager\uff09\u7684\u7b80\u79f0\uff0c\u6700\u65e9\u662f IBM \u4e3a AIX \u7814\u53d1\u7684\u5b58\u50a8\u7ba1\u7406\u673a\u5236\u3002LVM \u901a\u8fc7\u5728\u786c\u76d8\u548c\u5206\u533a\u4e4b\u95f4\u5efa\u7acb\u4e00\u4e2a\u903b\u8f91\u5c42\uff0c\u53ef\u4ee5\u8ba9\u591a\u4e2a\u5206\u533a\u6216\u8005\u7269\u7406\u786c\u76d8\u4f5c\u4e3a\u4e00\u4e2a\u903b\u8f91\u5377 ( \u76f8\u5f53\u4e8e\u4e00\u4e2a\u903b\u8f91\u786c\u76d8 )\uff0c\u63d0\u9ad8\u4e86\u78c1\u76d8\u5206\u533a\u7ba1\u7406\u7684\u7075\u6d3b\u6027\u30021998 \u5e74\uff0cHeinz Mauelshagen \u5728 Linux 2.4 \u5185\u6838\u4e0a\u63d0\u4f9b\u4e86 Linux \u7684 LVM \u5b9e\u73b0\u3002\u76ee\u524d Linux 2.6 \u5185\u6838\u652f\u6301 LVM2\uff0cRedhat \u5b98\u65b9\u7f51\u7ad9\u76ee\u524d\u63d0\u4f9b\u6700\u65b0\u53ef\u4e0b\u8f7d\u7248\u672c\u4e3a 2.2.02.77\uff1b\u5982\u679c\u9700\u8981\u6700\u65b0\u6216\u8005\u5176\u5b83\u7248\u672c\uff0c\u8bf7\u53c2\u8003\u7f51\u9875\u3002<\/p>\n<p>LVM \u65e9\u671f\u591a\u7528\u4e8e\u670d\u52a1\u5668\uff0c\u914d\u5408\u5b58\u50a8\u786c\u4ef6\u7684 Raid \u6280\u672f\uff0c\u63d0\u4f9b\u9ad8\u53ef\u9760\u6027\uff0c\u53ef\u7075\u6d3b\u914d\u7f6e\u7684\u78c1\u76d8\u5206\u533a\u7ba1\u7406\uff1b\u666e\u901a PC \u7531\u4e8e\u5b58\u50a8\u5bb9\u91cf\u6709\u9650\uff0c\u5f88\u5c11\u4f7f\u7528\u8fd9\u79cd\u6280\u672f\u3002\u968f\u7740\u5355\u4e2a\u78c1\u76d8\u5bb9\u91cf\u7684\u4e0d\u65ad\u6269\u5927\u548c\u786c\u76d8\u4ef7\u683c\u7684\u4e0b\u964d\uff0c\u666e\u901a PC \u62e5\u6709 TB \u7ea7\u7684\u5927\u5bb9\u91cf\u5b58\u50a8\u7a7a\u95f4\u9010\u6e10\u666e\u53ca\uff0c\u4e5f\u5e26\u6765\u5bf9 PC \u4e0a\u5b58\u50a8\u7ba1\u7406\u7684\u9700\u8981\uff0cLVM \u65e0\u7591\u662f\u5f88\u597d\u7684\u89e3\u51b3\u65b9\u6848\u3002\u53ea\u662f\u666e\u901a PC \u7528\u6237\u7531\u4e8e\u7f3a\u5c11\u786c\u4ef6\u5197\u4f59\u4fdd\u62a4\uff0c\u5728\u53d1\u751f\u707e\u96be\u65f6\uff0c\u901a\u5e38\u4f1a\u53d1\u751f\u6bd4\u8f83\u4e25\u91cd\u7684\u6570\u636e\u635f\u5931\u3002\u597d\u5728 LVM \u63d0\u4f9b\u4e86\u4e00\u7cfb\u5217\u707e\u96be\u6062\u590d\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u5e2e\u52a9\u666e\u901a PC \u7528\u6237\u5c3d\u53ef\u80fd\u51cf\u5c11\u635f\u5931\u3002<\/p>\n<p>\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u547d\u4ee4\u68c0\u67e5\u7cfb\u7edf\u4e2d\u662f\u5426\u5b89\u88c5\u4e86 lvm \u5de5\u5177\uff1a<\/p>\n<h5 id=\"listing1\">\u6e05\u5355 1. \u67e5\u770b\u7cfb\u7edf\u4e2d LVM \u7248\u672c<\/h5>\n<div class=\"codesection\">\n<pre class=\"displaycode\"> rpm -qa | grep lvm \r\n lvm2-2.02.56-8.el5_5.4<\/pre>\n<\/div>\n<p>\u4e0a\u4f8b\u7cfb\u7edf\u5b89\u88c5\u4e86 2.02.56 \u7248\u672c\u7684 LVM\u3002<\/p>\n<h3 id=\"minor1.2\">LVM \u7684\u57fa\u672c\u6982\u5ff5 pv\/lv\/vg\/vgda<\/h3>\n<p>\u786c\u76d8\u5b58\u50a8\u8bbe\u5907\u8fdb\u884c\u7ba1\u7406 , \u76f8\u5173\u7684\u6982\u5ff5\u548c\u547d\u4ee4\u76f8\u5bf9\u591a\uff0c\u4e0b\u9762\u6211\u4eec\u5bf9 LVM \u7684\u76f8\u5173\u540d\u8bcd\u8fdb\u884c\u89e3\u91ca\u4ee5\u65b9\u4fbf\u8bfb\u8005\u66f4\u597d\u7406\u89e3\u3002<\/p>\n<p>\u7269\u7406\u5377 physical volumes\uff08PV\uff09<\/p>\n<p>\u7269\u7406\u5377\u5904\u4e8e\u903b\u8f91\u5377\u7ba1\u7406\u5668\u4e2d\u7684\u5e95\u5c42\uff0c\u4efb\u4f55\u7684\u903b\u8f91\u5377\u548c\u5377\u7ec4\u90fd\u5fc5\u9700\u4f9d\u9760\u7269\u7406\u5377\u6765\u5efa\u7acb\uff1b\u7269\u7406\u5377\u53ef\u4ee5\u662f\u4e00\u4e2a\u5b8c\u6574\u7684\u786c\u76d8\uff0c\u4e5f\u53ef\u4ee5\u662f\u786c\u76d8\u4e2d\u7684\u4e00\u4e2a\u5206\u533a\uff0c\u5e76\u6709\u4e00\u4e2a\u540d\u5b57 ( \u5982 hdisk0)\u3002<\/p>\n<p>\u903b\u8f91\u5377 logical volumes \uff08LV\uff09<\/p>\n<p>\u903b\u8f91\u5377\u5efa\u7acb\u5728\u5377\u7ec4\u4e4b\u4e0a\uff0c\u5377\u7ec4\u4e2d\u7684\u7a7a\u95f4\u53ef\u4ee5\u5efa\u7acb\u591a\u4e2a\u903b\u8f91\u5377\uff0c\u5e76\u4e14\u903b\u8f91\u5377\u53ef\u4ee5\u968f\u610f\u5728\u5377\u7ec4\u7684\u7a7a\u95f2\u7a7a\u95f4\u4e2d\u589e\u51cf\uff0c\u903b\u8f91\u5377\u53ef\u4ee5\u5c5e\u4e8e\u4e00\u4e2a\u5377\u7ec4\uff0c\u4e5f\u53ef\u4ee5\u5c5e\u4e8e\u4e0d\u540c\u7684\u591a\u4e2a\u5377\u7ec4\u3002LV \u662f\u4f4d\u4e8e PV \u4e0a\u7684\u4fe1\u606f\u7684\u7ec4\u5408\uff0c\u5728 LV \u4e0a\u7684\u6570\u636e\u53ef\u4ee5\u8fde\u7eed\u6216\u8005\u4e0d\u8fde\u7eed\u5730\u51fa\u73b0\u5728 PV\u3002<\/p>\n<p>\u5377\u7ec4 logical volume group\uff08VG\uff09<\/p>\n<p>\u5377\u7ec4\u662f\u5efa\u7acb\u5728\u7269\u7406\u5377\u4e4b\u4e0a\uff0c\u4e00\u4e2a\u5377\u7ec4\u4e2d\u53ef\u4ee5\u5305\u542b\u4e00\u4e2a\u7269\u7406\u5377\u7ec4\u6216\u8005\u591a\u4e2a\u7269\u7406\u5377\u3002\u6240\u6709\u7684\u7269\u7406\u5377\u5c5e\u4e8e\u4e00\u4e2a\u79f0\u4f5c rootvg \u7684\u5377\u7ec4\u3002<\/p>\n<p>\u5377\u7ec4\u63cf\u8ff0\u533a\u57df Volume Group Descriptor Area \uff08VGDA\uff09<\/p>\n<p>\u7528\u4e8e\u63cf\u8ff0\u7269\u7406\u5377\u3001\u5377\u7ec4\u3001\u903b\u8f91\u5377\u5206\u914d\u7684\u6240\u7531\u4fe1\u606f\u3002\u548c\u975e LVM \u7cfb\u7edf\u5c06\u5305\u542b\u5206\u533a\u4fe1\u606f\u7684\u5143\u6570\u636e\u4fdd\u5b58\u5728\u4f4d\u4e8e\u5206\u533a\u7684\u8d77\u59cb\u4f4d\u7f6e\u7684\u5206\u533a\u8868\u4e2d\u4e00\u6837\uff0c\u903b\u8f91\u5377\u4ee5\u53ca\u5377\u7ec4\u76f8\u5173\u7684\u5143\u6570\u636e\u4e5f\u662f\u4fdd\u5b58\u5728\u4f4d\u4e8e\u7269\u7406\u5377\u8d77\u59cb\u5904\u7684 VGDA( \u5377\u7ec4\u63cf\u8ff0\u7b26\u533a\u57df ) \u4e2d\u3002<\/p>\n<h5 id=\"fig1\">\u56fe 1. Linux LVM \u67b6\u6784\u56fe<\/h5>\n<p><img decoding=\"async\" src=\"http:\/\/www.ibm.com\/developerworks\/cn\/linux\/l-cn-pclvm-rstr\/image001.jpg\" alt=\"\u56fe 1. Linux LVM \u67b6\u6784\u56fe\" width=\"500\" \/><\/p>\n<p class=\"ibm-ind-link ibm-back-to-top\"><a class=\"ibm-anchor-up-link\" href=\"http:\/\/www.ibm.com\/developerworks\/cn\/linux\/l-cn-pclvm-rstr\/#ibm-pcon\">\u56de\u9875\u9996<\/a><\/p>\n<h2 id=\"major2\">LVM \u707e\u96be\u4fee\u590d\u57fa\u672c\u601d\u8def<\/h2>\n<h3 id=\"minor2.1\">\u707e\u96be\u7684\u7c7b\u578b<\/h3>\n<p>\u6587\u4ef6\u7cfb\u7edf\u707e\u96be\u4e00\u822c\u53ef\u4ee5\u5206\u4e3a\u4e24\u7c7b\u2014\u2014\u4eba\u4e3a\u707e\u96be\u548c\u81ea\u7136\u707e\u96be\u3002\u4eba\u4e3a\u707e\u96be\u4e3b\u8981\u662f\u4eba\u4e3a\u64cd\u4f5c\u5bfc\u81f4\u7684\u6570\u636e\u4e22\u5931\uff0c\u5206\u533a\u635f\u574f\uff0c\u5206\u533a\u8868\u635f\u574f\u7b49\u7b49\uff0c\u81ea\u7136\u707e\u96be\u4e3b\u8981\u662f\u7531\u4e8e\u4e8b\u6545\u3001\u610f\u5916\u4e8b\u4ef6\u6216\u8005\u81ea\u7136\u635f\u8017\u5bfc\u81f4\u7684\u78c1\u76d8\u574f\u9053\uff0c\u78c1\u76d8\u635f\u574f\uff0c\u76f8\u5173\u786c\u4ef6\u635f\u574f\u5bfc\u81f4\u7684\u78c1\u76d8\u4f4d\u7f6e\u8c03\u6574\u7b49\u7b49\u3002<\/p>\n<p>\u7531 \u4e8e LVM \u548c\u666e\u901a\u6587\u4ef6\u7cfb\u7edf\u7684\u786c\u4ef6\u73af\u5883\u5e76\u6ca1\u6709\u4ec0\u4e48\u533a\u522b\uff0c\u6240\u4ee5\u4ed6\u4eec\u6240\u9762\u5bf9\u7684\u81ea\u7136\u707e\u96be\u7c7b\u578b\u4e5f\u662f\u4e00\u81f4\u7684\u3002\u4f46\u662f\u5bf9\u4e8e LVM \u800c\u8a00\uff0c\u901a\u8fc7\u865a\u62df\u5316\u5b58\u50a8\u7ba1\u7406\u5e26\u6765\u5206\u533a\u5bb9\u91cf\u52a8\u6001\u8c03\u6574\u4fbf\u5229\u7684\u540c\u65f6\uff0c\u4e5f\u5e26\u6765\u4e86\u4e00\u4e9b LVM \u7279\u6709\u7684\u4eba\u4e3a\u707e\u96be\u3002\u5982\u7b2c\u4e00\u7ae0\u6240\u8bf4\uff0cLVM \u5c06\u6240\u6709\u78c1\u76d8\u521b\u5efa\u4e3a\u7269\u7406\u5377\u7f6e\u4e8e\u5377\u7ec4\u4e2d\u7edf\u4e00\u7ba1\u7406\uff0c\u7136\u540e\u521b\u5efa\u903b\u8f91\u5377\u4f9b\u64cd\u4f5c\u7cfb\u7edf\u8c03\u7528\uff0c\u8fd9\u4e5f\u5c31\u5bfc\u81f4\u53ef\u80fd\u51fa\u73b0\u5377\u7ec4\u635f\u574f\uff0c\u903b\u8f91\u5377\u635f\u574f\uff0c\u7269\u7406\u5377\u635f\u574f\u7b49\u707e\u96be\u3002<\/p>\n<h3 id=\"minor2.2\">\u4fee\u590d\u7684\u7b56\u7565<\/h3>\n<p>\u5bf9\u4e8e\u4f01\u4e1a\u7528\u6237\u800c\u8a00\uff0c\u901a\u5e38\u4f1a\u5236\u5b9a\u4e25\u683c\u7684\u64cd\u4f5c\u89c4\u7ae0\u5236\u5ea6\u6765\u548c\u5b8c\u5907\u7684\u5907\u4efd\u7b56\u7565\u6765\u62b5\u5fa1\u4eba\u4e3a\u707e\u96be\uff0c\u8fd8\u6709\u5b8c\u6574\u7684\u786c\u4ef6\u5197\u4f59\u65b9\u6848\u6765\u5bf9\u6297\u81ea\u7136\u707e\u96be\uff1b\u5bf9\u4e8e\u666e\u901a\u7528\u6237\u800c\u8a00\uff0c\u4e00\u822c\u90fd\u4e0d\u5177\u5907\u8fd9\u79cd\u5ba2\u89c2\u6761\u4ef6\u6765\u9632\u8303\u707e\u96be\u3002\u4e00\u65e6\u53d1\u751f\u707e\u96be\uff0c\u6211\u4eec\u6240\u8981\u505a\u7684\u662f\u5c3d\u91cf\u51cf\u5c11\u707e\u96be\u7684\u5f71\u54cd\uff0c\u5c3d\u53ef\u80fd\u6062\u590d\u707e\u96be\u6240\u9020\u6210\u7684\u6570\u636e\u635f\u5931\u3002<\/p>\n<p>\u5bf9\u4e8e LVM \u7684\u4eba\u4e3a\u707e\u96be\u6062\u590d\u800c\u8a00\uff0cLVM \u672c\u8eab\u63d0\u4f9b\u4e86\u6570\u636e\u5907\u4efd\u548c\u914d\u7f6e\u4fe1\u606f\u5907\u4efd\u7684\u5de5\u5177\uff0c\u53ef\u4ee5\u5145\u5206\u5229\u7528\u8fd9\u4e9b\u5de5\u5177\u8fdb\u884c\u5907\u4efd\uff0c\u5728\u53d1\u751f\u4eba\u4e3a\u707e\u96be\u5bfc\u81f4\u7269\u7406\u5377\u9519\u8bef\uff0c\u903b\u8f91\u5377\u9519\u8bef\u548c\u5377\u7ec4\u9519\u8bef\u7684\u65f6\u5019\uff0c\u5229\u7528\u5907\u4efd\u8fdb\u884c\u6062\u590d\uff0c\u5c3d\u53ef\u80fd\u6062\u590d\u707e\u96be\u6240\u5bfc\u81f4\u7684\u6570\u636e\u635f\u5931\u3002<\/p>\n<p>\u7531\u4e8e LVM \u5c06\u6240\u6709\u78c1\u76d8\u8fdb\u884c\u7edf\u4e00\u7ba1\u7406\uff0c\u78c1\u76d8\u635f\u574f\u4f1a\u5bfc\u81f4\u6574\u4e2a\u6587\u4ef6\u7cfb\u7edf\u4e0d\u53ef\u4f7f\u7528\uff0c\u56e0\u4e3a\u81ea\u7136\u6062\u590d\u7684\u4e3b\u8981\u76ee\u6807\u662f\u5728\u707e\u96be\u53d1\u751f\u540e\u6062\u590d LVM \u7684\u53ef\u7528\u6027\uff0c\u6062\u590d\u6b63\u5e38\u78c1\u76d8\u4e0a\u7684\u53ef\u7528\u6570\u636e\u3002LVM \u672c\u8eab\u63d0\u4f9b\u4e86\u4e00\u5957\u5de5\u5177\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u8fd9\u5957\u5de5\u5177\u89e3\u51b3\u7edd\u5927\u591a\u6570\u7531\u4e8e\u786c\u4ef6\u6545\u969c\u5bfc\u81f4\u7684 LVM \u4e0d\u53ef\u7528\u7684\u95ee\u9898\uff0c\u5728\u81ea\u7136\u707e\u96be\u53d1\u751f\u540e\u5c3d\u53ef\u80fd\u6062\u590d LVM \u7684\u53ef\u7528\u6027\u3002\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u7531\u4e8e\u4eba\u4e3a\u707e\u96be\u9020\u6210 LVM \u53d1\u751f\u5377\u7ec4\u3001\u7269\u7406\u5377\u6216\u8005\u903b\u8f91\u5377\u4e0d\u4e00\u81f4\u7684\u60c5\u51b5\uff0c\u8fdb\u800c\u5bfc\u81f4\u90e8\u5206\u903b\u8f91\u5377\u3001\u751a\u81f3\u6574\u4e2a\u5377\u7ec4\u65e0\u6cd5\u8bbf\u95ee\u7684\u60c5\u51b5\uff0c\u4fee\u590d\u6b64\u7c7b\u95ee\u9898\u4e5f\u53ef\u4ee5\u901a\u8fc7\u4e0a\u8ff0\u5de5\u5177\u6765\u8fdb\u884c\u3002<\/p>\n<p class=\"ibm-ind-link ibm-back-to-top\"><a class=\"ibm-anchor-up-link\" href=\"http:\/\/www.ibm.com\/developerworks\/cn\/linux\/l-cn-pclvm-rstr\/#ibm-pcon\">\u56de\u9875\u9996<\/a><\/p>\n<h2 id=\"major3\">LVM \u7684\u707e\u96be\u6062\u590d<\/h2>\n<p>\u672c\u8282\u5c06\u7ed3\u5408\u5177\u4f53\u707e\u96be\uff0c\u6f14\u793a\u5982\u4f55\u8fdb\u884c LVM \u707e\u96be\u6062\u590d\u3002\u4e3a\u4e86\u4fbf\u4e8e\u6f14\u793a\uff0c\u6211\u4eec\u5047\u8bbe\u8bd5\u9a8c\u73af\u5883\u5982\u4e0b\uff1a\u57fa\u4e8e X86 \u67b6\u6784\u7684 PC\uff0c\u9664\u786c\u76d8\u5916\u6240\u6709\u786c\u4ef6\u5747\u80fd\u6b63\u5e38\u7a33\u5b9a\u7684\u5de5\u4f5c\uff0cPC \u4e0a\u5b89\u88c5\u4e86 2 \u5757\u78c1\u76d8 Disk-A \u548c Disk-B\u3002<\/p>\n<h3 id=\"minor3.1\">\u903b\u8f91\u5377\u635f\u574f<\/h3>\n<p>\u786c\u76d8\u7684\u903b\u8f91\u635f\u574f\u7684\u539f\u56e0\u5f80\u5f80\u662f\u591a\u79cd\u591a\u6837\u7684\uff0c\u53ef\u80fd\u662f\u8bef\u64cd\u4f5c\uff0c\u53ef\u80fd\u662f\u4e0d\u6b63\u5e38\u6389\u7535\uff0c\u4e5f\u53ef\u80fd\u662f\u75c5\u6bd2\u751a\u81f3\u6c47\u7f16\u8bed\u8a00\u7684 diskkiller \u76f4\u63a5\u9020\u6210\u3002\u4f46\u8fd9\u4e9b\u635f\u574f\u5927\u90fd\u5e76\u975e\u662f\u4e0d\u53ef\u9006\u7684\uff0c\u4e0b\u9762\u6211\u4eec\u5c31\u5c06\u5728\u5b9e\u9a8c\u7528 PC \u4e0a\u6a21\u62df\u4e00\u4e9b\u5e38\u89c1\u7684\u9519\u8bef\u5e76\u8fdb\u884c\u6062\u590d\u64cd\u4f5c\u3002<\/p>\n<p>\u5148\u6765\u770b\u770b\u5f53\u524d\u7684\u78c1\u76d8\u53ca\u6587\u4ef6\u7cfb\u7edf\u72b6\u51b5\uff1a<\/p>\n<h5 id=\"listing2\">\u6e05\u5355 2. \u68c0\u67e5\u78c1\u76d8\u53ca\u6587\u4ef6\u7cfb\u7edf\u72b6\u51b5<\/h5>\n<div class=\"codesection\">\n<pre class=\"displaycode\"> linux-c3k3:~ # pvs \r\n  PV         VG     Fmt  Attr PSize PFree \r\n  \/dev\/sdb   system lvm2 a-   2.00G 92.00M \r\n  \/dev\/sdc   system lvm2 a-   2.00G     0 \r\n\r\n linux-c3k3:~ # vgs \r\n  VG     #PV #LV #SN Attr   VSize  VFree \r\n  system   2   1   0 wz--n- 4.00G 92.00M \r\n\r\n linux-c3k3:~ # lvs -o +devices \r\n  LV    VG     Attr   LSize   Origin Snap%  Move Log Copy%  Devices        \r\n  alpha system -wi-ao   3.90G                               \/dev\/sdc(0)    \r\n  alpha system -wi-ao   3.90G                               \/dev\/sdb(0)    \r\n\r\n linux-c3k3:~ # mount |grep '\/dev\/mapper'\r\n \/dev\/mapper\/system-alpha on \/alpha type reiserfs (rw,acl,user_xattr)<\/pre>\n<\/div>\n<p>\u63a5\u7740\u6211\u4eec\u5c06\u6a21\u62df\u4e00\u4e9b\u9519\u8bef\u60c5\u51b5\uff1a<\/p>\n<p><strong>\u60c5\u51b5 1: \u6587\u4ef6\u7cfb\u7edf\u6b63\u5e38\uff0c\u786c\u76d8\u65e0\u7269\u7406\u6545\u969c\u7684\u72b6\u51b5<\/strong><\/p>\n<p>\u5728 \u8fd9\u4e4b\u524d\u6211\u4eec\u5148\u786e\u8ba4\u4e00\u4e9b\u72b6\u51b5\uff0c\u8bf7\u786e\u8ba4\u4f60\u7684 root \u5206\u533a\u4e0d\u5728 lvm \u7684\u7ba1\u7406\u8303\u56f4\u5185\uff0c\u5426\u5219\u4e00\u65e6 lvm \u7cfb\u7edf\u51fa\u73b0\u6545\u969c\uff0c\u6574\u4e2a\u7cfb\u7edf\u5c06\u65e0\u6cd5\u542f\u52a8\uff0c\u867d\u7136\u901a\u8fc7\u5149\u76d8 rescure \u6a21\u5f0f\u542f\u52a8\u53ef\u4ee5\u8fdb\u884c\u4e00\u5b9a\u7684\u64cd\u4f5c\uff0c\u4f46\u4f1a\u9020\u6210\u5f88\u591a\u4e0d\u5fc5\u8981\u7684\u9ebb\u70e6\u3002\u5982\u679c\u5728\u5e73\u65f6\u7684\u4f7f\u7528\u4e2d\u4f60\u5df2\u7ecf\u5c06 root \u5206\u533a\u7f6e\u4e8e lvm \u7ba1\u7406\u4e4b\u4e0b\uff0c\u90a3\u4e48\u8bf7\u5b9a\u671f\u5907\u4efd \/etc\/lve\/backup\/ \u4e0b\u7684\u6587\u4ef6\u7528\u4ee5\u7cfb\u7edf\u6062\u590d\uff0c\u5426\u5219\u5373\u4f7f\u786c\u76d8\u6ca1\u6709\u7269\u7406\u635f\u574f\uff0c\u800c\u53ea\u662f lvm \u903b\u8f91\u6807\u7b7e\u5bf9\u5e94\u9519\u8bef\uff0c\u4f60\u7684\u6570\u636e\u4e5f\u5f88\u6709\u53ef\u80fd\u6551\u4e0d\u56de\u6765\u4e86\u3002\u5f53\u7136\uff0c\u5373\u4f7f root \u5206\u533a\u4e0d\u5728 lvm \u7684\u7ba1\u7406\u8303\u56f4\u5185\uff0c\u5b9a\u671f\u5907\u4efd\u8be5\u76ee\u5f55\u4e5f\u662f\u4e00\u4e2a\u5f88\u597d\u7684\u4e60\u60ef<\/p>\n<h5 id=\"listing3\">\u6e05\u5355 3. \u5c1d\u8bd5\u5e94\u7528\u5b58\u5728\u903b\u8f91\u5377\u7684 pv<\/h5>\n<div class=\"codesection\">\n<pre class=\"displaycode\"> linux-c3k3:~ # pvcreate -ff \/dev\/sdb \r\n Really INITIALIZE physical volume \"\/dev\/sdb\" of volume group \"system\" [y\/n]? y \r\n  Can't open \/dev\/sdb exclusively.  Mounted filesystem?<\/pre>\n<\/div>\n<p>\u53ef\u4ee5\u770b\u5230 pvcreate \u62d2\u7edd\u5bf9\u90a3\u4e9b\u4e0a\u9762\u6709\u903b\u8f91\u5377\u7684 pv\uff0c\u5982\u679c\u8981\u6267\u884c\u8be5\u64cd\u4f5c\u7684\u8bdd\u9700\u8981\u628a\u4e0a\u9762\u7684\u903b\u8f91\u5377\u5220\u9664\uff0c\u8be5\u547d\u4ee4\u540e\u9762\u5c06\u4f1a\u7528\u5230\u3002<\/p>\n<p>\u73b0\u5728\u6211\u4eec\u7528 dd \u547d\u4ee4\u64e6\u9664 sdb \u5bf9\u5e94 lvm2 \u7684\u6807\u7b7e\u4f46\u4fdd\u7559\u5206\u533a\u8868\uff08\u64cd\u4f5c\u6709\u4e00\u5b9a\u98ce\u9669\uff0c\u8bf7\u8c28\u614e\u5c1d\u8bd5\uff09<\/p>\n<h5 id=\"listing4\">\u6e05\u5355 4. \u64e6\u9664 lvm2 \u5bf9\u5e94\u6807\u7b7e\u5e76\u67e5\u770b\u72b6\u6001<\/h5>\n<div class=\"codesection\">\n<pre class=\"displaycode\"> linux-c3k3:~ # dd if=\/dev\/zero of=\/dev\/sdb bs=512 count=1 seek=1 \r\n 1+0 records in \r\n 1+0 records out \r\n 512 bytes (512 B) copied, 9.8e-05 seconds, 5.2 MB\/s \r\n\r\n linux-c3k3:~ # pvs --partial \r\n  Partial mode. Incomplete volume groups will be activated read-only. \r\n  Couldn't find device with uuid '7m0QBR-3kNP-J0fq-GwAq-iv6u-LQkF-yhJh5R'. \r\n  Couldn't find device with uuid '7m0QBR-3kNP-J0fq-GwAq-iv6u-LQkF-yhJh5R'. \r\n  Couldn't find device with uuid '7m0QBR-3kNP-J0fq-GwAq-iv6u-LQkF-yhJh5R'. \r\n ...... \r\n  PV             VG     Fmt  Attr PSize PFree \r\n  \/dev\/sdc       system lvm2 a-   2.00G     0 \r\n  unknown device system lvm2 a-   2.00G 92.00M \r\n\r\n linux-c3k3:~ # vgs --partial \r\n  Partial mode. Incomplete volume groups will be activated read-only. \r\n  Couldn't find device with uuid '7m0QBR-3kNP-J0fq-GwAq-iv6u-LQkF-yhJh5R'. \r\n ...... \r\n  VG     #PV #LV #SN Attr   VSize  VFree \r\n  system   2   1   0 rz-pn- 4.00G 92.00M \r\n\r\n linux-c3k3:~ # lvs --partial \r\n  Partial mode. Incomplete volume groups will be activated read-only. \r\n  Couldn't find device with uuid '7m0QBR-3kNP-J0fq-GwAq-iv6u-LQkF-yhJh5R'. \r\n ...... \r\n  LV    VG     Attr   LSize   Origin Snap%  Move Log Copy% \r\n  alpha system -wi-ao   3.90G<\/pre>\n<\/div>\n<p>\u4ece\u4e0a\u9762\u7684\u60c5\u51b5\u6211\u4eec\u4e0d\u96be\u770b\u51fa sdb \u5df2\u7ecf\u53d8\u6210\u4e86\u672a\u77e5\u8bbe\u5907\uff0c\u5377\u7ec4\u7684 metadata \u53d8\u6210\u53ea\u8bfb\u7684\u4e86\uff0c\u4e14\u662f partial \u7684\u72b6\u6001\uff0c\u4f46 lv \u7684\u60c5\u51b5\u8fd8\u662f\u57fa\u672c\u6b63\u5e38\u7684\u3002<\/p>\n<p>\u5176\u5b9e\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8fd8\u662f\u53ef\u4ee5\u6302\u8f7d\u3001\u8bbf\u95ee\u6545\u969c\u7684\u6587\u4ef6\u7cfb\u7edf\u7684\uff0c\u6bd5\u7adf\u5206\u533a\u8868\u672c\u8eab\u5e76\u6ca1\u6709\u635f\u574f\u3002\u4e8e\u662f\u6211\u4eec\u9996\u5148\u8981\u505a\u7684\u65e0\u7591\u662f\u5907\u4efd\uff08\u6700\u597d\u4ee5\u53ea\u8bfb\u65b9\u5f0f\u6302\u8f7d\uff09<\/p>\n<h5 id=\"listing5\">\u6e05\u5355 5. \u4ee5\u53ea\u8bfb\u65b9\u5f0f\u6302\u8f7d\u5e76\u5907\u4efd<\/h5>\n<div class=\"codesection\">\n<pre class=\"displaycode\"> linux-c3k3:~ # mount -o remount -o ro \/alpha<\/pre>\n<\/div>\n<p>\uff08\u5907\u4efd\u64cd\u4f5c\u7565\uff09<\/p>\n<p>\u4e0b\u9762\u6211\u4eec\u6765\u5c1d\u8bd5\u4fee\u590d<\/p>\n<h5 id=\"listing6\">\u6e05\u5355 6. \u4fee\u590d\u64cd\u4f5c<\/h5>\n<div class=\"codesection\">\n<pre class=\"displaycode\"> * \u5982\u679c\u51fa\u73b0 Can't open \/dev\/sdb exclusively.  Mounted filesystem? \u7684\u60c5\u51b5\u8bf7\u5148 deactive \u4f60\u7684 vg \r\n linux-c3k3: ~ # pvcreate -ff --uuid 7m0QBR-3kNP-J0fq-GwAq-iv6u-LQkF-yhJh5R \\n \r\n --restorefile \/etc\/lvm\/backup\/system  \/dev\/sdb \r\n Couldn't find device with uuid '7m0QBR-3kNP-J0fq-GwAq-iv6u-LQkF-yhJh5R '. \r\n Physical volume \"\/dev\/sbd\" successfully created \r\n linux-c3k3:~ # pvs \r\n  PV         VG     Fmt  Attr PSize PFree \r\n  \/dev\/sdb   system lvm2 a-   2.00G 92.00M \r\n \/dev\/sdc   system lvm2 a-   2.00G     0 \r\n * \u6062\u590d\u6210\u529f\uff0c\u7136\u540e\u6211\u4eec\u7ee7\u7eed\u5bf9\u5377\u7ec4\u8fdb\u884c\u6062\u590d\r\n linux-c3k3: ~ # vgcfgrestore -f \/etc\/lvm\/backup\/system system \r\n Restored volume system \r\n * \u5377\u7ec4\u5b8c\u6210\u6062\u590d\uff0c\u7136\u540e\u6fc0\u6d3b\u540e\u67e5\u770b\r\n linux-c3k3: ~ #vgchange \u2013 ay system \r\n 1 logical volume(s) in volume group \"system\" now active<\/pre>\n<\/div>\n<p>\u5230\u6b64\u5904\u4e3a\u6b62\uff0c\u4f60\u4f1a\u53d1\u73b0\uff0c\u4e00\u5207\u6b63\u5e38\u4e86\uff0c\u6570\u636e\u4e5f\u6ca1\u6709\u4efb\u4f55\u7684\u635f\u5931\uff0c\u4f46\u4e3a\u4e86\u4fdd\u9669\u8d77\u89c1\u8fd8\u662f\u5e94\u8be5\u5c1d\u8bd5\u8fdb\u884c\u4e00\u4e0b\u6587\u4ef6\u7cfb\u7edf\u626b\u63cf\u4ee5\u786e\u4fdd\u4e07\u65e0\u4e00\u5931\u3002<\/p>\n<p>\u56de\u5934\u770b\u6211\u4eec\u524d\u9762\u63d0\u5230\u7684\u5982\u679c root \u5206\u533a\u5728 lvm \u7ba1\u7406\u4e0b\u7684\u60c5\u51b5\uff0c\u4f1a\u51fa\u73b0\u7cfb\u7edf\u65e0\u6cd5\u542f\u52a8\u7684\u60c5\u51b5\uff0c\u8fd9\u65f6\u5019\u600e\u4e48\u529e\u5462\uff1f<\/p>\n<p>\u5176 \u5b9e\u4e5f\u4e0d\u662f\u65e0\u6cd5\u89e3\u51b3\u7684\uff0c\u662f\u7528\u64cd\u4f5c\u7cfb\u7edf\u76d8\u5f15\u5bfc\uff0c\u8fdb\u5165 Rescure \u6a21\u5f0f\uff0c\u5229\u7528\u4f60\u4e4b\u524d\u5907\u4efd\u7684 \/etc\/lve\/backup\/ \u4e0b\u7684\u6587\u4ef6\u8fdb\u884c\u6062\u590d\u5373\u53ef\uff0c\u5982\u679c\u4f60\u9700\u8981\u5148\u542f\u52a8\u8d77\u539f\u672c\u7684\u7cfb\u7edf\u4ee5\u53d6\u51fa\u5907\u4efd\u6587\u4ef6\uff0c\u53ef\u4ee5\u4f7f\u7528 vgreduce \u2013 removemissing system \u547d\u4ee4\u53bb\u6389\u4e22\u5931\u6807\u7b7e\u7684\u7269\u7406\u78c1\u76d8\u518d\u542f\u52a8\uff0c\u800c\u540e\u5229\u7528\u5907\u4efd\u6587\u4ef6\u6267\u884c\u6062\u590d\u64cd\u4f5c\uff0c\u4f46\u662f\u6bcf\u6b21\u6b63\u5e38\u7684 lvm \u542f\u52a8\u90fd\u4f1a\u66f4\u6539 \/etc\/lve\/backup\/ \u4e0b\u7684\u5185\u5bb9\uff0c\u8fd9\u4e5f\u662f\u4e3a\u4ec0\u4e48\u6211\u4eec\u9700\u8981\u5bf9\u5176\u5185\u5bb9\u8fdb\u884c\u5907\u4efd\u7684\u539f\u56e0\u3002\u5982\u679c\u5f88\u4e0d\u5e78\u7684\u4f60\u6ca1\u6709\u5907\u4efd \/etc\/lve\/backup\/ \u4e0b\u7684\u5185\u5bb9\uff0c\u4e14 root \u5206\u533a\u5728 lvm \u7ba1\u7406\u4e0b\u7684\u60c5\u51b5\uff0c\u90a3\u4e48\u5f88\u9057\u61be\uff0c\u5373\u4f7f\u4f60\u7684\u786c\u76d8\u6ca1\u6709\u7269\u7406\u635f\u6bc1\uff0c\u4f60\u7684\u6570\u636e\u4e5f\u5f88\u96be\u6551\u56de\u4e86\uff0c\u9488\u5bf9\u8fd9\u79cd\u60c5\u51b5\u5411\u7cfb\u7edf\u7684\u6062\u590d\u65b9\u6cd5\uff0c\u8bf7\u53c2\u7167 3.4 \u78c1\u76d8\u635f\u574f \u90e8\u5206\u8fdb\u884c\u64cd\u4f5c\u3002<\/p>\n<p><strong>\u60c5\u51b5 2\uff1aPV \u7684\u635f\u574f\u4e0e\u66ff\u6362<\/strong><\/p>\n<p>\u5148\u770b\u4e00\u4e0b\u7cfb\u7edf\u7684\u60c5\u51b5<\/p>\n<h5 id=\"listing7\">\u6e05\u5355 7. \u68c0\u67e5\u78c1\u76d8\u53ca\u6587\u4ef6\u7cfb\u7edf\u72b6\u51b5<\/h5>\n<div class=\"codesection\">\n<pre class=\"displaycode\"> (none):\/test # pvs \r\n  PV         VG     Fmt  Attr PSize PFree \r\n  \/dev\/sda2  system lvm2 a-   7.93G    0 \r\n  \/dev\/sdb   test   lvm2 a-   2.00G    0 \r\n  \/dev\/sdc   test   lvm2 a-   2.00G    0 \r\n  \/dev\/sdd          lvm2 --   2.00G 2.00G \r\n (none):\/test # vgs \r\n  VG     #PV #LV #SN Attr   VSize VFree \r\n  system   1   2   0 wz--n- 7.93G    0 \r\n  test     2   1   0 wz--n- 3.99G    0 \r\n (none):\/test # lvs \r\n  LV   VG     Attr   LSize   Origin Snap%  Move Log Copy% \r\n  root system -wi-ao   7.38G                              \r\n  swap system -wi-ao 560.00M                              \r\n  lv0  test   -wi-ao   3.99G       \r\n (none):\/test # (none):\/ # mount \/dev\/test\/lv0 \/test\/ \r\n (none):\/ # ls \/test \r\n doc.txt \r\n (none):\/ # umount \/test<\/pre>\n<\/div>\n<p>\u6211\u4eec\u5728 lv0 \u4e0b\u5b58\u50a8\u4e86\u4e00\u4e2a\u6587\u4ef6<\/p>\n<p>\u5907\u4efd\u4e00\u4e0b \/etc\/lvm\/backup \u7684\u6587\u4ef6<\/p>\n<h5 id=\"listing8\">\u6e05\u5355 8. \u5907\u4efd Lvm \u4fe1\u606f<\/h5>\n<div class=\"codesection\">\n<pre class=\"displaycode\"> (none):\/etc\/lvm\/backup # cp * \/testback\/<\/pre>\n<\/div>\n<p>\u6211\u4eec\u7528 dd \u547d\u4ee4\u628a \/dev\/sdc \u7684\u524d 400 \u4e2a\u6247\u533a\u90fd\u6e05\u96f6\uff08\u5305\u62ec LVM2 label\u3001meta data\u3001\u5206\u533a\u8868\u7b49\uff09<\/p>\n<h5 id=\"listing9\">\u6e05\u5355 9. \u5e94\u7528 dd \u6a21\u62df\u6545\u969c\u72b6\u6001<\/h5>\n<div class=\"codesection\">\n<pre class=\"displaycode\"> (none):\/ # dd if=\/dev\/zero of=\/dev\/sdc bs=512 count=400 \r\n 400+0 records in \r\n 400+0 records out \r\n 204800 bytes (205 kB) copied, 0.046619 seconds, 4.4 MB\/s \r\n (none):\/ # pvs --partial \r\n  Partial mode. Incomplete volume groups will be activated read-only. \r\n  Couldn't find device with uuid 'noOzjf-8bk2-HJhC-92fl-2f6Q-DzNZ-XBqnBO'. \r\n  Couldn't find device with uuid 'noOzjf-8bk2-HJhC-92fl-2f6Q-DzNZ-XBqnBO'. \r\n  Couldn't find device with uuid 'noOzjf-8bk2-HJhC-92fl-2f6Q-DzNZ-XBqnBO'. \r\n  Couldn't find device with uuid 'noOzjf-8bk2-HJhC-92fl-2f6Q-DzNZ-XBqnBO'. \r\n  Couldn't find device with uuid 'noOzjf-8bk2-HJhC-92fl-2f6Q-DzNZ-XBqnBO'. \r\n  Couldn't find device with uuid 'noOzjf-8bk2-HJhC-92fl-2f6Q-DzNZ-XBqnBO'. \r\n  PV             VG     Fmt  Attr PSize PFree \r\n  \/dev\/sda2      system lvm2 a-   7.93G    0 \r\n  \/dev\/sdb       test   lvm2 a-   2.00G    0 \r\n  \/dev\/sdd              lvm2 --   2.00G 2.00G \r\n  unknown device test   lvm2 a-   2.00G    0<\/pre>\n<\/div>\n<p>\u8fd9\u79cd\u60c5\u51b5\u4e0b\u60f3\u8981\u5b8c\u5168\u6062\u590d\u53ef\u80fd\u6bd4\u8f83\u56f0\u96be\u4e86\uff0c\u5982\u679c\u65e0\u610f\u627e\u56de\u8fd8\u53ef\u80fd\u5b58\u5728\u7684\u6570\u636e\uff0c\u8bf7\u53c2\u7167 3.4 \u78c1\u76d8\u635f\u574f \u90e8\u5206\u8fdb\u884c\u64cd\u4f5c\u3002\u5982\u60f3\u5c3d\u53ef\u80fd\u591a\u7684\u627e\u56de\u6570\u636e\uff0c\u8bf7\u5148\u5c1d\u8bd5 mount\uff0c<\/p>\n<h5 id=\"listing10\">\u6e05\u5355 10. \u5c1d\u8bd5 mount \u635f\u574f\u5206\u533a<\/h5>\n<div class=\"codesection\">\n<pre class=\"displaycode\"> (none):~ # mount \/dev\/test\/lv0 \/test \r\n mount: you must specify the filesystem type<\/pre>\n<\/div>\n<p>\u6587\u4ef6\u7cfb\u7edf\u5df2\u7ecf\u635f\u574f .<\/p>\n<p>\u8fd9\u91cc\u6211\u4eec\u5c1d\u8bd5\u8fdb\u884c\u66ff\u6362\uff0c\u4ee5 sdd \u66ff\u6362 sdc<\/p>\n<h5 id=\"listing11\">\u6e05\u5355 11. \u6545\u969c\u5377\u7684\u66ff\u6362<\/h5>\n<div class=\"codesection\">\n<pre class=\"displaycode\"> (none):\/ # pvcreate --restorefile \/etc\/lvm\/backup\/test \\n \r\n --uuid noOzjf-8bk2-HJhC-92fl-2f6Q-DzNZ-XBqnBO \/dev\/sdd \r\n  Couldn't find device with uuid 'noOzjf-8bk2-HJhC-92fl-2f6Q-DzNZ-XBqnBO'. \r\n  Physical volume \"\/dev\/sdd\" successfully created. \r\n (none):\/ # pvs -v \r\n    Scanning for physical volume names \r\n    Wiping cache of LVM-capable devices \r\n  PV         VG     Fmt  Attr PSize PFree DevSize PV UUID                               \r\n  \/dev\/sda2  system lvm2 a-   7.93G    0    7.93G HsErSz-vuAD-rEe1-wE5m-Mnvr-T0Re-EwO7rD \r\n  \/dev\/sdb   test   lvm2 a-   2.00G    0    2.00G OBb3qb-TW97-hKZ7-vmsr-RZ2v-fzuP-qK3wmN \r\n  \/dev\/sdd   test   lvm2 a-   2.00G    0    2.00G noOzjf-8bk2-HJhC-92fl-2f6Q-DzNZ-XBqnBO<\/pre>\n<\/div>\n<p>\u6211\u4eec\u53ef\u4ee5\u770b\u5230 sdd \u5df2\u7ecf\u66ff\u6362\u4e86 sdc<\/p>\n<p>\u4e0d\u8fc7\u8fd9\u65f6\u5019 \/etc\/lvm\/backup \u4e0b\u7684\u6587\u4ef6\u5e76\u4e0d\u4f1a\u66f4\u65b0\uff0c\u540c\u65f6\u4f1a\u770b\u5230\u5982\u4e0b\u7684\u60c5\u51b5<\/p>\n<h5 id=\"listing12\">\u6e05\u5355 12. \u540c\u6b65 metadata<\/h5>\n<div class=\"codesection\">\n<pre class=\"displaycode\"> (none):\/ # vgchange -an test \r\n  Volume group test metadata is inconsistent \r\n  Volume group for uuid not found: \r\n     tcyuXvjcxCN7912qAJlEYzphncdWabTJ21OTTrG6DrMS8dPF5Wlh04GOHyO5ClbY \r\n  1 logical volume(s) in volume group \"test\" now active \r\n * \u5373\u62a5\u544a vg \u7684 metadata \u4e0d\u4e00\u81f4\r\n * \u91cd\u65b0\u542f\u52a8\u7cfb\u7edf\r\n (none):~ # vgchange -an test \r\n  0 logical volume(s) in volume group \"test\" now active \r\n (none):~ # vgchange -ay test \r\n  1 logical volume(s) in volume group \"test\" now active<\/pre>\n<\/div>\n<p>\u5df2\u4e0d\u5b58\u5728\u8be5\u95ee\u9898\uff0c\u8fd9\u65f6\u5019 \/etc\/lvm\/backup \u4e5f\u5df2\u7ecf\u66f4\u65b0\u4e86\u3002<\/p>\n<p>\u4e4b\u540e\u5c1d\u8bd5 mount<\/p>\n<h5 id=\"listing13\">\u6e05\u5355 13. \u91cd\u65b0\u6302\u8f7d<\/h5>\n<div class=\"codesection\">\n<pre class=\"displaycode\"> (none):~ # mount \/dev\/test\/lv0 \/test \r\n mount: you must specify the filesystem type<\/pre>\n<\/div>\n<p>\u6211\u4eec\u5f00\u59cb\u5c1d\u8bd5\u4fee\u590d\u6587\u4ef6\u7cfb\u7edf<\/p>\n<p>\u7ecf\u8fc7<\/p>\n<div class=\"codesection\">\n<pre class=\"displaycode\"> reiserfsck \/dev\/test\/lv0 --check \r\n reiserfsck \/dev\/test\/lv0 --rebuild-sb \r\n reiserfsck \/dev\/test\/lv0 --check \r\n reiserfsck \/dev\/test\/lv0 --rebuild-tree \r\n reiserfsck \/dev\/test\/lv0 - \u2013 check<\/pre>\n<\/div>\n<p>\u547d\u4ee4\u4e4b\u540e\uff08\u5b9e\u9645\u9700\u8981\u6267\u884c\u7684\u60c5\u51b5\u4f9d\u636e\u786c\u76d8\u53d7\u635f\u60c5\u51b5\u53ef\u80fd\u6709\u6240\u4e0d\u540c\uff09<\/p>\n<h5 id=\"listing14\">\u6e05\u5355 14. \u67e5\u770b\u4fee\u590d\u540e\u7684\u72b6\u6001<\/h5>\n<div class=\"codesection\">\n<pre class=\"displaycode\"> (none):~ # mount \/dev\/test\/lv0 \/test \r\n (none):~ # cd \/test \r\n (none):\/test # ls \r\n doc.txt  .doc.txt.swp  lost+found \r\n (none):\/test #<\/pre>\n<\/div>\n<p>\u5f88\u5e78\u8fd0\uff0c\u6211\u4eec\u7684\u6587\u4ef6\u8fd8\u5728\u3002<\/p>\n<h3 id=\"minor3.2\">\u78c1\u76d8\u574f\u9053<\/h3>\n<p>\u786c \u76d8\u957f\u65f6\u95f4\u7684\u4f7f\u7528\uff0c\u975e\u6b63\u5e38\u64cd\u4f5c\u6216\u7535\u6e90\u7ba1\u7406\u5931\u8bef\u90fd\u53ef\u80fd\u9020\u6210\u78c1\u76d8\u574f\u9053\u7684\u4ea7\u751f\u3002\u6700\u5178\u578b\u7684\u75c7\u72b6\u5c31\u662f\u4e00\u65e6\u5bf9\u786c\u76d8\u7684\u67d0\u4e00\u90e8\u5206\u8fdb\u884c\u64cd\u4f5c\uff0c\u5c31\u4f1a\u51fa\u73b0\u6574\u4e2a\u786c\u76d8\u505c\u6b62\u5de5\u4f5c\uff0c\u5982\u679c\u64cd \u4f5c\u7cfb\u7edf\u4e5f\u5728\u8be5\u786c\u76d8\u4e0a\uff0c\u90a3\u4e48\u7cfb\u7edf\u7acb\u5373\u5d29\u6e83\u4e5f\u5c31\u6210\u4e3a\u4e86\u5fc5\u7136\u3002\u8fd9\u8fd8\u4e0d\u662f\u6700\u53ef\u6015\u7684\uff0c\u56e0\u4e3a\u574f\u9053\u4e00\u65e6\u4ea7\u751f\u5c31\u6709\u6269\u6563\u7684\u53ef\u80fd\uff0c\u6bcf\u6b21\u89e6\u53ca\uff0c\u5bfc\u81f4\u7684 crash \u90fd\u6bd4\u4e00\u6b21\u7cfb\u7edf\u975e\u6b63\u5e38\u6389\u7535\u9020\u6210\u7684\u4f24\u5bb3\u66f4\u4e3a\u4e25\u91cd\uff0c\u9664\u4e86\u574f\u9053\u7684\u6269\u6563\u5916\u8fd8\u5f88\u6709\u53ef\u80fd\u7834\u574f\u6574\u5757\u786c\u76d8\u7684\u52a8\u5e73\u8861\uff0c\u4ece\u800c\u5bfc\u81f4\u6574\u4e2a\u786c\u76d8\u4e0d\u53ef\u6062\u590d\u7684\u7269\u7406\u6027\u635f\u574f\u3002\u53ef\u89c1\uff0c\u53ca\u65f6\u53d1\u73b0\u786c \u76d8\u574f\u9053\uff0c\u5e76\u5c3d\u65e9\u5904\u7406\u662f\u5341\u5206\u5fc5\u8981\u7684\u3002<\/p>\n<p>LVM \u81ea\u5df1\u672c\u8eab\u5176\u5b9e\u6709\u4e00\u5957\u5bf9\u574f\u9053\u7684\u5904\u7406\u673a\u5236\uff1a<\/p>\n<ol type=\"1\">\n<li>\u786c\u76d8\u5185\u90e8\u7684\u6570\u636e\u91cd\u5b9a\u4f4d\uff1a\u6700\u5e95\u5c42\u7684\u91cd\u5b9a\u4f4d\uff0c\u53d1\u751f\u5728\u78c1\u76d8\u5185\u90e8\uff0c\u51fa\u73b0\u7684\u65f6\u5019\u4e0d\u4f1a\u901a\u77e5\u7528\u6237\u3002<\/li>\n<li>\u7531 LVM \u4ea7\u751f\u7684\u786c\u4ef6\u91cd\u5b9a\u4f4d\uff1a\u66f4\u9ad8\u5c42\u6b21\u7684\u91cd\u5b9a\u4f4d\uff0cLVM \u5c06\u6709\u95ee\u9898\u7684\u7269\u7406\u5730\u5740 A \u4e0a\u7684\u6570\u636e\u62f7\u8d1d\u5230\u7269\u7406\u5730\u5740 B\uff0cLVM \u4f1a\u7ee7\u7eed\u8bfb\u5730\u5740 A \u4e0a\u7684\u6570\u636e\uff0c\u4f46\u662f\u786c\u76d8\u5df2\u7ecf\u5c06\u771f\u5b9e\u7684 IO \u8f6c\u5411\u7269\u7406\u5730\u5740 B\u3002<\/li>\n<li>\u8f6f\u4ef6\u91cd\u5b9a\u4f4d\uff1a\u6700\u9ad8\u5c42\u6b21\u7684\u91cd\u5b9a\u4f4d\uff0c\u4e5f\u7531 LVM \u8bbe\u5907\u4ea7\u751f\u3002LVM \u751f\u6210\u4e00\u4e2a\u574f\u9053\u8868\uff0c\u5f53\u8bfb\u7269\u7406\u5730\u5740 A \u4e0a\u7684\u6570\u636e\u65f6\uff0c\u5148\u68c0\u67e5\u574f\u9053\u8868\uff0c\u5982\u679c A \u5728\u574f\u9053\u8868\u4e2d\uff0c\u5c31\u8f6c\u5411\u7269\u7406\u5730\u5740 B\u3002<\/li>\n<\/ol>\n<p>\u4f46 \u4ee5\u4e0a\u8fd9\u4e9b\uff0c\u5176\u5b9e\u5bf9\u7528\u6237\u90fd\u662f\u900f\u660e\u7684\uff0c\u7528\u6237\u53ef\u4ee5\u5728\u521b\u5efa lv \u65f6\u901a\u8fc7 lvcreate \u2013 r n \u53c2\u6570\u5173\u95ed\u8fd9\u6837\uff0c\u7cfb\u7edf\u5c06\u4e0d\u521b\u5efa\u574f\u5757\u91cd\u5b9a\u4f4d\u533a\u57df\uff08BBRA)\uff0c\u5f15\u5bfc\u3001\u6839\u548c\u4e3b\u4ea4\u6362\u903b\u8f91\u5377\u5fc5\u987b\u4f7f\u7528\u6b64\u53c2\u6570\u3002\u5f53\u7528\u6237\u89c9\u5f97 LVM \u6709\u95ee\u9898\u7684\u65f6\u5019\uff0c\u9996\u5148\u8981\u505a\u7684\u4e8b\u60c5\u5c31\u662f\u5907\u4efd\uff0c\u5c3d\u53ef\u80fd\u5730\u4fdd\u5b58\u5377\u7ec4\u4e2d\u7684\u6570\u636e\u3002\u5377\u7ec4\u53d1\u751f\u95ee\u9898\u540e\u8fdb\u884c\u7684\u5907\u4efd\u9700\u8981\u548c\u53d1\u751f\u95ee\u9898\u524d\u8fdb\u884c\u7684\u5907\u4efd\u8fdb\u884c\u5bf9\u6bd4\u3002\u9488\u5bf9\u5b58\u5728\u574f\u9053\u7684\u60c5 \u51b5\uff0cfsck \u4e00\u5b9a\u8981\u614e\u7528\uff0c\u5c24\u5176\u5bf9\u4e8e\u91cd\u5b9a\u4f4d\u5df2\u7ecf\u65e0\u6cd5\u5904\u7406\u7684\u5e94\u5c3d\u5feb\u5c06\u786c\u76d8\u5bfc\u51fa\uff08\u64cd\u4f5c\u89c1 3.3 \u78c1\u76d8\u4f4d\u7f6e\u66f4\u6539\u90e8\u5206\uff09LVM \u4ee5\u9632\u574f\u9053\u6269\u6563\uff0c\u5982\u5728\u5bfc\u51fa\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u95ee\u9898\uff0c\u8bf7\u6bd4\u7167 3.4 \u78c1\u76d8\u635f\u574f\u5904\u7406\u3002<\/p>\n<h3 id=\"minor3.3\">\u78c1\u76d8\u4f4d\u7f6e\u66f4\u6539<\/h3>\n<p>\u4e3b\u677f\u7aef\u53e3\u635f\u574f\u3001\u66f4\u6b22 PC \u4e3b\u677f\u3001\u6dfb\u52a0\u65b0\u7684\u8bbe\u5907\u90fd\u53ef\u80fd\u5bfc\u81f4\u78c1\u76d8\u4f4d\u7f6e\u66f4\u6539\u7684\u53d1\u751f\u3002\u7531\u4e8e Linux \u7684\u4e3b\u5f15\u5bfc\u8bb0\u5f55\uff08MBR\uff09\u4e00\u822c\u8bb0\u5f55\u5728\u7b2c\u4e00\u5757\u78c1\u76d8\u7684\u7b2c\u4e00\u4e2a\u6247\u533a\u4e0a\uff0c\u5982\u679c\u7b2c\u4e00\u5757\u78c1\u76d8\u7684\u987a\u5e8f\u53d1\u751f\u6539\u53d8\uff0c\u4f1a\u5bfc\u81f4\u7cfb\u7edf\u65e0\u6cd5\u542f\u52a8\u3002\u5bf9\u4e8e\u8fd9\u79cd\u60c5\u51b5\uff0c\u53ea\u9700\u8981\u8c03\u6574\u78c1\u76d8\u987a\u5e8f\u5c31\u53ef \u4ee5\u89e3\u51b3\uff08\u53ea\u9700\u8981\u4fdd\u8bc1\u6709 MBR \u7684\u78c1\u76d8\u6392\u5728\u7b2c\u4e00\u987a\u4f4d\u5c31\u53ef\u4ee5\uff0c\u4e0d\u4e00\u5b9a\u662f\u603b\u7ebf\u7684\u7b2c\u4e00\u4e2a\u7aef\u53e3\uff09\u3002\u8fd9\u91cc\u8ba8\u8bba\u4e24\u79cd\u6bd4\u8f83\u5e38\u89c1\u7684\u60c5\u51b5\uff0c\u78c1\u76d8\u5728\u7cfb\u7edf\u5185\u4f4d\u7f6e\u66f4\u6539\u548c\u78c1\u76d8\u5728\u7cfb\u7edf\u95f4\u79fb\u52a8\u3002<\/p>\n<p><strong>\u78c1\u76d8\u5728\u7cfb\u7edf\u5185\u79fb\u52a8<\/strong><\/p>\n<p>\u5bf9\u4e8e\u5355\u4e00\u5377\u7ec4\u7684 LVM \u6587\u4ef6\u7cfb\u7edf\u800c\u8a00\uff0cLVM \u80fd\u591f\u81ea\u52a8\u8bc6\u522b\u51fa\u78c1\u76d8\u4f4d\u7f6e\u7684\u66f4\u6539\u3002\u78c1\u76d8\u4f4d\u7f6e\u66f4\u6539\u540e\uff0c\u6b63\u5e38\u542f\u52a8\u7cfb\u7edf\u5c31\u53ef\u4ee5\u6b63\u5e38\u8bbf\u95ee\u4e86\u3002\u5f53\u7cfb\u7edf\u4e2d\u5b58\u5728\u5355\u72ec\u7684\u5377\u7ec4\uff0c\u6216\u8005\u7cfb\u7edf\u4e2d\u5b58\u5728\u591a\u4e2a\u5377\u7ec4\u662f\uff0c\u66f4\u6539\u78c1\u76d8\u4f4d\u7f6e\u524d\u9700\u8981\u505c\u7528\u5377\u7ec4\uff0c\u5728\u5b8c\u6210\u78c1\u76d8\u79fb\u52a8\u540e\u9700\u8981\u91cd\u65b0\u6fc0\u6d3b\u5377\u7ec4\uff0c\u6267\u884c\u64cd\u4f5c\u5982\u4e0b\uff1a<\/p>\n<h5 id=\"listing15\">\u6e05\u5355 15. \u91cd\u65b0\u6fc0\u6d3b\u5377\u7ec4<\/h5>\n<div class=\"codesection\">\n<pre class=\"displaycode\">* \u505c\u7528\u5377\u7ec4\uff1a\r\n Linux:~# vgchange \u2013 a n \/dev\/system \r\n\t 0 logical volume(s) in volume group \u201csystem\u201d now active \r\n Linux:~#lvscan \r\n\t Inactive \t\t'\/dev\/system\/test'[1.90 GB] inherit \r\n\r\n * \u6fc0\u6d3b\u5377\u7ec4\uff1a\r\n Linux:~# vgchange \u2013 a n \/dev\/system \r\n\t 1 logical volume(s) in volume group \u201csystem\u201d now active \r\n Linux:~#lvscan \r\n\t ACTIVE \t'\/dev\/system\/test'[1.90 GB] inherit<\/pre>\n<\/div>\n<p><strong>\u78c1\u76d8\u5728\u7cfb\u7edf\u95f4\u79fb\u52a8<\/strong><\/p>\n<p>\u5f53\u78c1\u76d8\u5728\u7cfb\u7edf\u95f4\u79fb\u52a8\u7684\u65f6\u5019\uff0c\u9664\u4e86\u9700\u8981\u505c\u7528\u6fc0\u6d3b\u5377\u7ec4\u5916\uff0c\u8fd8\u9700\u8981\u6267\u884c\u5377\u7ec4\u5bfc\u51fa \/ \u5012\u5165\u7684\u64cd\u4f5c\u3002<\/p>\n<h5 id=\"listing16\">\u6e05\u5355 16. \u5bfc\u51fa\u5377\u7ec4<\/h5>\n<div class=\"codesection\">\n<pre class=\"displaycode\"> * \u505c\u7528\u5377\u7ec4\uff1a\r\n Linux:~# vgchange \u2013 a n \/dev\/system \r\n\t 0 logical volume(s) in volume group \u201csystem\u201d now active \r\n * \u5bfc\u51fa\u5377\u7ec4\r\n Linux:~# vgexport \/dev\/system \r\n Volume group \u201csystem\u201d successfully exported<\/pre>\n<\/div>\n<p>\u6b64\u65f6\u5c31\u53ef\u4ee5\u5c06\u78c1\u76d8\u79fb\u52a8\u5230\u5176\u4ed6\u7cfb\u7edf\u3002<\/p>\n<h5 id=\"listing17\">\u6e05\u5355 17. \u5bfc\u5165\u5e76\u6fc0\u6d3b\u5377\u7ec4<\/h5>\n<div class=\"codesection\">\n<pre class=\"displaycode\"> * \u626b\u63cf PV \r\n Linux:~# pvscan \r\n PV \/dev\/sdc \t is in exported VG system [2.00 GB \/ 96.00 MB free] \r\n Total: 1 [2.00 GB] \/ in use: 1 [2.00 GB] \/ in no VG: 0[0  ] \r\n * \u5bfc\u5165 VG \r\n Linux:~# vgimport \/dev\/system \r\n Volume group \u201csystem\u201d successfully imported \r\n * \u6fc0\u6d3b\u5377\u7ec4\r\n Linux:~# vgchange \u2013 a n \/dev\/system \r\n\t 1 logical volume(s) in volume group \u201csystem\u201d now active<\/pre>\n<\/div>\n<p>\u5230\u6b64\uff0c\u5377\u7ec4\u5c31\u53ef\u4ee5\u6062\u590d\u6b63\u5e38\u4e86\u3002\u67d0\u4e9b\u5377\u7ec4\u53ef\u80fd\u662f\u8de8\u591a\u5757\u78c1\u76d8\u5efa\u7acb\u7684\uff0c\u800c\u78c1\u76d8\u79fb\u52a8\u53ef\u80fd\u53ea\u662f\u9488\u5bf9\u5176\u4e2d\u7684\u67d0\u4e9b\u78c1\u76d8\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u53ef\u4ee5\u6267\u884c pvmove \u547d\u4ee4\uff0c\u628a\u6570\u636e\u79fb\u52a8\u5230\u6307\u5b9a\u78c1\u76d8\u4e0a\uff0c\u7136\u540e\u9488\u5bf9<\/p>\n<p>\u6307\u5b9a\u78c1\u76d8\u6267\u884c\u79fb\u52a8\u64cd\u4f5c\u3002<\/p>\n<h3 id=\"minor3.4\">\u78c1\u76d8\u635f\u574f<\/h3>\n<p>\u5bf9\u4e8e\u666e\u901a PC \u800c\u8a00\uff0c\u591a\u5757\u78c1\u76d8\u7684\u4e3b\u8981\u76ee\u7684\u662f\u6269\u5145\u5b58\u50a8\u5bb9\u91cf\uff0c\u4e00\u822c\u4e0d\u4f1a\u91c7\u7528 RAID \u65b9\u6848\u6765\u5e94\u5bf9\u78c1\u76d8\u635f\u574f\u3002\u4e00\u65e6\u53d1\u751f\u78c1\u76d8\u635f\u574f\u7684\u60c5\u51b5\uff0c\u7528\u6237\u5728\u627f\u53d7\u635f\u574f\u786c\u76d8\u4e0a\u9762\u7684\u6240\u6709\u6570\u636e\u4e22\u5931\u4e4b\u75db\u7684\u65f6\u5019\uff0c\u6700\u4e0d\u613f\u770b\u5230\u7684\u5c31\u662f\u5269\u4e0b\u7684\u78c1\u76d8\u4e5f\u6ca1\u6cd5\u8bbf\u95ee\u7684\u60c5\u51b5\u3002\u597d\u5728 LVM \u7684\u5f00\u53d1\u8005\u5145\u5206\u8003\u8651\u4e86\u8fd9\u4e00\u70b9\uff0c\u4e3a LVM \u63d0\u4f9b\u4e86\u6062\u590d\u673a\u5236\u3002<\/p>\n<p>\u5f53 root \u5206\u533a\u4e0d\u662f\u521b\u5efa\u5728 LVM \u4e0a\u65f6\uff0c\u60c5\u51b5\u5c31\u5982\u540c\u666e\u901a\u7684\u78c1\u76d8\u635f\u574f\u4e00\u6837\uff0c\u53ea\u9700\u8981\u66f4\u6362\u78c1\u76d8\uff0c\u91cd\u88c5\u7cfb\u7edf\uff0c\u7136\u540e\u5c06\u539f\u6765\u7684 LVM \u5206\u533a\u91cd\u65b0\u6302\u8f7d\u5c31\u53ef\u4ee5\uff0c\u548c\u6302\u8f7d\u5176\u5b83\u7c7b\u578b\u7684\u6587\u4ef6\u7cfb\u7edf\u5e76\u6ca1\u6709\u4ec0\u4e48\u533a\u522b\uff0c\u5728\u6b64\u4e0d\u4f5c\u8d58\u8ff0\u3002\u5f53 root \u5206\u533a\u521b\u5efa\u5728 LVM \u4e0a\u65f6\uff0c\u6211\u4eec\u8fd8\u9700\u8981\u5206\u4e24\u79cd\u60c5\u51b5\u6765\u5904\u7406\u2014\u2014 root \u5206\u533a\u6240\u5728\u7684\u78c1\u76d8\u635f\u574f\u548c\u975e root \u5206\u533a\u6240\u5728\u7684\u78c1\u76d8\u635f\u574f\u3002<\/p>\n<p><strong>\u975e root \u5206\u533a\u78c1\u76d8\u635f\u574f<\/strong><\/p>\n<p>\u7528 Disk-A \u548c Disk-B \u521b\u5efa System VG\uff0croot \u5206\u533a\u548c\u4ea4\u6362\u5206\u533a\u5b58\u5728\u4e8e Disk-A \u4e0a\uff0cDisk-A \u548c Disk-B \u4e0a\u521b\u5efa\u4e86\u591a\u4e2a LV \u7528\u4e8e\u5b58\u653e\u7528\u6237\u6570\u636e\u3002\u5f53\u7528\u6237\u5728\u67d0\u6b21\u91cd\u8d77\u540e\uff0c\u53d1\u73b0\u7cfb\u7edf\u65e0\u6cd5\u8d77\u52a8\uff0c\u7ecf\u68c0\u67e5\u53d1\u73b0 Disk-B \u635f\u574f\uff0c\u7528\u6237\u5e0c\u671b\u80fd\u591f\u542f\u52a8\u7cfb\u7edf\uff0c\u6062\u590d Disk-A \u4e0a\u7684\u6570\u636e\u3002<\/p>\n<p>\u79fb\u9664\u635f\u574f\u78c1\u76d8 Disk-B \u540e\uff0c\u7cfb\u7edf\u65e0\u6cd5\u542f\u52a8\uff0c\u7cfb\u7edf\u8f93\u51fa\u5982\u4e0b\uff1a<\/p>\n<h5 id=\"listing18\">\u6e05\u5355 18. \u78c1\u76d8\u635f\u574f\u540e\u72b6\u6001<\/h5>\n<div class=\"codesection\">\n<pre class=\"displaycode\">\u2026 .. \r\n Reading all physical volumes. This may take a while \u2026\r\n Couldn' t find device with uuid 'wWnmiu-IdIw-K1P6-u10C-A4j1-LQSZ-c08RDy ' . \r\n Couldn' t find all physical volumes for volume group system. \r\n Couldn' t find device with uuid 'wWnmiu-IdIw-K1P6-u10C-A4j1-LQSZ-c08RDy' . \r\n Couldn' t find all physical volumes for volume group system. \r\n Volume group \u201csystem\u201d not found \r\n Couldn't find device with uuid 'wWnmiu-IdIw-K1P6-u10C-A4j1-LQSZ-c08RDy' . \r\n Couldn't find all physical volumes for volume group system. \r\n Couldn't find device with uuid 'wWnmiu-IdIw-K1P6-u10C-A4j1-LQSZ-c08RDy' . \r\n Couldn't find all physical volumes for volume group system. \r\n .not found -- exiting to \/bin\/sh<\/pre>\n<\/div>\n<p>\u5206\u6790\u8f93\u51fa\u53ef\u77e5\uff0c\u8be5\u95ee\u9898\u662f\u78c1\u76d8 Disk-B \u635f\u574f\u5bfc\u81f4\u7684\u3002\u7a76\u5176\u539f\u56e0\uff0c\u662f root \u5206\u533a\u521b\u5efa\u4e8e LVM \u4e0a\uff0c\u5f53\u786c\u76d8\u4e22\u5931\u65f6\uff0c\u5bfc\u81f4 LVM \u7684\u53d1\u751f\u4e0d\u4e00\u81f4\uff0c\u5bfc\u81f4 root \u5206\u533a\u65e0\u6cd5\u88ab\u6b63\u5e38\u8bfb\u53d6\uff0c\u8fdb\u800c\u7cfb\u7edf\u65e0\u6cd5\u6b63\u5e38\u542f\u52a8\u3002\u5982\u679c\u80fd\u591f\u6062\u590d LVM \u7684\u4e00\u81f4\u6027\uff0c\u6062\u590d root \u5206\u533a\u7684\u6b63\u5e38\u8bfb\u53d6\uff0c\u5c31\u53ef\u4ee5\u6062\u590d Disk-A \u4e0a\u7684\u6570\u636e\u3002<\/p>\n<p>\u7531\u4e8e\u6b64\u65f6\u7cfb\u7edf\u5df2\u7ecf\u4e0d\u80fd\u6b63\u5e38\u542f\u52a8\uff0c\u9700\u8981\u7528\u5149\u76d8\u542f\u52a8\u8fdb\u5165\u5230\u7d27\u6025\u6062\u590d\u6a21\u5f0f\uff0c\u7528 root \u7528\u6237\u767b\u5f55\uff1a<\/p>\n<h5 id=\"listing19\">\u6e05\u5355 19. \u7d27\u6025\u6062\u590d\u767b\u9646<\/h5>\n<div class=\"codesection\">\n<pre class=\"displaycode\"> Rescue Login: root \r\n Rescue:~#<\/pre>\n<\/div>\n<p>\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u68c0\u67e5\u5f53\u524d\u72b6\u6001\uff1a<\/p>\n<h5 id=\"listing20\">\u6e05\u5355 20. \u68c0\u67e5\u78c1\u76d8\u53ca\u6587\u4ef6\u7cfb\u7edf\u72b6\u51b5<\/h5>\n<div class=\"codesection\">\n<pre class=\"displaycode\"> Rescue:~#lvscan \r\n Reading all physical volumes. This may take a while \u2026\r\n Couldn't find device with uuid 'wWnmiu-IdIw-K1P6-u10C-A4j1-LQSZ-c08RDy'. \r\n Couldn't find all physical volumes for volume group system. \r\n Couldn't find device with uuid 'wWnmiu-IdIw-K1P6-u10C-A4j1-LQSZ-c08RDy'. \r\n Couldn't find all physical volumes for volume group system. \r\n Volume group \u201csystem\u201d not found \r\n Rescue:~#pvscan \r\n Couldn't find device with uuid 'wWnmiu-IdIw-K1P6-u10C-A4j1-LQSZ-c08RDy'. \r\n Couldn't find device with uuid 'wWnmiu-IdIw-K1P6-u10C-A4j1-LQSZ-c08RDy'. \r\n PV \/dev\/sda2 \t VG system \t lvm2 \t [7.93 \t GB \/ 0 \t free] \r\n PV unknown \t VG system \t lvm2 \t [2.00 \t GB \/ 2.00 GB \t free] \r\n Total: 2 [9.92 GB] \/ in use: 2 [9.92 GB] \/ in no VG: 0 [0 ]<\/pre>\n<\/div>\n<p>\u7531 \u4e0a\u9762\u8f93\u51fa\u53ef\u4ee5\u77e5\u9053\uff0c\u7531\u4e8e\u78c1\u76d8\u7f3a\u5931\uff0c\u7cfb\u7edf\u65e0\u6cd5\u6b63\u786e\u8bc6\u522b system \u5377\u7ec4\uff0c\u4f46\u662f\u7cfb\u7edf\u53ef\u4ee5\u6b63\u786e\u8bc6\u522b\u51fa\u786c\u76d8\uff0c\u4e5f\u53ef\u4ee5\u68c0\u6d4b\u5230\u786c\u76d8\u7684\u7f3a\u5931\u3002\u5f53\u7cfb\u7edf\u6302\u8f7d\u7684\u662f\u666e\u901a\u6587\u4ef6\u7cfb\u7edf\u7684\u65f6\u5019\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u7d27\u6025\u6062\u590d\u6a21\u5f0f\u4e0b\u76f4\u63a5\u6302\u8f7d\u6587\u4ef6\u7cfb\u7edf\u7684\u65b9\u6cd5\u6765\u8fdb \u884c\u6570\u636e\u6062\u590d\uff0c\u7136\u800c\u8fd9\u79cd\u65b9\u6cd5\u5728 LVM \u4e0b\u884c\u4e0d\u901a\uff0c\u56e0\u4e3a\u6240\u6709\u7684\u903b\u8f91\u5377\u90fd\u662f LVM \u7ba1\u7406\u7684\uff0c\u5f53\u5377\u7ec4\u4e0d\u80fd\u88ab\u6b63\u786e\u8bc6\u522b\u7684\u65f6\u5019\uff0c\u6240\u6709\u7684 LV \u4e5f\u4e0d\u80fd\u88ab\u5904\u7406\u3002\u56e0\u6b64\u6211\u4eec\u8981\u505a\u7684\u5c31\u662f\u5220\u9664\u5377\u7ec4\u4e2d\u7684\u7f3a\u5931\u7269\u7406\u76d8\uff0c\u6062\u590d\u5377\u7ec4\u7684\u4e00\u81f4\u6027\u3002<\/p>\n<p>LVM \u63d0\u4f9b vgreduce \u6765\u6267\u884c\u4ece\u5377\u7ec4\u4e2d\u5220\u9664\u7269\u7406\u5377\u7684\u64cd\u4f5c\uff0c\u5e76\u4e14\u63d0\u4f9b\u201d\u2014 removemissing\u201d\u6765\u5220\u9664\u5377\u7ec4\u4e2d\u6240\u6709\u7f3a\u5931\u7684\u7269\u7406\u5377\u3002<\/p>\n<h5 id=\"listing21\">\u6e05\u5355 21. \u5220\u9664\u7f3a\u5931\u7684\u7269\u7406\u5377<\/h5>\n<div class=\"codesection\">\n<pre class=\"displaycode\"> Rescue:~#vgreduce \u2013 removemissing system \r\n Couldn't find device with uuid 'wWnmiu-IdIw-K1P6-u10C-A4j1-LQSZ-c08RDy'. \r\n Couldn't find all physical volumes for volume group system. \r\n Couldn't find device with uuid 'wWnmiu-IdIw-K1P6-u10C-A4j1-LQSZ-c08RDy'. \r\n Couldn't find all physical volumes for volume group system. \r\n Couldn't find device with uuid 'wWnmiu-IdIw-K1P6-u10C-A4j1-LQSZ-c08RDy'. \r\n Couldn't find device with uuid 'wWnmiu-IdIw-K1P6-u10C-A4j1-LQSZ-c08RDy'. \r\n Wrote out consistent volume group system \r\n Rescue:~#vgscan \r\n Reading all physical volumes. This may take a while \u2026\r\n Found volume group \u201csystem\u201d using metadata type lvm2 \r\n Rescue:~#pvscan \r\n PV \/dev\/sda2 \t VG system \t lvm2 \t [7.93 \t GB \/ 0 \t free] \r\n Total: 1 [7.93 GB] \/ in use: 1 [7.93 GB] \/ in no VG: 0 [0 ]<\/pre>\n<\/div>\n<p>\u901a \u8fc7\u5220\u9664\u7f3a\u5931\u7684\u786c\u76d8\uff0c\u6b64\u65f6\u7cfb\u7edf\u5df2\u7ecf\u53ef\u4ee5\u6b63\u786e\u8bc6\u522b\u5377\u7ec4\u3002\u4f46\u662f\u7ecf\u5386\u8fc7\u5982\u6b64\u52ab\u96be\uff0cLV \u8fd8\u9700\u8981\u989d\u5916\u7684\u6b65\u9aa4\u624d\u80fd\u6b63\u5e38\u5de5\u4f5c\u3002\u6267\u884c lvscan\uff0c\u6211\u4eec\u53ef\u4ee5\u53d1\u73b0 root \u548c swap \u4e24\u4e2a\u903b\u8f91\u5377\u90fd\u5904\u4e8e inactive \u72b6\u6001\uff0c\u9700\u8981\u624b\u52a8\u6267\u884c lvchange \u547d\u4ee4\u6fc0\u6d3b\uff0c\u624d\u80fd\u4f7f\u5b83\u6b63\u5e38\u5de5\u4f5c\u3002<\/p>\n<h5 id=\"listing22\">\u6e05\u5355 22. \u6fc0\u6d3b\u4fee\u590d\u540e\u7684\u5377<\/h5>\n<div class=\"codesection\">\n<pre class=\"displaycode\"> Rescue:~#lvscan \r\n inactive \t\t'\/dev\/system\/root'[7.38 GB] inherit \r\n inactive \t\t'\/dev\/system\/swap'[560.00 MB] inherit \r\n Rescue:~#lvchange \u2013 ay \/dev\/system \r\n ACTIVE \t\t'\/dev\/system\/root'[7.38 GB] inherit \r\n ACTIVE \t\t'\/dev\/system\/swap'[560.00 MB] inherit<\/pre>\n<\/div>\n<p>\u5230\u6b64\uff0c\u5927\u529f\u544a\u6210\uff0c\u91cd\u8d77\uff0c\u7cfb\u7edf\u542f\u52a8\uff0c\u9664\u4e86\u635f\u574f\u7684\u78c1\u76d8\u5df2\u7ecf\u4e00\u53bb\u4e0d\u590d\u8fd4\u4ee5\u5916\uff0c\u7cfb\u7edf\u53c8\u6062\u590d\u6b63\u5e38\u4e86\u3002<\/p>\n<p><strong>root \u5206\u533a\u78c1\u76d8\u635f\u574f<\/strong><\/p>\n<p>\u5f53 root \u5206\u533a\u78c1\u76d8\u53d1\u751f\u635f\u574f\u7684\u65f6\u5019\uff0c\u552f\u4e00\u7684\u9009\u62e9\u53ea\u80fd\u662f\u53e6\u5916\u627e\u4e00\u53f0\u673a\u5668\uff0c\u628a\u6ca1\u6709\u635f\u574f\u7684\u78c1\u76d8\u88c5\u4e0a\u53bb\u3002\u5f00\u673a\u540e\u6267\u884c `fdisk \u2013 l`\uff0c\u8f93\u51fa\u663e\u793a\u786c\u76d8\u4e0d\u5305\u542b\u6709\u6548\u5206\u533a\u8868\uff0c\u4e0d\u80fd\u591f\u6b63\u786e\u8bfb\u53d6\u3002\u6267\u884c LVM \u7684\u76f8\u5173\u68c0\u67e5\uff0c\u53ef\u4ee5\u6ce8\u610f\u5230\u9519\u8bef\u4fe1\u606f\u4e0e\u975e root \u5206\u533a\u8f93\u51fa\u7684\u4e00\u81f4\u3002\u6267\u884c\u975e root \u5206\u533a\u78c1\u76d8\u635f\u574f\u7684\u64cd\u4f5c\u6b65\u9aa4\uff0c\u5c31\u53ef\u4ee5\u8ba9\u5377\u7ec4\u6062\u590d\u6b63\u5e38\u3002\u5c06\u6062\u590d\u540e\u7684\u5377\u7ec4\u6302\u8f7d\u540e\uff0c\u5c31\u53ef\u4ee5\u6267\u884c\u6b63\u5e38\u8bfb\u5199\u4e86\u3002<\/p>\n<p class=\"ibm-ind-link ibm-back-to-top\"><a class=\"ibm-anchor-up-link\" href=\"http:\/\/www.ibm.com\/developerworks\/cn\/linux\/l-cn-pclvm-rstr\/#ibm-pcon\">\u56de\u9875\u9996<\/a><\/p>\n<h2 id=\"major4\">\u603b\u7ed3<\/h2>\n<p>\u5bf9\u4e8e\u8fd0\u884c\u5728\u666e\u901a PC \u4e0a\u7684 LVM\uff0c\u901a\u5e38\u7f3a\u5c11\u6709\u8ba1\u5212\u7684\u5907\u4efd\u548c\u786c\u4ef6\u5197\u4f59\u6765\u5e94\u5bf9\u707e\u96be\uff0c\u56e0\u800c\u5728\u707e\u96be\u53d1\u751f\u65f6\uff0c\u5f80\u5f80\u9700\u8981\u627f\u53d7\u4e25\u91cd\u7684\u6570\u636e\u635f\u5931\u3002\u672c\u6587\u4ecb\u7ecd\u4e86 LVM \u4e0a\u53ef\u80fd\u53d1\u751f\u7684\u707e\u96be\uff0c\u7ed3\u5408\u5b9e\u4f8b\u6f14\u793a\u4e86\u5982\u4f55\u8fdb\u884c\u707e\u96be\u6062\u590d\uff0c\u5728 LVM \u9047\u5230\u707e\u96be\u65f6\uff0c\u53ef\u4ee5\u5c3d\u53ef\u80fd\u6062\u590d\u6570\u636e\uff0c\u51cf\u5c11\u635f\u5931\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>http:\/\/www.ibm.com\/developerworks\/cn\/linux\/l-cn-pclvm-rstr\/<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u6587\u5730\u5740 &nbsp; LVM \u7b80\u4ecb L<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[],"tags":[117],"class_list":["post-3819","post","type-post","status-publish","format-standard","hentry","tag-01-linux"],"_links":{"self":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/3819","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/comments?post=3819"}],"version-history":[{"count":0,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/3819\/revisions"}],"wp:attachment":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/media?parent=3819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/categories?post=3819"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/tags?post=3819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}