Sharing mounts between containers on Proxmox 4.3 and later

I’m a big fan of Proxmox and have been using it for many years to manage containers (now LXC, formerly OpenVZ) as well
as KVM machines.

On a recently provisioned build server, I had a situation where I wanted to share a directory between
multiple containers. This is quite simple to do: you can either configure it via the web interface or
edit the container’s configuration file under /etc/pve/lxc/:

mp0: /path/on/host,mp=/path/on/container

Problem: partitioning

What I did find a little less straight forward however, was partitioning.

On my Proxmox installation, the root partition, where the directory was situated was only 90GB. This is
usually enough for templates and ISOs. Proxmox uses LVM2 by default, so I tried to simply lvextend the
root partition, but this didn’t work. Since Proxmox 4.3, LVM thin provisioning is now used, which limits
the number of extents available for expanding root. This has been done to allow more resources to be
provisioned than available, which wasn’t possible under the old scheme.

One of the reasons why I wanted to ensure that files were visible on the host was so that our backup
tool, Bacula, which performs file based backups could access the files. Recent versions of Proxmox no
longer expose a container’s filesystem via /var/lib/vz which means that files created under containers
were no longer being automatically backed up.