redhat-lvm-tool

Graphical tool :

yum install system-storage-manager

Example:

At our Virtualbox machine we want to resize the VDI disk and extend our LVM volume Group in order to use this new room.

First we check if really exist:

[luser@Zen7oS ~]$ sudo vgdisplay
  --- Volume group ---
  VG Name               centos
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               14,62 GiB
  PE Size               4,00 MiB
  Total PE              3743
  Alloc PE / Size       1791 / <7,00 GiB
  Free  PE / Size       1952 / 7,62 GiB
  VG UUID               qw6G4d-ayYf-sxlA-Eil3-Vw0g-pFGK-XHLy0I

[luser@Zen7oS ~]$

now list the path to point the new room to the LV Path

[luser@Zen7oS ~]$ sudo lvdisplay
  --- Logical volume ---
  LV Path                /dev/centos/swap
  LV Name                swap
  VG Name                centos
  LV UUID                Z4K4gZ-x0WS-VbzW-eOLv-Rvjv-oNyo-vYa91s
  LV Write Access        read/write
  LV Creation host, time localhost, 2019-09-09 16:36:50 +0200
  LV Status              available
  # open                 2
  LV Size                820,00 MiB
  Current LE             205
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:1

  --- Logical volume ---
  LV Path                /dev/centos/root
  LV Name                root
  VG Name                centos
  LV UUID                8ctoRq-TF0g-S1fZ-wvtj-0QJv-dulZ-f457Ni
  LV Write Access        read/write
  LV Creation host, time localhost, 2019-09-09 16:36:50 +0200
  LV Status              available
  # open                 1
  LV Size                <6,20 GiB
  Current LE             1586
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:0

[luser@Zen7oS ~]$

And resize doing:

[luser@Zen7oS ~]$ sudo lvextend -L+5G /dev/centos/root
  Size of logical volume centos/root changed from <6,20 GiB (1586 extents) to <11,20 GiB (2866 extents).
  Logical volume centos/root successfully resized.

[luser@Zen7oS ~]$

And now we can tell ths FS has to grow: (if the FS is in other format you'll have to adapt to it [resize2fs /dev/centos/var])

[luser@Zen7oS ~]$ sudo xfs_growfs /dev/centos/root
meta-data=/dev/mapper/centos-root isize=512    agcount=4, agsize=406016 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0 spinodes=0
data     =                       bsize=4096   blocks=1624064, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 1624064 to 2934784
[luser@Zen7oS ~]$

Now you can use the neww free space:

[luser@Zen7oS ~]$ df -h
S.ficheros              TamaƱo Usados  Disp Uso% Montado en
devtmpfs                  3,9G      0  3,9G   0% /dev
tmpfs                     3,9G      0  3,9G   0% /dev/shm
tmpfs                     3,9G   9,0M  3,9G   1% /run
tmpfs                     3,9G      0  3,9G   0% /sys/fs/cgroup
/dev/mapper/centos-root    12G   5,4G  5,9G  48% /
/dev/sda1                1014M   205M  810M  21% /boot
tmpfs                     783M      0  783M   0% /run/user/1003
tmpfs                     783M      0  783M   0% /run/user/1002
tmpfs                     783M   4,0K  783M   1% /run/user/0
[luser@Zen7oS ~]$