Creating LVM

I need to create an LVM manually.

Related tags: Linux

Credit: Original Poster

Use pvcreate to initialize the physical volume and tell it what drives/partitions to use

pvcreate /dev/sda1 /dev/sda2

Use vgcreate to create a named volume group from those same drives/partitions

vgcreate root_vg /dev/sda1 /dev/sda2

Use lvcreate to create the logical volume on the volume group(Using 100% of the free space)

lvcreate -l 100%FREE -n root_lv root_vg

Then apply whatever file system you want to the logical volume

mkfs.ext4 -L / /dev/root_vg/root_lv

Rating: 3666

Propose a different solution...