Sample Header Ad - 728x90

Separate default configurations and my own changes with a layered FS : /Data/etc/ upper layer in RO and /etc/ lower layer in RW?

0 votes
1 answer
75 views
I wish to separate the default packages configuration files (/etc/), and the configuration files I edited e.g. in /Data/etc/ (normally should be /usr/local/etc/, but let assume /Data/etc/). This to enable me to easily see the modifications I made, to easily back it up, etc. Therefore, I was wondering it was possible to mount /etc/ as : - upper layer FS in RO : /Data/etc/ - lower layer FS in RW : itself (/etc/). The package manager would make its changes in /etc/ like normal. But when I add a file in /Data/etc/, e.g. /Data/etc/foo, I wish to then have a /etc/foo file in RO that will shadow any existing /etc/foo. Note: - physical links aren't possible as /Data and /etc will be in different FS. - symbolic links would be troublesome : e.g. if a symlink is deleted when updating a package, requires to automatically create a symlink for each files in /Data/etc/, etc. - mount --bind would be troublesome for the same reason. - some packages does look at /usr/local/etc/ for extra-configuration files, but unfortunately, not all. However, I failed to see how to do so with UnionFS/AuFS/OverlayFS/etc. I am also open to alternative solutions/ideas.
Asked by Denis Migdal (3 rep)
May 1, 2024, 06:56 PM
Last activity: May 6, 2024, 01:35 PM