coreos / fedora-coreos-tracker

Issue tracker for Fedora CoreOS
https://fedoraproject.org/coreos/
264 stars 59 forks source link

Mount root filesystem as readonly instead of adding immutable attribute #1812

Open yummypeng opened 1 month ago

yummypeng commented 1 month ago

Describe the enhancement

I'm curious why Fedora CoreOS adds an immutable attribute to the root directory / instead of just mounting the root device as read-only. I tried changing the kernel cmdline from rw to ro myself, and didn't see any problems; the system booted fine, and I could still install packages using rpm-ostree.

System details

No response

Additional information

No response

jbtrystram commented 1 month ago

This is solved by the recent enablement of composefs, which should hit stable very soon (next release, so in a couple of weeks) https://docs.fedoraproject.org/en-US/fedora-coreos/composefs/

As to why the immutable bit rather than ro, it's probably for some historical reasons.. i did a quick search and I did not find an abvious answer, so I'll let someone else answer .

Maybe it's for https://github.com/coreos/rpm-ostree/issues/337 but i am not sure

yummypeng commented 1 month ago

@jbtrystram, could you please provide an update on this issue? We're considering mounting the root filesystem read-only in our production Fedora CoreOS environment, and we need to fully understand the potential drawbacks before proceeding. What are the specific added risks associated with this change? A detailed explanation of the increased risks involved would be greatly appreciated. 🫶

jbtrystram commented 1 month ago

As I mentioned, the root will be read-only by default in the next release through a composefs mount. Do you need it sooner ?

yummypeng commented 1 month ago

Okay, thanks for the feedback. Thing is, our product is still running on the older Fedora CoreOS 33, so I'm wondering what would happen if I changed rw to ro in the kernel cmdline on that version.

dustymabe commented 1 month ago

Okay, thanks for the feedback. Thing is, our product is still running on the older Fedora CoreOS 33, so I'm wondering what would happen if I changed rw to ro in the kernel cmdline on that version.

You're running a 3.5 year old release with no security updates since 2021 so you might as well YOLO it and find out?