LVM logical volumes quick start

Create lvm volume on a disk or raid partition..

Create or initialize a physical volume on md2..
pvcreate /dev/md2

Create a volume group called vg1..
vgcreate vg1 /dev/md2

Create a 500G logical volume called data in the vg1 group..
lvcreate -L 500G vg1 -n data

View info about volumes..

Remove a logical volume..
lvremove vg1/data

Make a filesystem on logical volume..
mkfs.ext4 /dev/vg1/data

Now its ready to mount and use in the usual way, for example by adding a line like this to your /etc/fstab

/dev/mapper/vg1-data /data ext4 defaults 0 0

Then mount with..

mount /data


Looking for great online sysadmin training in Linux, Security & Hacking and many others?