Sample Header Ad - 728x90

Mount directory onto root

7 votes
3 answers
15444 views
I have a folder containing certain files. Is there a way to mount it onto /, so that the contents of a given directory appear in the corresponding locations in /? In my case, the directories contain the files related to an application -- it does not have directories like /dev and /proc. I tried creating a bind mount in the following manner: mount --bind ~/applications/firefox / However, this does not do anything at all. Unlike what has been speculated in the comments, it does not have any adverse effect either. --- The motivation for this is that I have a number of custom applications that I want to install cleanly on mission-critical systems. Understandbly, I want to keep the related management to a minimum. I obtain the filesystem layout of the application install with a [unionfs-fuse + chroot method](https://unix.stackexchange.com/questions/140599/chroot-jail-that-can-access-the-filesystem) , but then I still have to deal with the problem of the applications' files mingling with those of the system. Mounting certain directories onto / would help me to keep the filesystem clean. While this method of installing software may seem perverted, there is a distro named "Porteus" which installs software in exactly this manner (and for the same reasons), however, they are known to use a patched kernel along with aufs. However, I cannot use a custom kernel on the systems.
Asked by user48923
May 30, 2015, 11:57 AM
Last activity: Mar 4, 2020, 10:09 AM