Mounting Filesystem over existing directory

ralda at gmx.de ralda at gmx.de
Wed May 30 09:23:42 UTC 2012


Hi Eduardo !

> Yes that's possible just bind mount a tmpfs dir. So create a tmpfs
> somewhere eg. /tmpfs then mount -o bind /tmpfs /etc.

This is incorrect. If you mount a file system this way you replace the
original contents of the directory with contents of the new file system.

The question was to merge the contents of the two file systems. You
either need to fiddle with symlinks, or need to copy original content
to a tmpfs and mount that on /etc, or you need to use a union file
system (which is not part of the standard kernel).

Consider using aufs. I had really success with using this one, without
any problems in practical use. Problems only arrive when you bypass the
aufs layer and try to fiddle with the contents of he underlying file
systems. It is a really nasty thing to have default contents on a read
only file system (or image) and have a copy on write file system on top
of the read only system. This allows you to change the contents of any
file on the fly even if the rest is still on read only file system.
With some thought you may even backup your modified files and restore
after boot. The Live CD of SystemRescueCd system (and other Linux live
CD systems) use this type of mounting.

--
Harald


More information about the busybox mailing list