Understanding Docker – A Tour of Logical Volume Management

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.

Briefly, it:

  • 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!

 

Currently co-authoring a book on Docker:

Get 39% off with the code 39miell

dip
https://asciinema.org/a/31978?t=60

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.