LVM - Logical Volume Management
Table of Contents
Overview
LVM stands for Logical Volume Manager. These pages describe LVM 2.
Tons of information is available in the LVM HOWTO
To display information about your LVM setup use:
pvscanto displayphysical volumesset up for LVMvgscanto displayvolume groupsdefined onphysical volumeslvscanto displaylogical volumesdefined involume groups.
You create your filesystems in logical volumes.
Physical Volumes
server:# pvscan PV /dev/hdc3 VG VOL2 lvm2 [94.04 GB / 91.04 GB free] PV /dev/hda3 VG VOL1 lvm2 [94.04 GB / 94.04 GB free] PV /dev/md0 VG RAID lvm2 [139.69 GB / 115.74 GB free] Total: 3 [327.76 GB] / in use: 3 [327.76 GB] / in no VG: 0 [0 ] server:#
Here are 3 physical partitions:
/dev/hda3for volume groupVOL1/dev/hdc3for volume groupVOL2/dev/md0for volume groupRAID(on aRAIDstorage device)
Volume Groups
Physical volumes are assembled in volume groups.
Here 3 volume groups exist: RAID, VOL1, and VOL2.
server:# vgscan Reading all physical volumes. This may take a while... Found volume group "VOL2" using metadata type lvm2 Found volume group "VOL1" using metadata type lvm2 Found volume group "RAID" using metadata type lvm2 server:#
Logical Volumes
Logical Volumes contain your filesystems and are created in volume groups.
Here are the three volume groups shown using lvscan.
server:# lvscan ACTIVE '/dev/VOL2/TMP' [3.00 GB] inherit ACTIVE '/dev/RAID/HOME' [2.10 GB] inherit ACTIVE '/dev/RAID/USR' [9.70 GB] inherit ACTIVE '/dev/RAID/VAR' [10.00 GB] inherit ACTIVE '/dev/RAID/USRLOCAL' [1.00 GB] inherit ACTIVE '/dev/RAID/ROOT' [152.00 MB] inherit ACTIVE '/dev/RAID/VS-SSH' [1.00 GB] inherit server:#
Here are the logical volumes defined in the volume groups.
VOL1is emptyVOL2hasTMPfor/tmp
RAIDhasHOMEfor/homeUSRfor/usrVARfor/varUSRLOCALfor/usr/localROOTfor/VS-SSHfor a virtual server/var/lib/vservers/ssh