-1

I have 119Gb in sda2, but centos_template--centos7-root is only 27.8Gb, how can I increase it?

[root@runner~]# lsblk -o NAME,FSTYPE,LABEL,SIZE,MOUNTPOINT
NAME                              FSTYPE      LABEL  SIZE MOUNTPOINT
sda                                                  120G
├─sda1                            xfs                  1G /boot
└─sda2                            LVM2_member        119G
  ├─centos_template--centos7-root xfs               27.8G /
  └─centos_template--centos7-swap swap               3.2G [SWAP]
DobreMihaela
  • 41
  • 1
  • 6
  • It would be faster to just google the question. Try `xfs_growfs`. However, in your case you also need to extend the logical volume, which is done with `lv_extend` or `lv_resize`. – berndbausch May 18 '21 at 05:15

3 Answers3

1

To increase the size of your lv you have to first use lvextend command to increase the size of logical volume:

lvextend -L NEW_Size /dev/vg-group-name/lv-name

then you have to xfs_growfs to increase the size of an xfs filesystem:

xfs_growfs -d /dev/vg-group-name/lv-name

asmath
  • 319
  • 1
  • 6
0

lvextend -L NEW_Size /dev/vg-group-name/lv-name

then you have to xfs_growfs to increase the size of an xfs filesystem:

xfs_growfs -d /dev/vg-group-name/lv-name

Astroman
  • 11
  • 2
0

Just imagine you want to extend 5G:

#lvextend -L +5G /dev/mapper/vggroup_name-lv_name -r (intro)

with the -r you can spare the command xfs_grow (-r will do its job). Do not forget the + simbol in the 5G ---> -L +5G

  • Does this add anything to the accepted answer? – asmath May 27 '21 at 15:46
  • The approach of my answer is adding an amount of Gigas (+5G i.e.), not like the other ones reaching a new size (for instance 200G). For that reason my post adds anything new to the previous answers. – LinuxDoesMatter Jun 08 '21 at 12:15