{"id":330,"date":"2007-07-18T16:52:03","date_gmt":"2007-07-18T08:52:03","guid":{"rendered":"http:\/\/blog.smallken.ink\/2007\/07\/18\/linux\/330.html"},"modified":"2007-07-18T16:57:52","modified_gmt":"2007-07-18T08:57:52","slug":"%e7%b8%ae%e5%b0%8f-lv-lvm","status":"publish","type":"post","link":"https:\/\/blog.smallken.site\/?p=330","title":{"rendered":"\u7e2e\u5c0f LV &#8211; LVM"},"content":{"rendered":"<p>[root@test \/]#<strong> df -h<br \/><\/strong>\u6a94\u6848\u7cfb\u7d71&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u5bb9\u91cf&nbsp; \u5df2\u7528 \u53ef\u7528 \u5df2\u7528% \u639b\u8f09\u9ede<br \/>\/dev\/hda3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3.6G&nbsp; 1.2G&nbsp; 2.3G&nbsp; 34% \/<br \/>\/dev\/hda1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 99M&nbsp; 9.9M&nbsp;&nbsp; 84M&nbsp; 11% \/boot<br \/>tmpfs&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 125M&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp; 125M&nbsp;&nbsp; 0% \/dev\/shm<br \/>\/dev\/mapper\/Volgroup01-home<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>7.4G<\/strong>&nbsp; 140M&nbsp; 7.1G&nbsp;&nbsp; 2% \/home  <\/p>\n<p>\u7e2e\u5c0f LV \u4e00\u5b9a\u8981\u5148 umount \/home<br \/>[root@test \/]# <strong>umount \/home<\/strong>  <\/p>\n<p>\u7e2e\u5c0f LV \u524d\u4e5f\u4e00\u5b9a\u8981\u505a\u4e00\u6b21 fsck, \u4fdd\u6301\u6a94\u6848\u7cfb\u7d71\u7684\u4e00\u81f4\u6027<br \/>[root@test \/]# <strong>fsck -f \/dev\/Volgroup01\/home<\/strong><\/p>\n<p><!--more--><\/p>\n<p><strong><\/strong><br \/>fsck 1.39 (29-May-2006)<br \/>e2fsck 1.39 (29-May-2006)<br \/>Pass 1: Checking inodes, blocks, and sizes<br \/>Pass 2: Checking directory structure<br \/>Pass 3: Checking directory connectivity<br \/>Pass 4: Checking reference counts<br \/>Pass 5: Checking group summary information<br \/>\/dev\/Volgroup01\/home: 11\/983040 files (9.1% non-contiguous), 66537\/1966080 blocks  <\/p>\n<p>\u60f3\u5230\u7e2e\u5c0f\u5230 5G \u5bb9\u91cf<br \/>[root@test \/]# <strong>resize2fs \/dev\/Volgroup01\/home 5G<\/strong><br \/>resize2fs 1.39 (29-May-2006)<br \/>Resizing the filesystem on \/dev\/Volgroup01\/home to 1310720 (4k) blocks.<br \/>The filesystem on \/dev\/Volgroup01\/home is now 1310720 blocks long.  <\/p>\n<p>[root@test \/]#<strong> lvresize \/dev\/Volgroup01\/home -L 5G<br \/><\/strong>&nbsp; \/dev\/cdrom: open failed: \u552f\u8b80\u7684\u6a94\u6848\u7cfb\u7d71<br \/>&nbsp; WARNING: Reducing active logical volume to 5.00 GB<br \/>&nbsp; THIS MAY DESTROY YOUR DATA (filesystem etc.)<br \/>Do you really want to reduce home? [y\/n]: <strong>y<br \/><\/strong>&nbsp; Reducing logical volume home to 5.00 GB<br \/>&nbsp; Logical volume home successfully resized  <\/p>\n<p>[root@test ~]#<strong> mount \/home\/<\/strong> <\/p>\n<p>[root@test \/]# <strong>df -h<br \/><\/strong>\u6a94\u6848\u7cfb\u7d71&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u5bb9\u91cf&nbsp; \u5df2\u7528 \u53ef\u7528 \u5df2\u7528% \u639b\u8f09\u9ede<br \/>\/dev\/hda3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3.6G&nbsp; 1.2G&nbsp; 2.3G&nbsp; 34% \/<br \/>\/dev\/hda1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 99M&nbsp; 9.9M&nbsp;&nbsp; 84M&nbsp; 11% \/boot<br \/>tmpfs&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 125M&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp; 125M&nbsp;&nbsp; 0% \/dev\/shm<br \/>\/dev\/mapper\/Volgroup01-home<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>5.0<\/strong>G&nbsp; 236M&nbsp; 4.7G&nbsp;&nbsp; 5% \/home<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[root@test \/]# df -h\u6a94\u6848\u7cfb\u7d71&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#038;&#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-330","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/blog.smallken.site\/index.php?rest_route=\/wp\/v2\/posts\/330","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=330"}],"version-history":[{"count":0,"href":"https:\/\/blog.smallken.site\/index.php?rest_route=\/wp\/v2\/posts\/330\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.smallken.site\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.smallken.site\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.smallken.site\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}