lvm

Linux Logical Volume Manager tools

TLDR

Start interactive shell
$ sudo lvm
Initialize physical volume
$ sudo lvm pvcreate /dev/sda1
Display physical volumes
$ sudo lvm pvdisplay
Create volume group
$ sudo lvm vgcreate vg1 /dev/sda1
Display volume groups
$ sudo lvm vgdisplay
Create logical volume
$ sudo lvm lvcreate -L 10G vg1
Display logical volumes
$ sudo lvm lvdisplay

SYNOPSIS

lvm [command [OPTIONS]]

DESCRIPTION

lvm is the Linux Logical Volume Manager, providing flexible disk management through physical volumes (PVs), volume groups (VGs), and logical volumes (LVs). It enables dynamic resizing, snapshots, mirroring, and striping.

PARAMETERS

pvcreate

Initialize a physical volume
pvdisplay
Display physical volume information
vgcreate
Create a volume group
vgdisplay
Display volume group information
lvcreate
Create a logical volume
lvdisplay
Display logical volume information
lvextend
Extend a logical volume
lvreduce
Reduce a logical volume
pvs
Report information about physical volumes
vgs
Report information about volume groups
lvs
Report information about logical volumes
pvremove
Remove a physical volume
vgremove
Remove a volume group
help command
Display help for a specific command
-d, --debug
Enable verbose debugging output (repeat up to 6 times to increase)
-v, --verbose
Set verbose level (repeat from 1 to 3 to increase)
-t, --test
Run in test mode (don't update metadata)
-y, --yes
Answer yes to all confirmation prompts

INSTALL

sudo apt install lvm2
sudo dnf install lvm2
sudo pacman -S lvm2
sudo apk add lvm2
sudo zypper install lvm2
nix profile install nixpkgs#lvm2

CAVEATS

LVM requires physical volumes to be initialized before use. Reducing volumes requires careful handling to avoid data loss. Some operations require the logical volume to be unmounted.

HISTORY

LVM2 is the second major version of the Linux Logical Volume Manager, providing enterprise-grade storage management capabilities.

SEE ALSO

lvcreate(8), lvextend(8), vgcreate(8), pvcreate(8), pvs(8), vgs(8), lvs(8)