The Linux Logical Volume Manager (LVM) has been around for many years, providing a level of abstraction between the logical disks seen by the system and the physical disks within the system.
Originally, the commands used to examine Physical Volumes, Volume Groups and Logical volumes were, respectively,
lvdisplay. Those commands still exist, but they can produce a lot of output.
For some time now there have been alternative versions of those commands that give much less output, and which are useful to know about.
The Physical Volumes are the disks underlying the Logical Volumes. We can see a summary of them with the
PV VG Fmt Attr PSize PFree
/dev/md0 vg_monnow lvm2 a-- 223.44g 0
/dev/md1 vg_monnow lvm2 a-- 1.82t 350.81g
Here, we can see that there are two “physical” disks,
md1. In this case, the names tell us that those “disks” are actually Multiple Device (
md) RAID sets.
The Logical Volumes within LVM are collated in one or more Volume Groups, We can see a summary of them with the
VG #PV #LV #SN Attr VSize VFree
vg_monnow 2 12 0 wz--n- 2.04t 350.81g
In this case – as if often case with simpler systems – there is only one Volume Group,
Lastly, the Logical Volumes themselves, which we can see with the
LV VG Attr LSize Pool [...]
home vg_monnow -wi-ao---- 150.00g
mail vg_monnow -wi-ao---- 100.00g
root vg_monnow -wi-ao---- 10.00g
swap vg_monnow -wi-ao---- 4.00g
Here we can see four Logical Volumes, all of which are members of the
vg_monnow Volume Group.
These commands are quick and simple to use. They hide a great deal of underlying detail, but often the overview of the LVM subsystem that they provide is sufficient.
Could This Linux Tech Tip Be Improved?
Let us know in the comments below.