Bug 2332319 - Switch from /etc/fstab to root= and rootflags= (at least for bootc installs)
Summary: Switch from /etc/fstab to root= and rootflags= (at least for bootc installs)
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: 42
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: anaconda-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-12-13 19:04 UTC by Colin Walters
Modified: 2025-05-06 22:45 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)

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`.


Note You need to log in before you can comment on or make changes to this bug.