A Tour of Logical Volume Management
If you’re using Docker on a RedHat or CentOS based distribution you may have come across logical volume management (LVM). This are used to manage the disk space Docker containers take up and have a number of interesting features. LVM is an abstraction of physical disk to give you more flexibility around allocating and managing the disk space
Learning LVM does not come without challenges, so if you encounter problems with Docker disk usage on this platform it can be useful to take a step back and understand some of the basics of LVM.
To this end I’ve created this introductory video which takes you through the basics of LVM up to creating some thinly-provisioned volumes.
Source available here.
The video was created using ShutIt, an automation tool.
- Assigns a disk to the LVM to manage
- Sets up a volume group
- Within this volume group, creates and removes a couple of volumes
- Creates a thin pool
- Places two thinly-provisioned volumes within this thin pool (ie these volumes take up space only when written to)
- Tries to write a file that exceeds one of the volumes’ virtual sizes
- Extends this volume so that the file can be created
- Successfully writes the file
There were some odd corner cases I hit that I couldn’t explain while working with LVM – if you are an expert on LVM, please get in touch!