{"id":1900,"date":"2023-02-18T10:27:55","date_gmt":"2023-02-18T02:27:55","guid":{"rendered":"http:\/\/www.algmain.com\/?p=1900"},"modified":"2023-02-18T10:30:00","modified_gmt":"2023-02-18T02:30:00","slug":"centos-dev-mapper-centos-root-extend","status":"publish","type":"post","link":"http:\/\/www.algmain.com\/index.php\/2023\/02\/18\/centos-dev-mapper-centos-root-extend\/","title":{"rendered":"CentOS(\/dev\/mapper\/centos-root)\u6269\u5bb9"},"content":{"rendered":"\n<p>\u5728\u5b89\u88c5\u7a0b\u5e8f\u65f6\u9047\u5230\u9519\u8bef\uff1a&#8221;Error 28 : No space left on device&#8221;\u3002\u4f7f\u7528df -h\u547d\u4ee4\u67e5\u8be2\uff0c\u53d1\u73b0\/dev\/mapper\/centos-root\u5df2\u4f7f\u7528\u51e0\u4e4e100%\u3002\u6b64\u65f6\uff0c\u9700\u8981\u5bf9\u8be5\u5206\u533a\u8fdb\u884c\u6269\u5bb9\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\uff081\uff09\u865a\u62df\u673a\u4e0a\u6269\u5bb9<\/h2>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"845\" height=\"659\" src=\"http:\/\/www.algmain.com\/wp-content\/uploads\/2023\/02\/b670d414fc8adec1ada5f9cbdd9513ae.png\" alt=\"\" class=\"wp-image-1901\" srcset=\"http:\/\/www.algmain.com\/wp-content\/uploads\/2023\/02\/b670d414fc8adec1ada5f9cbdd9513ae.png 845w, http:\/\/www.algmain.com\/wp-content\/uploads\/2023\/02\/b670d414fc8adec1ada5f9cbdd9513ae-300x234.png 300w, http:\/\/www.algmain.com\/wp-content\/uploads\/2023\/02\/b670d414fc8adec1ada5f9cbdd9513ae-768x599.png 768w\" sizes=\"(max-width: 845px) 100vw, 845px\" \/><\/figure>\n\n\n\n<p>\u5728\u865a\u62df\u673a\u4e0a\uff0c\u5c06\u78c1\u76d8\u4ece\u539f\u6709\u76846G\u6269\u5bb9\u523060G\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\uff082\uff09\u4f7f\u7528fdisk\u65b0\u5efa\u5206\u533a<\/h2>\n\n\n\n<p>\u4ee5root\u8eab\u4efd\u8fdb\u5165\u7cfb\u7edf\uff0c\u5e76\u8f93\u5165\u547d\u4ee4\u67e5\u770b\u5206\u533a\u60c5\u51b5\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#fdisk -l\n<\/pre><\/div>\n\n\n<p>\u6700\u5927\u5206\u533a\u4e3a\/dev\/sda2\uff0c\u8bf4\u660e\u65b0\u521b\u5efa\u7684\u5206\u533a\u5c06\u4f1a\u662fsda3\uff08\u5728\u540e\u9762\u7684\u6b65\u9aa4\u4f1a\u8fdb\u884c\u9009\u62e9\uff09\u3002<\/p>\n\n\n\n<p>\u8f93\u5165\u547d\u4ee4\u521b\u5efa\u5206\u533a\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#fdisk \/dev\/sda\n<\/pre><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>\u547d\u4ee4\u884c\u63d0\u793a\u4e0b\u8f93\u5165m\uff08\u67e5\u770b\u5e2e\u52a9\u6587\u4ef6\uff09\u3002<\/li>\n\n\n\n<li>\u8f93\u5165\u547d\u4ee4n\uff0c\u6dfb\u52a0\u65b0\u5206\u533a\u3002<\/li>\n\n\n\n<li>\u8f93\u5165\u547d\u4ee4p\uff0c\u521b\u5efa\u4e3b\u5206\u533a\u3002<\/li>\n\n\n\n<li>\u63a5\u8fde\u8f93\u5165\u4e24\u6b21\u56de\u8f66\uff0c\u9009\u62e9\u9ed8\u8ba4\u503c\u3002<\/li>\n\n\n\n<li>\u8f93\u5165\u547d\u4ee4w\uff0c\u4fdd\u5b58\u4fee\u6539\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u8f93\u5165reboot\uff0c\u91cd\u542flinux\u3002\u5fc5\u987breboot\uff0c\u5426\u5219\/dev\/sda3\u65e0\u6cd5\u683c\u5f0f\u5316\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\uff083\uff09<strong>\u6269\u5c55\/dev\/mapper\/centos-root<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1 \u521b\u5efapv\uff08\u7ed9\u521a\u521a\u65b0\u5efa\u7684\u5206\u533a\/dev\/sda3\uff09<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n&#x5B;root@localhost ~]# pvcreate \/dev\/sda3\nPhysical volume &quot;\/dev\/sda3&quot; successfully created\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">2 \u628apv\u52a0\u5165vg\u4e2d\uff0c\u76f8\u5f53\u4e8e\u6269\u5145vg\u7684\u5927\u5c0f<\/h3>\n\n\n\n<p>\u5148\u4f7f\u7528vgs\u67e5\u770bvg\u7ec4<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@localhost ~]# vgs\n  VG     #PV #LV #SN Attr   VSize  VFree\n  centos   1   2   0 wz--n- 19.51g 40.00m\n<\/pre><\/div>\n\n\n<p>\u6269\u5c55vg\uff0c\u4f7f\u7528vgextend\u547d\u4ee4<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n&#x5B;root@localhost ~]# vgextend centos \/dev\/sda3\n  Volume group &quot;centos&quot; successfully extended\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">3 \u6210\u529f\u628avg\u5377\u6269\u5c55\u4e86\uff0c\u5728\u7528vgs\u67e5\u770b\u4e00\u4e0b<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n&#x5B;root@localhost ~]vgs\n VG     #PV #LV #SN Attr   VSize  VFree\n  centos   2   2   0 wz--n- 39.50g 20.04g\n&#x5B;root@localhost ~]# lvs\n  LV   VG     Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert\n  root centos -wi-ao---- 17.47g                                                   \n  swap centos -wi-ao----  2.00g  \u867d\u7136\u6211\u4eec\u628avg\u6269\u5c55\u4e86\uff0c\u4f46\u662flv\u8fd8\u6ca1\u6709\u6269\u5c55\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">4 \u6269\u5c55lv\uff0c\u4f7f\u7528lvextend\u547d\u4ee4<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@localhost ~]# lvextend -L +20G \/dev\/mapper\/centos-root\n  Size of logical volume centos\/root changed from 17.47 GiB (4472 extents) to 37.47 GiB (9592 extents).\n  Logical volume root successfully resized.\n<\/pre><\/div>\n\n\n<p>\u67e5\u770blv\u5927\u5c0f<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n&#x5B;root@localhost ~]# lvs\n  LV   VG     Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert\n  root centos -wi-ao---- 37.47g                                                   \n  swap centos -wi-ao----  2.00g\n<\/pre><\/div>\n\n\n<p>\u67e5\u770bdf&nbsp; -h\u4e2d\u662f\u5426\u53d8\u5316<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n&#x5B;root@localhost ~]# df -h\n\u6587\u4ef6\u7cfb\u7edf                 \u5bb9\u91cf  \u5df2\u7528  \u53ef\u7528 \u5df2\u7528% \u6302\u8f7d\u70b9\n\/dev\/mapper\/centos-root   18G  1.1G   17G    6% \/\ndevtmpfs                 479M     0  479M    0% \/dev\ntmpfs                    489M     0  489M    0% \/dev\/shm\ntmpfs                    489M  6.7M  483M    2% \/run\ntmpfs                    489M     0  489M    0% \/sys\/fs\/cgroup\n\/dev\/sda1                497M  125M  373M   25% \/boot\ntmpfs                     98M     0   98M    0% \/run\/user\/0\n<\/pre><\/div>\n\n\n<p>\u6ca1\u6709\u53d1\u751f\u53d8\u5316\u3002\u4f7f\u7528\u547d\u4ee4\u4f7f\u7cfb\u7edf\u91cd\u65b0\u8bfb\u53d6\u5927\u5c0f\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n&#x5B;root@localhost ~]# xfs_growfs \/dev\/mapper\/centos-root\nmeta-data=\/dev\/mapper\/centos-root isize=256    agcount=4, agsize=1144832 blks\n         =                       sectsz=512   attr=2, projid32bit=1\n         =                       crc=0        finobt=0\ndata     =                       bsize=4096   blocks=4579328, imaxpct=25\n         =                       sunit=0      swidth=0 blks\nnaming   =version 2              bsize=4096   ascii-ci=0 ftype=0\nlog      =internal               bsize=4096   blocks=2560, version=2\n         =                       sectsz=512   sunit=0 blks, lazy-count=1\nrealtime =none                   extsz=4096   blocks=0, rtextents=0\ndata blocks changed from 4579328 to 9822208\n<\/pre><\/div>\n\n\n<p>\u518d\u4f7f\u7528df&nbsp; -h\u67e5\u770b<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n&#x5B;root@localhost ~]# df -h\n\u6587\u4ef6\u7cfb\u7edf                 \u5bb9\u91cf  \u5df2\u7528  \u53ef\u7528 \u5df2\u7528% \u6302\u8f7d\u70b9\n\/dev\/mapper\/centos-root   38G  1.1G   37G    3% \/\ndevtmpfs                 479M     0  479M    0% \/dev\ntmpfs                    489M     0  489M    0% \/dev\/shm\ntmpfs                    489M  6.7M  483M    2% \/run\ntmpfs                    489M     0  489M    0% \/sys\/fs\/cgroup\n\/dev\/sda1                497M  125M  373M   25% \/boot\ntmpfs                     98M     0   98M    0% \/run\/user\/0\n<\/pre><\/div>\n\n\n<p>\u81f3\u6b64\uff0c\u5c31\u6210\u529f\u6269\u5c55\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5b89\u88c5\u7a0b\u5e8f\u65f6\u9047\u5230\u9519\u8bef\uff1a&#8221;Error 28 : No space left on device&#038;#8 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[11,10,53,52],"class_list":["post-1900","post","type-post","status-publish","format-standard","hentry","category-technology","tag-centos","tag-linux","tag-53","tag-52"],"_links":{"self":[{"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/posts\/1900"}],"collection":[{"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/comments?post=1900"}],"version-history":[{"count":2,"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/posts\/1900\/revisions"}],"predecessor-version":[{"id":1903,"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/posts\/1900\/revisions\/1903"}],"wp:attachment":[{"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/media?parent=1900"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/categories?post=1900"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/tags?post=1900"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}