Mounting Filesystem over existing directory

Eduardo Tongson propolice at gmail.com
Wed May 30 08:16:42 UTC 2012


On Wed, May 30, 2012 at 6:46 AM, Sameer Naik
<sameer.subscriptions at damagehead.com> wrote:
> Hello,
>
> I have a rather unusual query.
>
> Consider that i have a readonly filesystem mounted at / and that the
> /etc folder consists of some files. Is is possible to mount a ramfs
> filesystem at /etc such that the existing files in the /etc partition
> are still accessible and any new files written to the /etc partition
> are saved in the ramfs (which will be lost upon reboot).
>
> To illustrate the query visually.
>
> $ ls /etc
>  fstab mtab
>
> $ (mount ram filesystem at /etc)
> $ ls /etc
>   fstab mtab
>
> $ touch /etc/file
> $ ls /etc
> fstab mtab file
>
> $ umount /etc
> $ ls /etc
>   fstab mtab
>
> I hope this helps you understand my query.
>
> Thanks and Regards
> ~Sameer
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox

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


More information about the busybox mailing list