root mount options from /etc/fstab are not taken into account anymore with composefs (symptom: `systemd-remount-fs.service` fails to start)
## Symptom
The `systemd-remount-fs.service` service fails to start:
```
Apr 11 11:25:25 fedora systemd-remount-fs[837]: mount: /: fsconfig system call failed: overlay: No changes allowed in reconfigure.
Apr 11 11:25:25 fedora systemd-remount-fs[837]: dmesg(1) may have more information after failed mount system call.
Apr 11 11:25:25 fedora systemd[1]: Starting systemd-remount-fs.service - Remount Root and Kernel File Systems...
Apr 11 11:25:25 fedora systemd[1]: systemd-remount-fs.service: Main process exited, code=exited, status=1/FAILURE
Apr 11 11:25:25 fedora systemd[1]: systemd-remount-fs.service: Failed with result 'exit-code'.
Apr 11 11:25:25 fedora systemd[1]: Failed to start systemd-remount-fs.service - Remount Root and Kernel File Systems.
```
## Workaround
* If you want to keep using or enable on-demand zstd compression for your main btrfs partition, update your kernel arguments to match what's in your `/etc/fstab`:
```
$ grep 'root' /etc/fstab
# UUID=... / btrfs subvol=root,compress=zstd:1,ro 0 0
$ cat /proc/cmdline
... rootflags=subvol=root ...
$ sudo rpm-ostree kargs --delete=rootflags=subvol=root --
append=rootflags=subvol=root,compress=zstd:1
```
* Then comment the entry for `/` in your `/etc/fstab`. Make sure that any future changes to the root mount point options are added to the kernel command line.
* Reboot for the changes to apply.
## Original issue
With composefs in F42 (https://gitlab.com/fedora/ostree/sig/-/issues/35), the mount options set for the root filesystem in /etc/fstab are not taken into account anymore as `/` is now an overlay mount point.
One notable option on default Atomic Desktops installation in zstd compression for btrfs: https://fedoraproject.org/wiki/Changes/BtrfsTransparentCompression
```
silverblue@fedora:~$ cat /etc/fstab
# /etc/fstab
# Created by anaconda on Wed Feb 12 13:48:11 2025
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
# Updated by bootc-fstab-edit.service
UUID=15200db3-8480-4c87-93de-7127a3cb1315 / btrfs subvol=root,compress=zstd:1,ro 0 0
UUID=ff7188f3-e5e5-44c5-8763-93b7ef13a27e /boot ext4 defaults 1 2
UUID=523B-489E /boot/efi vfat umask=0077,shortname=winnt 0 2
UUID=15200db3-8480-4c87-93de-7127a3cb1315 /home btrfs subvol=home,compress=zstd:1 0 0
UUID=15200db3-8480-4c87-93de-7127a3cb1315 /var btrfs subvol=var,compress=zstd:1 0 0
silverblue@fedora:~$ sudo journalctl -u bootc-fstab-edit.service
Feb 13 14:14:50 fedora bootc[702]: Updated /etc/fstab to add `ro` for `/`
```
Options:
- Mask [systemd-remount-fs.service](https://www.freedesktop.org/software/systemd/man/latest/systemd-remount-fs.service.html) and rely on kernel command line arguments only.
- We would have to create something that does a one time sync of `/etc/fstab` options to the kernel command line to migrate existing systems.
- New systems need to have those options added as kargs by Anaconda.
- This is not ideal as all custom `/proc`, `/sys`, etc. custom mount options would also be ignored.
- Teach systemd-remount-fs.service to properly remount /sysroot instead of `/`.
See:
- https://github.com/bootc-dev/bootc/issues/971
- https://bugzilla.redhat.com/show_bug.cgi?id=2348934
- https://bugzilla.redhat.com/show_bug.cgi?id=2332319
- https://github.com/fedora-iot/iot-distro/issues/81
issue