0

I'm anticipating a number of almost heterogenous VMs. They will have the same installed applications but different configurations and application data.

It seems to me that it's probably possible for them to all share a /usr and diverge elsewhere in the filesystem.

Is this a sensible approach? I imagine /usr would then be a network drive, but then would these VMs still be able to boot?

Or is there a more sensible way to achieve the same goal? A fully-shared copy-on-write (i.e. reference-counted) filesystem, maybe? Or something else entirely? This is with CentOS on VirtualBox.

1

It's been done in the past (and a common argument for the / vs /usr separation).

he current recommendation (and in many distros, a requirement) is that your initramfs needs to mount /usr if it's separate from /. Most Linux systems already use an initramfs to prepare the root filesystem, and it can be easily extended for /usr as well. Since it's really a full OS on its own, it can easily be configured to set up networking and mount /usr over NFS or SMB.

That said, remember that many packages install files outside /usr as well – e.g. directly to /bin (if your distribution hasn't merged it yet), or /var/lib, or /etc. Make sure to correctly replicate those across all VMs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.