0

How do I add 100% of the available free space from the volume group "centos" to the root logical volume? What tool do I use to resize the root logical volume.

Below are the steps performed prior to this question.

root@server1 ~]# vgs

  VG     #PV  #LV #SN Attr Vsize Vfree

centos    1    2   0  wz--n- 6.98g 0

root@server1 ~]# pvcreate /dev/sdb

Physical volume "/dev/sdb" successfully created

root@server1 ~]# vgextend centos /dev/sdb

Volume group "centos" successfully created


root@server1 ~]# vgs


  VG     #PV  #LV #SN Attr Vsize Vfree

centos    2    2   0  wz--n- 7.46g 496.00m




root@server1 ~]# lvs

  LV     VG   Attr      LSize

 root   centos -wi-a0   6.18g

 swap   centos -wi-a0   820.00m
Aaron
  • 2,859
  • 2
  • 12
  • 30

1 Answers1

2

You can issue lvextend centos/root -l +100%FREE, than you must use the appropriate filesystem resize utility tool. For example, if using XFS, you should issue xfs_grow /; on the other hand, if using EXT4, you should use resize2fs /dev/centos/root

Anyway, before doing anything, TAKE BACKUPS

shodanshok
  • 47,711
  • 7
  • 111
  • 180
  • 1
    I find adding `--resizefs` to my LVM resize operations convenient. One command for the several file system types supported by `fsadm`. – John Mahowald Jul 09 '17 at 04:24
  • "Thanks" for the suggestions but this seems to be differed from the predefined answers of a simulator exercise I am trying to complete. i have tried lvextend with FREE options, resizefs, xfs_grow but no luck – user424157 Jul 09 '17 at 16:35
  • The same question can have multiple solution. Anyway, this site is not about asking about your homework/exercise. I'll vote to close. – shodanshok Jul 10 '17 at 05:51