Thursday, July 19, 2018

Extend your logical volume



 // current scenario - get VG, LV and PV information
# vgs;pvs;lvs

// check the free disks available
# cat /proc/partitions

// So , sdc is available free , do a pvcreate
# pvcreate /dev/sdc
  Physical volume "/dev/sdc" successfully created.

// This should show
# lvmdiskscan -l
   /dev/sdc                                                                             [      10.00 GiB] LVM physical volume



// extend the vg which corresponds to the lv - so here rhel_dhcp43_130 is the VG

# vgextend rhel_dhcp43-130 /dev/sdc


// Now extend the lv - here rhel_dhcp43--130-root is the LV

# lvextend -l +100%FREE /dev/mapper/rhel_dhcp43--130-root
  Size of logical volume rhel_dhcp43-130/root changed from 7.00  GiB (1792 extents) to <17.00 GiB (4351 extents).
  Logical volume rhel_dhcp43-130/root successfully resized.


// Check the size  - hmm..size not changed yet :(

# df -h


// resize underlying filesystem

# xfs_growfs -d /

// hooray - size changed :)

# df -h



No comments:

Post a Comment