{"id":19486,"date":"2017-03-30T06:15:45","date_gmt":"2017-03-29T22:15:45","guid":{"rendered":"https:\/\/2blog.ilc.edu.tw\/25793\/2017\/03\/30\/%e7%b8%ae%e6%94%be%e5%8d%b7%e5%86%8a%e7%be%a4%e7%b5%84%e5%92%8c%e9%82%8f%e8%bc%af%e5%8d%b7%e5%86%8a%e7%9a%84%e5%a4%a7%e5%b0%8f\/"},"modified":"2017-03-30T06:15:45","modified_gmt":"2017-03-29T22:15:45","slug":"%e7%b8%ae%e6%94%be%e5%8d%b7%e5%86%8a%e7%be%a4%e7%b5%84%e5%92%8c%e9%82%8f%e8%bc%af%e5%8d%b7%e5%86%8a%e7%9a%84%e5%a4%a7%e5%b0%8f","status":"publish","type":"post","link":"https:\/\/2blog.ilc.edu.tw\/25793\/2017\/03\/30\/%e7%b8%ae%e6%94%be%e5%8d%b7%e5%86%8a%e7%be%a4%e7%b5%84%e5%92%8c%e9%82%8f%e8%bc%af%e5%8d%b7%e5%86%8a%e7%9a%84%e5%a4%a7%e5%b0%8f\/","title":{"rendered":"\u7e2e\u653e\u5377\u518a\u7fa4\u7d44\u548c\u908f\u8f2f\u5377\u518a\u7684\u5927\u5c0f"},"content":{"rendered":"<p>\u589e\u52a0\u5be6\u9ad4\u5377\u518a\u5230\u5377\u518a\u7fa4\u7d44 <br \/> # <span style=\"color: #ff0000;\"> vgdisplay systemVG <\/span> <br \/> <span style=\"color: #0000ff;\"> &#8212; Volume group &#8212; <\/span> <br \/> <span style=\"color: #0000ff;\"> VG Name systemVG <\/span> <br \/> <span style=\"color: #0000ff;\"> System ID <\/span> <br \/> <span style=\"color: #0000ff;\"> Format lvm2 <\/span> <br \/> <span style=\"color: #0000ff;\"> Metadata Areas 2 <\/span> <br \/> <span style=\"color: #0000ff;\"> Metadata Sequence No 2 <\/span> <br \/> <span style=\"color: #0000ff;\"> VG Access read\/write <\/span> <br \/> <span style=\"color: #0000ff;\"> VG Status resizable <\/span> <br \/> <span style=\"color: #0000ff;\"> MAX LV 0 <\/span> <br \/> <span style=\"color: #0000ff;\"> Cur LV 1 <\/span> <br \/> <span style=\"color: #0000ff;\"> Open LV 1 <\/span> <br \/> <span style=\"color: #0000ff;\"> Max PV 0 <\/span> <br \/> <span style=\"color: #ff0000;\"> Cur PV 2 <\/span> <br \/> <span style=\"color: #0000ff;\"> Act PV 2 <\/span> <br \/> <span style=\"color: #ff0000;\"> VG Size 1.99 GiB <\/span> <br \/> <span style=\"color: #0000ff;\"> PE Size 4.00 MiB <\/span> <br \/> <span style=\"color: #0000ff;\"> Total PE 510 <\/span> <br \/> <span style=\"color: #0000ff;\"> Alloc PE \/ Size 125 \/ 500.00 MiB <\/span> <br \/> <span style=\"color: #0000ff;\"> Free PE \/ Size 385 \/ 1.50 GiB <\/span> <br \/> <span style=\"color: #0000ff;\"> VG UUID oWUkZt-IOhU-1qw2-THBl-qRfY-w3xK-JDCPXe <\/span> <\/p>\n<p> VG Size \u70ba 2G\uff0cCur PV 2 \u7531 2 \u500b PV \u7d44\u6210<\/p>\n<p>[@more@]# <span style=\"color: #ff0000;\"> vgextend systemVG \/dev\/sda7 <\/span> <br \/> <span style=\"color: #0000ff;\"> Volume group &#8220;systemVG&#8221; successfully extended <\/span> <\/p>\n<p> # <span style=\"color: #ff0000;\"> vgdisplay systemVG <\/span> <br \/> <span style=\"color: #0000ff;\"> &#8212; Volume group &#8212; <\/span> <br \/> <span style=\"color: #0000ff;\"> VG Name systemVG <\/span> <br \/> <span style=\"color: #0000ff;\"> System ID <\/span> <br \/> <span style=\"color: #0000ff;\"> Format lvm2 <\/span> <br \/> <span style=\"color: #0000ff;\"> Metadata Areas 3 <\/span> <br \/> <span style=\"color: #0000ff;\"> Metadata Sequence No 3 <\/span> <br \/> <span style=\"color: #0000ff;\"> VG Access read\/write <\/span> <br \/> <span style=\"color: #0000ff;\"> VG Status resizable <\/span> <br \/> <span style=\"color: #0000ff;\"> MAX LV 0 <\/span> <br \/> <span style=\"color: #0000ff;\"> Cur LV 1 <\/span> <br \/> <span style=\"color: #0000ff;\"> Open LV 1 <\/span> <br \/> <span style=\"color: #0000ff;\"> Max PV 0 <\/span> <br \/> <span style=\"color: #ff0000;\"> Cur PV 3 <\/span> <br \/> <span style=\"color: #0000ff;\"> Act PV 3 <\/span> <br \/> <span style=\"color: #ff0000;\"> VG Size 2.99 GiB <\/span> <br \/> <span style=\"color: #0000ff;\"> PE Size 4.00 MiB <\/span> <br \/> <span style=\"color: #0000ff;\"> Total PE 765 <\/span> <br \/> <span style=\"color: #0000ff;\"> Alloc PE \/ Size 125 \/ 500.00 MiB <\/span> <br \/> <span style=\"color: #0000ff;\"> Free PE \/ Size 640 \/ 2.50 GiB <\/span> <br \/> <span style=\"color: #0000ff;\"> VG UUID oWUkZt-IOhU-1qw2-THBl-qRfY-w3xK-JDCPXe <\/span> <\/p>\n<p> VG \u8b8a\u6210 3G\uff0cCur PV \u7531 3 \u500b PV \u6240\u7d44\u6210 <\/p>\n<p> \u5c07\u5be6\u9ad4\u5377\u518a\u5f9e\u5377\u518a\u7fa4\u7d44\u4e2d\u79fb\u9664 <br \/> # <span style=\"color: #ff0000;\"> vgreduce systemVG \/dev\/sda7 <\/span> <br \/> <span style=\"color: #0000ff;\"> Removed &#8220;\/dev\/sda7&#8221; from volume group &#8220;systemVG&#8221; <\/span> <br \/> vgreduce \u6307\u4ee4\u5de5\u5177\u53ef\u4ee5\u5c07\u5c1a\u672a\u4f7f\u7528\u5230\u7684\u5be6\u9ad4\u5377\u518a\u5f9e\u5377\u518a\u7fa4\u7d44\u4e2d\u79fb\u9664\uff0c\u4f46\u5982\u679c\u5be6\u9ad4\u5377\u518a\u5df2\u7d93\u88ab\u6709\u5b58\u53d6\u5bb9\u91cf\u7a7a\u9593\u5360\u7528\u6642\uff0c\u5c31\u6703\u7121\u6cd5\u522a\u9664 <\/p>\n<p> \u900f\u904e\u6307\u4ee4\u4f86\u7e2e\u653e\u908f\u8f2f\u5377\u518a <br \/> # <span style=\"color: #ff0000;\"> df -h | grep www_LV <\/span> <br \/> <span style=\"color: #0000ff;\"> \/dev\/mapper\/systemVG-www_LV 500M 33M 468M 7% \/var\/www <\/span> <\/p>\n<p> # <span style=\"color: #ff0000;\"> lvdisplay | grep &#8220;LV Size&#8221; <\/span> <br \/> <span style=\"color: #0000ff;\"> LV Size 500.00 MiB <\/span> <\/p>\n<p> \u52a0\u5927 www_LV \u908f\u8f2f\u5377\u518a \u52a0\u5230 750M(\u539f\u6709 500M + 250M) <br \/> # <span style=\"color: #ff0000;\"> umount \/var\/www <\/span> <br \/> # <span style=\"color: #ff0000;\"> lvextend -L +250M \/dev\/systemVG\/www_LV <\/span> <br \/> <span style=\"color: #0000ff;\"> Rounding up size to full physical extent 252.00 MiB <\/span> <br \/> <span style=\"color: #0000ff;\"> Extending logical volume www_LV to 752.00 MiB <\/span> <br \/> <span style=\"color: #0000ff;\"> Logical volume www_LV successfully resized <\/span> <\/p>\n<p> # <span style=\"color: #ff0000;\"> ls -l \/var\/www <\/span> <br \/> <span style=\"color: #0000ff;\"> \u7e3d\u8a08 0 <\/span> <br \/> <span style=\"color: #0000ff;\"> -rw-r&#8211;r&#8211; 1 root root 0 5\u6708 17 21:16 test.html <\/span> <\/p>\n<p> \u683c\u5f0f\u5316\u5f8c\u7e8c\u65b0\u589e\u7684\u90e8\u5206<br \/>ext2\/ext3 resizefs<br \/># <span style=\"color: #ff0000;\">resize2fs -s +250M \/dev\/systemVG\/www_LV<\/span><br \/> # <span style=\"color: #ff0000;\"> resize_reiserfs -s +250M \/dev\/systemVG\/www_LV <\/span> <br \/> <span style=\"color: #0000ff;\"> resize_reiserfs 3.6.21 (2009 www.namesys.com) <\/span> <\/p>\n<p> <span style=\"color: #0000ff;\"> ReiserFS report: <\/span> <br \/> <span style=\"color: #0000ff;\"> blocksize 4096 <\/span> <br \/> <span style=\"color: #0000ff;\"> block count 192000 (128000) <\/span> <br \/> <span style=\"color: #0000ff;\"> free blocks 183783 (119785) <\/span> <br \/> <span style=\"color: #0000ff;\"> bitmap block count 6 (4) <\/span> <\/p>\n<p> <span style=\"color: #0000ff;\"> Syncing..done <\/span> <\/p>\n<p> <span style=\"color: #0000ff;\"> resize_reiserfs: Resizing finished successfully. <\/span> <\/p>\n<p> \u91cd\u65b0\u639b\u8f09 <br \/> # <span style=\"color: #ff0000;\"> mount -t reiserfs \/dev\/systemVG\/www_LV \/var\/www <\/span> <br \/> \u6aa2\u67e5\u5bb9\u91cf <br \/> # <span style=\"color: #ff0000;\"> lvdisplay | grep &#8220;LV Size&#8221; <\/span> <br \/> <span style=\"color: #0000ff;\"> LV Size <span style=\"color: #ff0000;\"> 752.00 <\/span> MiB <\/span> <br \/> # <span style=\"color: #ff0000;\"> df -h | grep www_LV <\/span> <br \/> <span style=\"color: #0000ff;\"> \/dev\/mapper\/systemVG-www_LV <span style=\"color: #ff0000;\"> 750M <\/span> 33M 718M 5% \/var\/www <\/span> <\/p>\n<p> \u7e2e\u5c0f\u908f\u8f2f\u5377\u518a\u7684\u5927\u5c0f <br \/> # <span style=\"color: #ff0000;\"> umount \/var\/www <\/span> <br \/> # <span style=\"color: #ff0000;\"> resize_reiserfs -s -100M \/dev\/systemVG\/www_LV <\/span> <br \/> <span style=\"color: #0000ff;\"> resize_reiserfs 3.6.21 (2009 www.namesys.com) <\/span> <\/p>\n<p> <span style=\"color: #0000ff;\"> You are running BETA version of reiserfs shrinker. <\/span> <br \/> <span style=\"color: #0000ff;\"> This version is only for testing or VERY CAREFUL use. <\/span> <br \/> <span style=\"color: #0000ff;\"> Backup of you data is recommended. <\/span> <\/p>\n<p> <span style=\"color: #0000ff;\"> Do you want to continue? [y\/N]: <span style=\"color: #ff0000;\"> y <\/span> <\/span> <br \/> <span style=\"color: #0000ff;\"> Processing the tree: 0%&#8230;.20%&#8230;.40%&#8230;.60%&#8230;.80%&#8230;.100% left 0, 0 \/sec <\/span> <\/p>\n<p> <span style=\"color: #0000ff;\"> nodes processed (moved): <\/span> <br \/> <span style=\"color: #0000ff;\"> int 0 (0), <\/span> <br \/> <span style=\"color: #0000ff;\"> leaves 1 (0), <\/span> <br \/> <span style=\"color: #0000ff;\"> unfm 0 (0), <\/span> <br \/> <span style=\"color: #0000ff;\"> total 1 (0). <\/span> <\/p>\n<p> <span style=\"color: #0000ff;\"> check for used blocks in truncated region <\/span> <\/p>\n<p> <span style=\"color: #0000ff;\"> ReiserFS report: <\/span> <br \/> <span style=\"color: #0000ff;\"> blocksize 4096 <\/span> <br \/> <span style=\"color: #0000ff;\"> block count 166400 (192000) <\/span> <br \/> <span style=\"color: #0000ff;\"> free blocks 158183 (183783) <\/span> <br \/> <span style=\"color: #0000ff;\"> bitmap block count 6 (6) <\/span> <\/p>\n<p> <span style=\"color: #0000ff;\"> Syncing..done <\/span> <\/p>\n<p> <span style=\"color: #0000ff;\"> resize_reiserfs: Resizing finished successfully. <\/span> <\/p>\n<p> \u4f7f\u7528 lvreduce \u6e1b\u5c11 www_LV \u7684 100 \u7a7a\u9593 <br \/> # <span style=\"color: #ff0000;\"> lvreduce -L -100M \/dev\/systemVG\/www_LV <\/span> <br \/> <span style=\"color: #0000ff;\"> WARNING: Reducing active logical volume to 652.00 MiB <\/span> <br \/> <span style=\"color: #0000ff;\"> THIS MAY DESTROY YOUR DATA (filesystem etc.) <\/span> <br \/> <span style=\"color: #0000ff;\"> Do you really want to reduce www_LV? [y\/n]: <span style=\"color: #ff0000;\"> y <\/span> <\/span> <br \/> <span style=\"color: #0000ff;\"> Reducing logical volume www_LV to 652.00 MiB <\/span> <br \/> <span style=\"color: #0000ff;\"> Logical volume www_LV successfully resized <\/span> <\/p>\n<p> \u91cd\u65b0\u639b\u8f09 <br \/> # <span style=\"color: #ff0000;\"> mount -t reiserfs \/dev\/systemVG\/www_LV \/var\/www <\/span> <br \/> # <span style=\"color: #ff0000;\"> df -h | grep www_LV <\/span> <br \/> <span style=\"color: #0000ff;\"> \/dev\/mapper\/systemVG-www_LV 650M 33M 618M 5% \/var\/www <\/span> <br \/> # <span style=\"color: #ff0000;\"> lvdisplay | grep &#8220;LV Size&#8221; <\/span> <br \/> <span style=\"color: #0000ff;\"> LV Size 652.00 MiB<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u589e\u52a0\u5be6\u9ad4\u5377\u518a\u5230\u5377\u518a\u7fa4\u7d44 # vgdisplay systemVG &#8212; Volume group &#038; &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/2blog.ilc.edu.tw\/25793\/2017\/03\/30\/%e7%b8%ae%e6%94%be%e5%8d%b7%e5%86%8a%e7%be%a4%e7%b5%84%e5%92%8c%e9%82%8f%e8%bc%af%e5%8d%b7%e5%86%8a%e7%9a%84%e5%a4%a7%e5%b0%8f\/\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008\u7e2e\u653e\u5377\u518a\u7fa4\u7d44\u548c\u908f\u8f2f\u5377\u518a\u7684\u5927\u5c0f\u3009<\/span><\/a><\/p>\n","protected":false},"author":55,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[192],"tags":[],"class_list":["post-19486","post","type-post","status-publish","format-standard","hentry","category-c-105011"],"meta_key":{"_pingme":["1"],"_encloseme":["1"],"lt_post_id":["685435"]},"_links":{"self":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/19486"}],"collection":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/users\/55"}],"replies":[{"embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/comments?post=19486"}],"version-history":[{"count":0,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/19486\/revisions"}],"wp:attachment":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/media?parent=19486"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/categories?post=19486"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/tags?post=19486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}