Tim Miller isn’t a “storage guy” but he wrote a pair of “Linux Interlude” posts focusing on filesystem layouts, LVM, and Docker that are well worth reading. He starts with this bit about making a future-proof Linux filesystem layout in A Brief Linux Interlude – Partitions, Logical Volumes, and Layouts:
To avoid those calamities with the default filesystem layout, I’ve built my own layout – none of which is terribly original as most of the structure follows guidelines from days long gone by. Given the twitches I outlined above, you might have guessed that the layout looks something like (no matter how big the system drive is):
- (physical partition) /boot : 1GB
- / : 10 GB
- /var : 10 GB
- /tmp : 5 GB
- /home : 20 GB
Then we learn more about why all this matters in Another Linux Interlude – Provisioning logical volumes for Docker. Here we see his preferred LVM/Docker layout:
- /dev/sda1 : /boot (1GB)
- /dev/sda2 : LVM partition for hostVG (rest of space)
- rootLV : / (10GB)
- varLV : /var (10GB)
- tmpLV : /tmp (5GB)
- homeLV : /home (20GB)
Since I’m looking to add space to support Docker images, I need to be worried about the /var/lib/docker directory tree. For one container image and instance, 10GB might be fine. As I indicate in that other blog post though, running out of space in /var isn’t good. Let’s go ahead and add a new logical volume (LV) so that we protect the rest of /var and can keep an eye on Docker space consumption.
The whole thing is really worth reading!