-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
systemd-remount-fs.service fail with composefs enabled #3193
Comments
Cleaning the |
What's in your |
I understand that the remount failed due to |
The general fix here is to use |
Sorry, that should be added during the process when I am trying to workaround the issue myself. I first tried to add the ro and it did not work then I commented the whole line out. The cmdline is
|
I think we'll need to patch systemd for this most likely; there's a bit of a conflict here started from the basic fact that composefs is inherently an overlayfs on top of the underlying real root, and systemd-remount-fs is unaware of this. Let's take as a prerequisite that we have an elegant way for external tooling to "peel" the overlayfs and find the backing filesystem - singular. In theory a composefs (as it's an overlayfs) can span multiple filesystems, but I struggle to think of a realistic use case for that - at least for the root filesystem. The systemd volatile root logic has an ad-hoc symlink it creates...would be nicer to be able to attach this as in-band metadata on the mount somehow. But I guess for our use case, similar to the systemd one we're just handling the single root filesystem so a single well-known symlink is probably OK for now. We then have a tension around the writability of the underlying real root vs the composefs. This issue relates to #3177 a lot. I'd still take the basic stance that it just makes sense to mount the real root writable (if that's the intent) from the initramfs from the start. Probably the most practical change is for systemd-remount-fs to gain some logic for detecting that the root it sees is an overlayfs, and if the backing fileystem matches that defined in |
This is a giant and hacky workaround for ostreedev/ostree#3193 The better real fix is probably in either systemd or anaconda (more realistically both) but let's paper over things here for now. Having code to run as a generator will likely be useful in the future anyways. Signed-off-by: Colin Walters <[email protected]>
This is a giant and hacky workaround for ostreedev/ostree#3193 The better real fix is probably in either systemd or anaconda (more realistically both) but let's paper over things here for now. Having code to run as a generator will likely be useful in the future anyways. Signed-off-by: Colin Walters <[email protected]>
Some code for this in bootc-dev/bootc#417 - but as I said there it's really papering over work we need to do probably in both anaconda and systemd. |
This is a giant and hacky workaround for ostreedev/ostree#3193 The better real fix is probably in either systemd or anaconda (more realistically both) but let's paper over things here for now. Having code to run as a generator will likely be useful in the future anyways. Signed-off-by: Colin Walters <[email protected]>
This is a giant and hacky workaround for ostreedev/ostree#3193 The better real fix is probably in either systemd or anaconda (more realistically both) but let's paper over things here for now. Having code to run as a generator will likely be useful in the future anyways. Signed-off-by: Colin Walters <[email protected]>
Yeah, the |
I forgot to xref here but bootc-dev/bootc#972 landed ➡️ which TL;DR says to use bootc-dev/bootc#971 (comment) So I am closing this here, as I now consider this not an ostree (or composefs) problem directly. That said @keszybz since you are here I am curious if you have any systemd perspective on the previous comment - it'd clearly be nice if systemd-remount-fs did some graceful handling of this, but again as far as I can see it's really best to just use kargs for this as that's the best way to reliably ensure the rootfs is mounted the right way from the start. |
Maybe. Or maybe we should just not touch the root file system if the mount "device" or file system type doesn't match what is listed in |
…ferent is mounted As reported in ostreedev/ostree#3193, when the system has mounted a different file system on "/" than what is configured in /etc/fstab, we still try to execute "mount -o remount /", and that fails because the filesystem that is actually mounted doesn't know about the options relevant for the filesystem listed in /etc/fstab. I don't think it's useful to try to apply options from /etc/fstab if the file system type or device are different. In fact, it could be dangerous or destructive. If the user mounted something different than what the fstab specifies, no matter how exactly, we should leave that mount point alone.
…ferent is mounted As reported in ostreedev/ostree#3193, when the system has mounted a different file system on "/" than what is configured in /etc/fstab, we still try to execute "mount -o remount /", and that fails because the filesystem that is actually mounted doesn't know about the options relevant for the filesystem listed in /etc/fstab. I don't think it's useful to try to apply options from /etc/fstab if the file system type or device are different. In fact, it could be dangerous or destructive. If the user mounted something different than what the fstab specifies, no matter by what means, we should leave that mount point alone. If the filesystem is (potentially) multi-device, we only require the file system type to match.
…ferent is mounted As reported in ostreedev/ostree#3193, when the system has mounted a different file system on "/" than what is configured in /etc/fstab, we still try to execute "mount -o remount /", and that fails because the filesystem that is actually mounted doesn't know about the options relevant for the filesystem listed in /etc/fstab. I don't think it's useful to try to apply options from /etc/fstab if the file system type or device are different. In fact, it could be dangerous or destructive. If the user mounted something different than what the fstab specifies, no matter by what means, we should leave that mount point alone. If the filesystem is (potentially) multi-device, we only require the file system type to match.
As reported in ostreedev/ostree#3193, when the system has mounted a different file system on "/" than what is configured in /etc/fstab, we still try to execute "mount -o remount /", and that fails because the filesystem that is actually mounted doesn't know about the options relevant for the filesystem listed in /etc/fstab. Let's be nice to the user and give a hint if the filesystem specified in fstab doesn't match what is actually mounted. We still want to use the specified configuration for backwards compatibility. But the mismatch is a potential problem, for example when the user forgot to update fstab after updating the boot option or the other way around. By warning, we give the user the chance to notice this, and for example avoid pasting the (non-working) config from fstab into a future boot entry. If the filesystem is (potentially) multi-device, we only require the file system type to match. For my system: $ SYSTEMD_LOG_LEVEL=debug build/systemd-remount-fs ... Note: file system type mounted at "/" doesn't match fstab (type btrfs vs. vfat). Consider adjusting fstab. Remounting /... ... $ SYSTEMD_LOG_LEVEL=debug build/systemd-remount-fs ... Mount device /dev/disk/by-uuid/a9194733-9c5d-4fc6-8342-6c50646a4f58 specified in fstab doesn't exist, /dev/mapper/luks-4481d273-e5d8-4caa-bea7-d8ac9107dae7 is mounted instead. Consider adjusting fstab. Remounting /... Successfully forked off '(remount)' as PID 482420. mount: /: can't find UUID=a9194733-9c5d-4fc6-8342-6c50646a4f58. mount: (hint) your fstab has been modified, but systemd still uses the old version; use 'systemctl daemon-reload' to reload. /usr/bin/mount for / exited with exit status 1.
ostree-prepare-root.conf
:systemctl status systemd-remount-fs.service
Result:
This might be a systemd bug that tried to re-mount the
overlay on / type overlay (ro,relatime,seclabel,lowerdir=/run/ostree/.private/cfsroot-lower::/sysroot/ostree/repo/objects,redirect_dir=on,metacopy=on)
. If you can comfirm this I can file an another issue on systemd repo.The text was updated successfully, but these errors were encountered: