Understanding how /etc is handled in Silverblue


I’m trying to understand how /etc works in Silverblue.

I found out that the original file are in /usr/etc, and that ostree admin config-diff can list a diff of the files in etc.

I was surprised however to find that /etc seems to be a hardlink to /ostree/deploy/fedora/xxx/etc, which means that I can write to /ostree/deploy.

For instance, I tried echo hello | sudo tee -a /etc/foo.
Then cat /ostree/deploy/fedora/xxx/deploy/etc/foo outputs hello, which was a surprise.

I guess my question is, how is /etc managed in Silverblue, for instance, can I commit my changes in /etc?

Each deployment has its own independent copy of /etc. So e.g. when you rollback you’re also rolling back to the previous deployment’s /etc.

When you upgrade, the defaults of the new deployment are merged with your current /etc so that modifications you’ve made are kept.

The directories in /ostree/deploy/fedora/deploy represent all the deployments your system currently has (those should be as many as what rpm-ostree status shows).

So yes, it’s completely safe to modify files in /etc. :slight_smile:

Thanks for the explanation.

Can I somehow commit the changes in /etc and get a new deployment?