28 July 2020

LVM, add new partition to extend lv(logical volume)

Concept:

- has 3 logical layer
-- pv(physical volume)
       partition to be use for LVM
-- gv(group volume)
       group of partition(pv) seen as 1 big harddisk. One system/OS could have multiple gv
-- lv(logical volume)
       lv to gv, is as partition to harddisk




To extend partition(lvm), by adding new partition to be part of the lvm

1- create partition on new drive
     

2- register the partition as pv
      pvcreate /dev/sdb1
      pvdisplay



3- add the pv  to be a member of on of the gv
       use vgdisplay to check name existing volume group(vg)

       vgextend _name_of_volume_group_ /dev/sdb1



4-  extend the current lvm to utilize the free space in gv
       lvm to gv is as a partition to harddisk. At this stage, our gv size has increase. So we have oppurtunity to increase size of the lvm base on free size on the gv.

       use lvdisplay to check LV_path

      lvextend -l +100%FREE __LV_path__
        or
       lvextend -L +100G __LV_path__



5- extend filesystem
       resize2fs /dev/mapper/__LV_Name__





ref:
1- https://www.krenger.ch/blog/linux-lvm-how-to-adding-a-new-partition/

No comments:

Post a Comment

Terima kasih