"Reverse union" mount possible?
tarkhil at over.ru
Thu Nov 20 03:41:46 PST 2003
stating man mount(8)
union Causes the namespace at the mount point to appear as the
union of the mounted file system root and the existing
directory. Lookups will be done in the mounted file sys-
tem first. If those operations fail due to a non-exis-
tent file the underlying directory is then accessed. All
creates are done in the mounted file system.
Is it somehow possible, or how complex patch will require to get "reverse union" mount, with first lookup in underlying system, and file creation there as well?
In case I'm trying to invent a square wheel, here is the problem:
I need to create several jails with as many common files as possible, and with ability to update software in all jails at once as well as in specific jails.
Right now, I'm readonly mount_null'ing /bin, /sbin, /usr/bin, /usr/sbin, /usr/lib, /usr/include, /usr/libexec, /usr/share. With a dozen jails, there are too many mounts to my liking, and about twice a week I experience panic. Probabily it's nullfs-related.
I think that reverse-union mounting (over nfs, for stability, but that doesn't really matter) common tree can help me a lot.
mount -o runion 127.0.0.1:/usr/jail/common /usr/jail/jail1
mount -o runion 127.0.0.1:/usr/jail/common /usr/jail/jail2
etc will reduce mounting and make possible to update software in common subtree for all jails as well as in each particular jail.
Please point me to my mistakes ;-)
More information about the freebsd-fs