How to Create LVM in Linux Step by Step
1. Add the new disk As Per requirement in your VM. ( I have add 5GB Disk Space for create the LVM. )
2. create a new Partition using fdisk tool and select partition type LVM :
[root@rajeev ~]# lsblk
[root@rajeev ~]# fdisk /dev/vdb
[root@rajeev ~]# partprobe /dev/vdb
[root@rajeev ~]# cat /proc/partitions
3. Initializes the partition /dev/vdb1 as an LVM physical volume :
[root@rajeev ~]# pvcreate /dev/vdb1
Physical volume "/dev/vdb1" successfully created.
4. Displaying Physical Volumes : ( You Can Use Any One Command. )
[root@rajeev ~]# pvs /dev/vdb1
5. Create volume group name myvg and add /dev/vdb1 partition into the group.
[root@rajeev ~]# vgcreate myvg /dev/vdb1
Volume group "myvg" successfully created
6. Creates a logical volume called lv_myvg that uses all of the unallocated space in the volume group vg_newlvm :
[root@rajeev ~]# lvcreate -l 100%FREE -n lv_myvg myvg
Logical volume "lv_myvg" created.
7. Use the mkfs command to format a newly created LVM :
[root@rajeev ~]# mkfs.ext4 /dev/myvg/lv_myvg
8. Create the mount point and mount the new LVM :
Comments
Post a Comment