Bug 2180593 - With util-linux-2.39-0.1.fc39 , the root filesystem is mounted read-only, which breaks just about everything
Summary: With util-linux-2.39-0.1.fc39 , the root filesystem is mounted read-only, whi...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: util-linux
Version: rawhide
Hardware: All
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: openqa
Depends On:
Blocks: F39BetaBlocker
TreeView+ depends on / blocked
 
Reported: 2023-03-21 19:54 UTC by Adam Williamson
Modified: 2023-04-14 16:27 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2023-04-14 16:27:16 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Adam Williamson 2023-03-21 19:54:30 UTC
Since util-linux-2.39-0.1.fc39 was built, almost all openQA Rawhide tests are failing because /var appears to be mounted read-only after installing that update and rebooting. See:

https://openqa.fedoraproject.org/tests/overview?distri=fedora&groupid=2&version=39&build=Update-FEDORA-2023-261bb867d0

Most tests fail trying to run dnf because /var/log is not writeable and dnf wants to write there. KDE tests fail because SDDM can't write to /var/lib/sddm . GNOME tests just get stuck at the boot screen, presumably for a similar reason. etc.

Comment 1 Adam Williamson 2023-03-22 00:27:06 UTC
So, I've reproduced this locally. The reproducer is simply to install a recent Rawhide nightly - like https://kojipkgs.fedoraproject.org/compose/rawhide/Fedora-Rawhide-20230321.n.0/compose/Everything/x86_64/iso/Fedora-Everything-netinst-x86_64-Rawhide-20230321.n.0.iso - download the builds from the util-linux task, update them all, and reboot. There isn't actually a /var partition (in the openQA test or my local reproducer), of course. It's / that's mounted ro.

The output of `mount` shows it as such:

/dev/vda3 on / type btrfs (ro,relatime,seclabel,compress=zstd:1,discard=async,space_cache=v2,subvolid=257,subvol=/root)

the entry in /etc/fstab is just:

UUID=(someuuid) / btrfs subvol=root,compress=zstd:1 0 0

`findmnt --target /` output is very similar to `mount` output:

/ /dev/vda3[/root] btrfs ro,relatime,seclabel,compress=zstd:1,discard=async,space_cache=v2,subvolid=257,subvol=/root

Manually remounting as rw works fine, with `mount -o remount,rw /`. After that it shows as mounted rw and I can touch files in /var/log.

Other filesystems, like /home , are correctly mounted rw. But of course the mechanism there is very different: / is the only filesystem subject to the 'switch root' operation where it's initially mounted as /sysroot in the dracut environment, then gets moved to / in the final booted system.

Comment 2 Adam Williamson 2023-03-22 00:48:30 UTC
This is an automatic F39 Beta blocker per "Bugs which entirely prevent the composition of one or more of the release-blocking images required to be built for a currently-pending (pre-)release" (and probably some of the other criteria too).

Comment 3 Karel Zak 2023-03-23 08:48:06 UTC
I think I see where the problem is. 

The systemd uses "mount -o remount" to remount to read-write. It does not specify "rw" because this flag is expected from fstab (or by default). Unfortunately, the code in libmount does not explicitly add "rw" to the mount options if "ro" is not specified. 

This is not a problem for the classic mount(2) syscall because it does not differentiate between superblock and VFS node, and remount without "ro" is always interpreted as read-write in both layers. 

The new syscalls require two steps to set all layers read-write, fsconfig() to reconfigure the superblock, and mount_setattr() to modify VFS node (mountpoint) flags. Unfortunately, mount_setattr() is not triggered as there is no flag (rw is missing).

You need "findmnt -no TARGET,FS-OPTIONS,VFS-OPTIONS" to see both sets of flags.

Comment 4 Adam Williamson 2023-03-23 15:46:44 UTC
Perhaps systemd doesn't specify it because it won't *always* be rw? You *can* run with an ro root partition, and indeed our ostree-based flavors do that (though I don't know if they actually use the same switch root mechanism in the same way).

Comment 5 darrell pfeifer 2023-03-27 17:46:27 UTC
This results in the boot getting to the fedora logo and waiting forever. The login screen never appears on graphic boot.

Booting at runlevel 3, logging in and running startx works. The remount will work before or after startx.

Comment 6 Adam Williamson 2023-03-27 17:50:12 UTC
darrell: in case you didn't know, we untagged this build from rawhide as this bug is pretty bad. if you somehow got it, it's fine to just downgrade to util-linux-2.38.1-4.fc38 until Karel can fix this.

Comment 7 Pablo Mendez Hernandez 2023-03-28 07:57:17 UTC
In my case I've workarounded it by adding 'rw,' before the defaults entry for the / file system.

Comment 8 Dan Horák 2023-04-03 14:27:42 UTC
for the record I have untagged the build from "eln" to unblock them as well

Comment 9 Adam Williamson 2023-04-04 18:28:29 UTC
This still seems to be a problem with the new util-linux-2.39-0.3.fc39 , at least to some extent. Oddly, the KDE and Workstation tests passed this time, but Server and podman tests still fail with read-only filesystem issues:

https://openqa.fedoraproject.org/tests/overview?build=Update-FEDORA-2023-c437cf6929&version=39&distri=fedora&groupid=2

The difference may be filesystem related. The failing tests use a Server base image, which probably has an xfs root filesystem. The passing tests probably have btrfs root filesystems.

Comment 10 Karel Zak 2023-04-05 10:16:17 UTC
Any suggestions on how to debug it locally? It would be nice to have output from "LIBMOUNT_DEBUG=all" ...

Comment 11 Karel Zak 2023-04-05 15:27:41 UTC
I'm able to reproduce this in a virtual machine.

Comment 12 Karel Zak 2023-04-05 20:20:21 UTC
util-linux-2.39-0.4.fc39 with bugfix (I hope) pushed.

Comment 13 Karel Zak 2023-04-14 09:46:53 UTC
Time to close this one, right?

Comment 14 Adam Williamson 2023-04-14 16:27:16 UTC
Yeah, I haven't seen any problems with the new version. Thanks!


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