Say, we initially have /
with the following contents:
/bin/foo
/usr/bin/bar
/usr/lib/libfoo.so
We also have another directory, say /stuff
, with the contents:
usr/lib/mystuff/mystuff.so
etc/foo/qux/buzz
bin/stuff
Is there a way to create a union between /
and /stuff
, so that I get:
/bin/foo
/bin/stuff
/usr/bin/bar
/usr/lib/libfoo.so
/usr/lib/mystuff/mystuff.so
/etc/foo/qux/buzz
(with all of the content from /stuff
there as well, just not shown there.)
This union should be of a temporary nature (just like filesystem mounts are), otherwise I could have used cp
, mv
or rsync
as well.
How should I go about doing this?
One would expect that an answer to this would be easy to find; and indeed, there are many online resources that mention creating unions between two directories and mount them elsewhere, but none really cover this particular case of mounting a directory "over" /
.
rsync
as the tool of choice. Your question has been discussed many times, on may places online. Please see the command syntax on the duplicate post. – MelBurslan Jul 08 '16 at 15:34/
); and if I try to adapt the resources I did find to my case they either don't work or emit strange errors. – Jul 08 '16 at 16:02