Bug 2332319

Summary: Switch from /etc/fstab to root= and rootflags= (at least for bootc installs)
Product: [Fedora] Fedora Reporter: Colin Walters <walters>
Component: anacondaAssignee: anaconda-maint
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 42CC: anaconda-maint, edu.redhat-bz, elavarde, jkonecny, kkoukiou, travier, voj-tech, w
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Colin Walters 2024-12-13 19:04:28 UTC
See https://github.com/containers/bootc/issues/971

TL;DR things work better if we don't use /etc/fstab for the root filesystem for bootc, but we use the root=<UUID> and rootflags= kernel arguments for the rootfs.

There's also the case of /boot but that's less important.

See https://github.com/containers/bootc/pull/417 where I did an elaborate workaround at the time and really should have filed this bug to get it fixed.

Reproducible: Always

Comment 1 Colin Walters 2024-12-16 14:08:30 UTC
There are two workarounds here today:

If you only have the default mount options in `/etc/fstab`, then you can just safely delete the line from `/etc/fstab`.

If you have non-default mount options, then from an Anaconda installed system, run e.g. `rpm-ostree kargs --append=rootflags=<mount options>`. For example with Btrfs, one might set `rootflags=compress=zstd:1`. Then you can delete the `/etc/fstab` line.

Comment 2 Aoife Moloney 2025-02-26 13:19:58 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.

Comment 3 Jiri Konecny 2025-03-06 10:28:33 UTC
I think the path forward here, should be to have support for both. At least for a while.

The question is what should be there... We already have rootflags
https://github.com/rhinstaller/anaconda/blob/main/pyanaconda/modules/payloads/payload/rpm_ostree/installation.py#L581
for btrfs subvolumes but the question is what else should be there. Is rootflags related to fstab options or what values are supported?

Comment 4 Timothée Ravier 2025-03-17 17:12:31 UTC
Ideally it would be for all options set for the root (/) mount point. For btrfs we have compression as well for example.

See also: https://gitlab.com/fedora/ostree/sig/-/issues/72

Comment 5 Colin Walters 2025-03-18 00:46:10 UTC
> I think the path forward here, should be to have support for both. At least for a while.

You mean write both /etc/fstab *and* synthesize a rootflags= kernel argument? That wouldn't really help as we'd still end up with a failing systemd-remount-fs.

Or just make it configurable...somehow? My initial thought was we'd just do this by default for all ostree systems but given I think we actually do want this behavior elsewhere too, we should probably find a nice way to opt-in. One thing I could imagine here is we introduce /usr/share/anaconda/image-defaults.ks or something (or a toml/json/whatever) that can live in the target root. That content could come from e.g. fedora-release or a base container image config.

> Ideally it would be for all options set for the root (/) mount point. For btrfs we have compression as well for example.

Yes, to build on top of the above we need to stop using /etc/fstab for /, so it has to have all relevant mount options.

Comment 6 Eric Lavarde 2025-03-20 10:21:15 UTC
I must admit that I probably don't oversee the big picture as you do, but isn't this a bit overkill?

My solution to avoid the failing systemd-remount-fs is simply to add `ro` to the options of root aka / in `/etc/fstab`.