Linux – mount a read-only btrfs volume across multiple machines

btrfscoreosdockerlinux

Is it possible to have a single btrfs mounted volume read-only mounted across multiple machines?

Can one of the hosts mount it read/write to provide updates to the others?

The reason I'm asking this is I'm wondering if it's sensible to mount /var/lib/docker to multiple CoreOS instances. What do people do in practice for private clouds? particularly netbooted instances.

Or should I create a unique block device mounted at /var/lib/docker for each physical host and link it to a private registry?

https://coreos.com/docs/cluster-management/setup/mounting-storage/

Best Answer

I can't imagine this would end well. btrfs isn't a cluster filesystem and, even though you're talking about doing read-only mounts, filesystem metadata cached in memory by each node mounting the filesystem will be out of date when the filesystem is written to. Without a cache invalidation mechanism (which a real cluster filesystem would have) you're going to start seeing inconsistencies on the reading nodes.

Related Topic