Linux 101 : LVM, Physical Volumes - PV -, Volume Groups - VG - and Logical Volumes - LV -

Using the LVM:

We start by creating two Linux partition on our disk "/dev/sdb" as below:

We have our two partitions "/dev/sdb1" and "/dev/sdb2".

Physical volumes:

We create the physical volumes using the below command:

We can then check if they were created using the below command:

Volume groups:

We create the volume group using the two partitions:

We could check our volume group using the below command:

Logical volumes:

Then, we create a logical volumes of 500 MB named "volume-1" from our volume group:

We can check our logical volume using the below command:

After creating our logical volume, we can create an "ext4" filesystem on it, to make it usable:

We then mount our volume on the directory "volume-mountpoint":

To survive a reboot, we would have to add our newly created volume in the "/etc/fstab" file:


Leave as a comment: