These are your physical disks, or disk partitions, such as /dev/hda or /dev/hdb1. These are what you’d be used to using when mounting/unmounting things. Using LVM we can combine multiple physical volumes into volume groups.
A volume group is comprised of real physical volumes, and is the storage used to create logical volumes which you can create/resize/remove and use. You can consider a volume group as a “virtual partition” which is comprised of an arbitary number of physical volumes.
These are the volumes that you’ll ultimately end up mounting upon your system. They can be added, removed, and resized on the fly. Since these are contained in the volume groups they can be bigger than any single physical volume you might have. (ie. 4x5Gb drives can be combined into one 20Gb volume group, and you can then create two 10Gb logical volumes.)
apt-get update && apt-get install lvm2
Once we’ve initialised the partitions, or drives, we will create a volume group which is built up of them:
vgcreate storm /dev/md0
If you’ve done this correctly you’ll be able to see it included in the output of:
Create your first logical volume:
lvcreate -n data --size 300g storm
Your new logical volume will be accessible via:
/dev/storm/data # or /dev/mapper/storm-data
Create file system:
Show created volumes and their sizes:
lvextend -L+10g /dev/storm/data
After resizing you should resize the filesystem:
e2fsck -f /dev/storm/data resize2fs /dev/storm/data
If you need some visual help you can use: “system-config-lvm” utility co configure LVM.
First thing to say it’s a kind of RAID0; if you have the need of a single big partition but you have only multiple smaller disks, you have the possibility to crate a LVM-stripe over all your smaller disks.
In this example I have 4x 4TiB devices which will be used to create a single one with 16TiB
pvcreate /dev/sdb /dev/sdc /dev/sde /dev/sdd # verify with: vgdisplay to verify
lvcreate -l 100%FREE -n storage backups # to verify: lvdisplay
Create a filesystem on your 16TiB device:
mkfs.xfs -L storage /dev/mapper/storage-bacula