How to create LVM partition in linux, LVM is a logical volume manager it manages disk drivers and similar mass-storage devices.

The commands used in LVM are,

  • Physical Volume = pv
  • Volume Group = vg
  • Logical Volume = lv
 Step 1: Find the disk volume using fdisk -l, ex: /dev/sdb
Step 2: Create Phycial volume
# pvcreate /dev/sdb
Step 3: Create Voume Group
# vgcreate vg0 /dev/sdb
vg0: Volume group name can be any name
Step 4: Create Logical Volume
# lvcreate -l 100%FREE -n lv0 vg0
100%FREE: Utilizing 100% of the disk space
lv0: Logical Volume name can be any name
Step 5: Format the disk with ext3 or ext4 filesystem
#mkfs.ext3 /dev/vg0/lv0
#mkfs.ext4 /dev/vg0/lv0 (for RHEL 6)
Step 6: Add fstab entry for permanent mount
#vi /etc/fstab
/dev/vg0/lv0   /data    ext3    default   0 0
/data: Directory
ext3:  File system type
Step 7: mount the disk
#mount /dev/vg0/lv0 /data
#mount -a