physical volume with LVM

LVM (Logical Volume Manager) Creation on Redhat/Cent0s 7

Logical Volume Manager is basically used for resizing the file systems. We can simply add disk to the systems and can create LVM partition with this method. To accomplished, we need physical volume , volume group.

Physical Volume : This is a small disk partition we do cut from  the raw disk available on the system like dev/sd{b1,b2,b3..} and so on.

Volume Group :  this is a combination of physical volume which makes a volume group which helps us to create a LVM partition. If we require extra space to add in LVM , just increase the size in Volume group then extend the LVM partition.

Check Out :Resizing LVM Partition

Note: when you format a disk with file system keep remember you use the same file system to format the disk like xfs and ext4.

In the same way create partition

We have created partition /dev/sdb2 and /dev/sdb3

Now create Physical Volume with /dev/sdb2 and in the same way do with /dev/sdb3

pvcreate /dev/sdb2

pvcreate /dev/sdb3

If you want to check physical volume created

pvdisplay

Now you have to crate volume group and it will come both physical volume

vgcreate  vg_test  /dev/sdb2  /dev/sdb3

Vgdisplay

lvcreate -n  lv_test –size 3M vg_test

To check volume group created ,

Vgs

if you check in fdisk it will show you the LVM has been created

Now you have to format this partition

mkfs.ext4 /dev/mapper/vg_test-lv_test

Make a directory and edit fstab entry

vim /etc/fstab

Run mount –a

Now check disk will be added

df –TH

You’re done

Sponsored

LEAVE A REPLY

Please enter your comment!
Please enter your name here