{"id":323,"date":"2007-07-17T11:55:41","date_gmt":"2007-07-17T03:55:41","guid":{"rendered":"http:\/\/blog.smallken.ink\/2007\/07\/17\/linux\/323.html"},"modified":"2007-07-17T11:59:11","modified_gmt":"2007-07-17T03:59:11","slug":"%e5%bb%ba%e7%ab%8b-pv-lvm","status":"publish","type":"post","link":"https:\/\/blog.smallken.site\/?p=323","title":{"rendered":"\u5efa\u7acb PV &#8211; LVM"},"content":{"rendered":"<p>LVM \u9019\u500b\u6771\u897f\u6307\u4ee4\u5f88\u7e41\u7d22, \u6c92\u6709\u5beb\u6210 SOP \u65e5\u5f8c\u9020\u6210\u7684\u56f0\u64fe\u4e00\u5b9a\u5f88\u591a,\u76ee\u6a19\u5be6\u4f5c\u4e8c\u9846\u65b0\u786c\u789f\/dev\/hdb, \/dev\/hdd, \u5efa\u7acb\u6210 PV<\/p>\n<ul>\n<li>pvcreate \uff1a\u5c07\u5be6\u9ad4 partition \u5efa\u7acb\u6210\u70ba PV<\/li>\n<li>pvremove \uff1a\u76f8\u5c0d\u65bc pvcreate \u5c07 PV \u5c6c\u6027\u79fb\u9664\uff0c\u8b93\u8a72 partition \u4e0d\u5177\u6709 PV \u5c6c\u6027\u3002<\/li>\n<li>pvscan \uff1a\u641c\u5c0b\u76ee\u524d\u7cfb\u7d71\u88e1\u9762\u4efb\u4f55\u5177\u6709 PV \u7684\u78c1\u789f\uff1b<\/li>\n<li>pvdisplay \uff1a\u986f\u793a\u51fa\u76ee\u524d\u7cfb\u7d71\u4e0a\u9762\u7684 PV \u72c0\u614b\uff1b<\/li>\n<li>partprobe \uff1a\u9019\u500b\u6307\u4ee4\u53ef\u4ee5\u8b93\u6838\u5fc3\u7acb\u523b\u8b80\u5165\u6700\u65b0\u7684 partition table \u800c\u4e0d\u5fc5 reboot\u3002<\/li>\n<\/ul>\n<p>\u628a\u78c1\u789f\u8a2d\u5b9aID\u70ba 8e<\/p>\n<p><strong># fdisk \/dev\/hdb<\/strong><\/p>\n<p><!--more--><\/p>\n<p>he number of cylinders for this disk is set to 8322.<br \/>\nThere is nothing wrong with that, but this is larger than 1024,<br \/>\nand could in certain setups cause problems with:<br \/>\n1) software that runs at boot time (e.g., old versions of LILO)<br \/>\n2) booting and partitioning software from other OSs<br \/>\n\u00a0\u00a0 (e.g., DOS FDISK, OS\/2 FDISK)<\/p>\n<p>Command (m for help):<font color=\"#ff9900\"> <\/font><font color=\"#0000ff\">n<br \/>\n<\/font>Command action<br \/>\n\u00a0\u00a0 e\u00a0\u00a0 extended<br \/>\n\u00a0\u00a0 p\u00a0\u00a0 primary partition (1-4)<br \/>\n<font color=\"#0000ff\">p<br \/>\n<\/font>Partition number (1-4): <font color=\"#0000ff\">1<br \/>\n<\/font>First cylinder (1-8322, default 1): <font color=\"#0000ff\">Enter<\/font><\/p>\n<p>Using default value 1<br \/>\nLast cylinder or +size or +sizeM or +sizeK (1-8322, default 8322): <font color=\"#0000ff\">Enter<\/font><br \/>\nUsing default value 8322<\/p>\n<p>Command (m for help): <font color=\"#0000ff\">t<br \/>\n<\/font>Selected partition 1<br \/>\nHex code (type L to list codes): <font color=\"#0000ff\">8e<br \/>\n<\/font>Changed system type of partition 1 to 8e (Linux LVM)<\/p>\n<p>Command (m for help): <font color=\"#0000ff\">p<\/font><\/p>\n<p>Disk \/dev\/hdb: 4294 MB, 4294967296 bytes<br \/>\n16 heads, 63 sectors\/track, 8322 cylinders<br \/>\nUnits = cylinders of 1008 * 512 = 516096 bytes<\/p>\n<p>\u00a0\u00a0 Device Boot\u00a0\u00a0\u00a0\u00a0\u00a0 Start\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 End\u00a0\u00a0\u00a0\u00a0\u00a0 Blocks\u00a0\u00a0 Id\u00a0 System<br \/>\n\/dev\/hdb1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 8322\u00a0\u00a0\u00a0\u00a0 4194256+\u00a0 8e\u00a0 Linux LVM<\/p>\n<p>Command (m for help): <font color=\"#0000ff\">w<\/font><br \/>\nThe partition table has been altered!<\/p>\n<p>Calling ioctl() to re-read partition table.<br \/>\nSyncing disks.<\/p>\n<p><strong># fdisk \/dev\/hdd<\/strong> (\u540c\u4e0a\u6b65\u9a5f\u4f5c\u6cd5)<\/p>\n<p>\u4e0d\u7528\u91cd\u958b\u6a5f,\u8b93 kernel \u66f4\u65b0\u76ee\u524d\u7684 partition<br \/>\n<strong># partprobe<\/strong><\/p>\n<p>[root@test ~]#<strong> pvscan<br \/>\n<\/strong>\u00a0\u00a0No matching physical volumes found<\/p>\n<p>\u5efa\u7acb\u78c1\u789f\u70ba PV \u683c\u5f0f<br \/>\n[root@test<strong> ~<\/strong>]#<strong> pvcreate \/dev\/hdb1<br \/>\n<\/strong>\u00a0 Physical volume &#8220;\/dev\/hdb1&#8221; successfully created<\/p>\n<p>[root@test ~]# <strong>pvcreate \/dev\/hdd1<br \/>\n<\/strong>\u00a0 Physical volume &#8220;\/dev\/hdd1&#8221; successfully created<\/p>\n<p>\u67e5\u770b PV<br \/>\n[root@test ~]# <strong>pvscan<br \/>\n<\/strong>\u00a0 PV \/dev\/hdb1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 lvm2 [4.00 GB]<br \/>\n\u00a0 PV \/dev\/hdd1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 lvm2 [4.00 GB]<br \/>\n\u00a0 Total: 2 [8.00 GB] \/ in use: 0 [0\u00a0\u00a0 ] \/ in no VG: 2 [8.00 GB]<\/p>\n<p>\u8a73\u7d30\u67e5\u770b PV<br \/>\n[root@test ~]# <strong>pvdisplay<\/strong><\/p>\n<p>&#8212; NEW Physical volume &#8212;<br \/>\nPV Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/dev\/hdb1<br \/>\nVG Name<br \/>\nPV Size\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4.00 GB<br \/>\nAllocatable\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 NO<br \/>\nPE Size (KByte)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0<br \/>\nTotal PE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0<br \/>\nFree PE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0<br \/>\nAllocated PE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0<br \/>\nPV UUID\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ODLISG-VQtA-qMNb-EJrV-TtLp-El1n-1hUxbr<\/p>\n<p>&#8212; NEW Physical volume &#8212;<br \/>\nPV Name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/dev\/hdd1<br \/>\nVG Name<br \/>\nPV Size\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4.00 GB<br \/>\nAllocatable\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 NO<br \/>\nPE Size (KByte)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0<br \/>\nTotal PE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0<br \/>\nFree PE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0<br \/>\nAllocated PE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0<br \/>\nPV UUID\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 5JUJOn-1dpp-wlid-yHdS-6G7p-B0JN-1BBYil<\/p>\n","protected":false},"excerpt":{"rendered":"<p>LVM \u9019\u500b\u6771\u897f\u6307\u4ee4\u5f88\u7e41\u7d22, \u6c92\u6709\u5beb\u6210 SOP \u65e5\u5f8c\u9020\u6210\u7684\u56f0\u64fe\u4e00\u5b9a\u5f88\u591a,\u76ee\u6a19\u5be6\u4f5c\u4e8c\u9846\u65b0\u786c\u789f\/dev\/hdb, &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-323","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/blog.smallken.site\/index.php?rest_route=\/wp\/v2\/posts\/323","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.smallken.site\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.smallken.site\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.smallken.site\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.smallken.site\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=323"}],"version-history":[{"count":0,"href":"https:\/\/blog.smallken.site\/index.php?rest_route=\/wp\/v2\/posts\/323\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.smallken.site\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=323"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.smallken.site\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=323"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.smallken.site\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}