-
-
Notifications
You must be signed in to change notification settings - Fork 1
Linux LVM
Mattscreative edited this page Dec 5, 2025
·
2 revisions
Complete beginner-friendly guide to Logical Volume Management (LVM) on Linux, covering Arch Linux, CachyOS, and other distributions including volume groups, logical volumes, and LVM management.
LVM structure:
- Physical Volume (PV): Physical disk/partition
- Volume Group (VG): Collection of PVs
- Logical Volume (LV): Virtual partition
Benefits:
- Flexible sizing: Resize volumes easily
- Multiple disks: Combine multiple disks
- Snapshots: Create volume snapshots
Create PV:
# Install LVM
sudo pacman -S lvm2
# Create physical volume
sudo pvcreate /dev/sda2
# Check
sudo pvsCreate VG:
# Create volume group
sudo vgcreate myvg /dev/sda2
# Check
sudo vgsCreate LV:
# Create logical volume
sudo lvcreate -L 20G -n mylv myvg
# Check
sudo lvsFormat LV:
# Format
sudo mkfs.ext4 /dev/myvg/mylv
# Mount
sudo mount /dev/myvg/mylv /mnt/dataList LVM components:
# List physical volumes
sudo pvs
# List volume groups
sudo vgs
# List logical volumes
sudo lvsRemove LV:
# Unmount first
sudo umount /mnt/data
# Remove logical volume
sudo lvremove /dev/myvg/mylvExtend LV:
# Extend logical volume
sudo lvextend -L +10G /dev/myvg/mylv
# Resize filesystem
sudo resize2fs /dev/myvg/mylvShrink LV:
# Shrink filesystem first
sudo resize2fs /dev/myvg/mylv 20G
# Shrink logical volume
sudo lvreduce -L 20G /dev/myvg/mylvCheck status:
# Check volumes
sudo pvs
sudo vgs
sudo lvs
# Check modules
lsmod | grep dmThis guide covered LVM for Arch Linux, CachyOS, and other distributions, including creation, management, and resizing.
- Filesystem Management - Filesystem setup
- RAID - RAID setup
- Backup and Restore - Backups
- ArchWiki LVM: https://wiki.archlinux.org/title/LVM
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.