LVM
stands for Logical Volume Management
To initialize a drive as a physical volume
we use the pvcreate
command. For example if you have the drive /dev/sdX
you could use the command.
sudo pvcreate /dev/sdX
You can view your physical volumes and info about them with
sudo pvdisplay
You can view your physical volumes with
pvs
You also might to resize physical volume after resizing a partition, this can be done with the pvresize
.
sudo pvresize /dev/sdX
To create a volume group use the command
sudo vgcreate bucket /dev/sdX /dev/example
Here I am calling the volume group bucket
. And I am using some physical volumes to create it.
You can view and see info about you Volume Groups
with the command
sudo vgdisplay
You can also view them with
sudo vgs
To remove a volume group, you can use the command
sudo vgremove bucket
To create a Logical Volume
use the command.
sudo lvcreate -L 15G -n bit bucket