Logical Volume Manager
Today I used LVM (Logical Volume Manager) on a personal project for the first time. I had come across it before and even had to use it for attaching new drives but I had never set it up before and so hadn't taken the time to understand it. So far, I love it.
What is LVM?
LVM is a tool for managing physical disks and filesystems. The main benefit of LVM is that your filesystems can be backed by multiple disks and can be freely resized and even moved between storage devices.
There are three main concepts in LVM;
These are the physical disks (or disk-like) devices at the very bottom.
# List physical volumes sudo pvs
Physical volumes are grouped together into volume groups. This middle layer allows you to easily add and remove disks from a volume group without having to worry to much about which filesystems are using them.
# List volume groups sudo vgs
Volume groups are sliced up into logical volumes. These are equivalent to disk partitions but on steroids!
# List logical volumes sudo lvs
I lot of what I read I found really confusing. As usual, DigitalOcean had some great resources. I should learn to search DigitalOcean first.
- An Introduction to LVM Concepts, Terminology, and Operations
- How To Use LVM To Manage Storage Devices
- The Complete Beginner's Guide to LVM in Linux
Useful related commands
# lists block devices. Always useful as a first step to see what is there. sudo lsblk