How to Create a LVM Logical Volume in Linux

First we need to create the Physical Volume.  Change “/dev/sda2” to your drive.

pvcreate /dev/sda2

Next we create the Volume Group.  You can change “VGname” to something else if you so desire.

vgcreate VGname /dev/sda2

And finally, create the Logical Volume.  The Logical Volume’s name will be home.  Change as needed.

lvcreate -l %100FREE -n home VGname

The above command will create a Logical Volume that uses all the free space avaliable in the Volume Group.  If you want the Logical Volume to be a specific size,  change “-l 100%FREE” to “-L 60G”.  Where “60G” is the size in GB.
Example:

lvcreate -L 60G -n home VGname

Your Logical Volume should be setup now.  You can list all your Logical Volumes with

lvdisplay

You may need to format the new logical volume to mount it.  Replace VGname and LVname for the Volume Group name and the Logical Volume name.

mkfs.ext4 /dev/VGname/LVname

Mount it with

mount /dev/VGname/LVname /mount/point