{"id":7387,"date":"2018-05-05T21:03:06","date_gmt":"2018-05-05T13:03:06","guid":{"rendered":"http:\/\/rmohan.com\/?p=7387"},"modified":"2018-05-05T21:03:06","modified_gmt":"2018-05-05T13:03:06","slug":"xfs-centos-7-2","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=7387","title":{"rendered":"xfs centos 7"},"content":{"rendered":"<pre><code>Environment :\r\n\r\n    [root@oel7 ~]# uname -a\r\n    Linux oel7.localdomain 3.8.13-55.1.6.el7uek.x86_64 #2 SMP Wed Feb 11 14:18:22 PST 2015 x86_64 x86_64 x86_64 GNU\/Linux\r\n\r\nSteps :\r\n\r\n    1)  [root@oel7 ~]# df -h\r\n    Filesystem                         Size  Used Avail Use% Mounted on\r\n    \/dev\/mapper\/root_vg-root           5.0G  4.5G  548M  90% \/\r\n\r\n    2)   \r\n\r\nPV \/dev\/sda2   VG root_vg     lvm2 [6.00 GiB \/ 0    free]\r\n\r\n    as here it shows that there is no space left on root_vg volume group, so first i need to extend VG \r\n\r\n    3)  [root@oel7 ~]# vgextend root_vg \/dev\/sdb5\r\n\r\n      Volume group \"root_vg\" successfully extended\r\n\r\n    4)  [root@oel7 ~]# pvscan\r\n\r\n        PV \/dev\/sda2   VG root_vg     lvm2 [6.00 GiB \/ 0    free]\r\n        PV \/dev\/sdb5   VG root_vg     lvm2 [2.00 GiB \/ 2.00 GiB free]\r\n\r\n    5)  Now extend the logical volume \r\n\r\n    [root@oel7 ~]# lvextend -L +1G \/dev\/root_vg\/root\r\n      Size of logical volume root_vg\/root changed from 5.00 GiB (1280 extents) to 6.00 GiB (1536 extents).\r\n      Logical volume root successfully resized\r\n\r\n    6)  [root@oel7 ~]# resize2fs \/dev\/root_vg\/root\r\n\r\n    resize2fs 1.42.9 (28-Dec-2013)\r\n    resize2fs: Bad magic number in super-block while trying to open \/dev\/root_vg\/root\r\n    Couldn't find valid filesystem superblock.\r\n\r\n    as root partition is not a ext* partiton so , you resize2fs will not work for you.\r\n\r\n    7)  to check the filesystem type of a partition \r\n\r\n    [root@oel7 ~]# df -Th\r\n    Filesystem                        Type      Size  Used Avail Use% Mounted on\r\n    \/dev\/mapper\/root_vg-root          xfs       6.0G  4.5G  1.6G  75% \/\r\n    devtmpfs                          devtmpfs  481M     0  481M   0% \/dev\r\n    tmpfs                             tmpfs     491M   80K  491M   1% \/dev\/shm\r\n    tmpfs                             tmpfs     491M  7.1M  484M   2% \/run\r\n    tmpfs                             tmpfs     491M     0  491M   0% \/sys\/fs\/cgroup\r\n    \/dev\/mapper\/data_vg-home          xfs       3.5G  2.9G  620M  83% \/home\r\n    \/dev\/sda1                         xfs       497M  132M  365M  27% \/boot\r\n    \/dev\/mapper\/data_vg01-data_lv001  ext3      4.0G  2.4G  1.5G  62% \/sybase\r\n    \/dev\/mapper\/data_vg02-backup_lv01 ext3      4.0G  806M  3.0G  22% \/backup\r\n\r\n    above command shows that root is an xfs filesystem , so we are sure that we need to use xfs_growfs command to resize the partition.\r\n\r\n    8)  [root@oel7 ~]# xfs_growfs \/dev\/root_vg\/root\r\n\r\n    meta-data=\/dev\/mapper\/root_vg-root isize=256    agcount=4, agsize=327680 blks\r\n             =                       sectsz=512   attr=2, projid32bit=1\r\n             =                       crc=0        finobt=0\r\n    data     =                       bsize=4096   blocks=1310720, imaxpct=25\r\n             =                       sunit=0      swidth=0 blks\r\n    naming   =version 2              bsize=4096   ascii-ci=0 ftype=0\r\n    log      =internal               bsize=4096   blocks=2560, version=2\r\n             =                       sectsz=512   sunit=0 blks, lazy-count=1\r\n    realtime =none                   extsz=4096   blocks=0, rtextents=0\r\n    data blocks changed from 1310720 to 1572864\r\n\r\n    [root@oel7 ~]# df -Th\r\n    Filesystem                        Type      Size  Used Avail Use% Mounted on\r\n    \/dev\/mapper\/root_vg-root          xfs       6.0G  4.5G  1.6G  75% \/<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Environment : [root@oel7 ~]# uname -a Linux oel7.localdomain 3.8.13-55.1.6.el7uek.x86_64 #2 SMP Wed Feb 11 14:18:22 PST 2015 x86_64 x86_64 x86_64 GNU\/Linux Steps : 1) [root@oel7 ~]# df -h Filesystem Size Used Avail Use% Mounted on \/dev\/mapper\/root_vg-root 5.0G 4.5G 548M 90% \/ 2) PV \/dev\/sda2 VG root_vg lvm2 [6.00 GiB \/ 0 free] as here it [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7387"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7387"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7387\/revisions"}],"predecessor-version":[{"id":7388,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7387\/revisions\/7388"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7387"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7387"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}