Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1009122: systemd-quotacheck : does not work on root file system

325 views
Skip to first unread message

Laurent Bonnaud

unread,
Apr 7, 2022, 9:50:04 AM4/7/22
to
Package: systemd
Version: 247.3-7

Dear maintainers,

this system has quotas configured on the root file system. I would like to check quotas, but I cannot do it while the system is running because there are active processes using the file system.

Therefore I tried to do it during boot, and added this parameter to the kernel command line:

quotacheck.mode=force

Unfortunately it does not work and I get the following error:

# journalctl | grep quota
Apr 07 05:01:28 hostname kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-5.16.0-6-amd64 root=UUID=3d817555-5d7c-4e8e-8a65-c80a673dc806 ro quotacheck.mode=force quiet
Apr 07 05:01:28 hostname kernel: Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.16.0-6-amd64 root=UUID=3d817555-5d7c-4e8e-8a65-c80a673dc806 ro quotacheck.mode=force quiet
Apr 07 05:01:28 hostname kernel: VFS: Disk quotas dquot_6.6.0
Apr 07 05:01:28 hostname kernel: EXT4-fs (sdb2): re-mounted. Opts: usrquota,grpquota. Quota mode: writeback.
Apr 07 05:01:29 hostname systemd-quotacheck[492]: quotacheck: Cannot remount filesystem mounted on / read-only so counted values might not be right.
Apr 07 05:01:29 hostname systemd-quotacheck[492]: Please stop all programs writing to filesystem or use -m flag to force checking.
Apr 07 05:01:29 hostname systemd-quotacheck[491]: (quotacheck) failed with exit status 1.
Apr 07 05:01:29 hostname systemd[1]: systemd-quotacheck.service: Main process exited, code=exited, status=1/FAILURE
Apr 07 05:01:29 hostname systemd[1]: systemd-quotacheck.service: Failed with result 'exit-code'.

Would it be possible for the systemd-quotacheck unit to be executed when the file system is still mounted read-only and before it is remounted read-write?

Thanks,

--
Laurent.

Michael Biebl

unread,
Apr 7, 2022, 10:20:03 AM4/7/22
to
Am 07.04.22 um 15:38 schrieb Laurent Bonnaud:

> Would it be possible for the systemd-quotacheck unit to be executed when
> the file system is still mounted read-only and before it is remounted
> read-write?

I guess you'd have to use dracut instead of initramfs-tools then.



OpenPGP_signature

Laurent Bonnaud

unread,
Apr 7, 2022, 11:50:04 AM4/7/22
to
On 4/7/22 16:10, Michael Biebl wrote:

> I guess you'd have to use dracut instead of initramfs-tools then.

Thanks for the suggestion!

I tested dracut on another system and I still get a similar error:

# journalctl | grep quota
Apr 07 17:28:40 debian kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-5.10.0-13-amd64 root=/dev/mapper/debian--vg-root ro quotacheck.mode=force quiet
Apr 07 17:28:40 debian kernel: Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.10.0-13-amd64 root=/dev/mapper/debian--vg-root ro quotacheck.mode=force quiet
Apr 07 17:28:40 debian kernel: VFS: Disk quotas dquot_6.6.0
Apr 07 17:28:40 debian dracut-cmdline[130]: Using kernel command line parameters: rd.lvm.lv=debian-vg/root rd.lvm.lv=debian-vg/swap_1 resume=/dev/mapper/debian--vg-swap_1 root=/dev/mapper/debian--vg-root rootfstype=ext4 rootflags=rw,relatime,errors=remount-ro BOOT_IMAGE=/boot/vmlinuz-5.10.0-13-amd64 root=/dev/mapper/debian--vg-root ro quotacheck.mode=force quiet
Apr 07 17:28:41 debian kernel: EXT4-fs (dm-0): re-mounted. Opts: usrquota,errors=remount-ro
Apr 07 17:28:41 debian systemd[1]: systemd-quotacheck.service: Main process exited, code=exited, status=1/FAILURE
Apr 07 17:28:41 debian systemd[1]: systemd-quotacheck.service: Failed with result 'exit-code'.
Apr 07 17:28:41 debian systemd-quotacheck[487]: (quotacheck) failed with exit status 1.
Apr 07 17:28:41 debian systemd-quotacheck[490]: quotacheck: Cannot remount filesystem mounted on / read-only so counted values might not be right.
Apr 07 17:28:41 debian systemd-quotacheck[490]: Please stop all programs writing to filesystem or use -m flag to force checking.

--
Laurent.

Michael Biebl

unread,
Apr 7, 2022, 12:10:05 PM4/7/22
to
Am 07.04.22 um 17:37 schrieb Laurent Bonnaud:
Hm, ok. Is this error message from systemd-quotacheck from the initramfs
or from the real system?
OpenPGP_signature

Laurent Bonnaud

unread,
Apr 7, 2022, 12:50:03 PM4/7/22
to
On 4/7/22 18:06, Michael Biebl wrote:

> Hm, ok. Is this error message from systemd-quotacheck from the
> initramfs or from the real system?

I do not know how to tell. However I got it to work nevertheless by adding the "ro" mount option in /etc/fstab for the root file system (which the Debian installer does not do).

root@debian:~# systemctl status systemd-quotacheck
● systemd-quotacheck.service - File System Quota Check
Loaded: loaded (/lib/systemd/system/systemd-quotacheck.service; static)
Active: active (exited) since Thu 2022-04-07 18:30:40 CEST; 1min 14s ago
Docs: man:systemd-quotacheck.service(8)
Process: 233 ExecStart=/lib/systemd/systemd-quotacheck (code=exited, status=0/SUCCESS)
Main PID: 233 (code=exited, status=0/SUCCESS)
CPU: 26ms

And it works both with initramfs-tools and dracut.

Perhaps it could be documented somewhere (other than this bug report :>) or even better suggested by systemd-quotacheck in case of failure?

Thanks again or your help!

--
Laurent.

Laurent Bonnaud

unread,
Apr 8, 2022, 4:40:03 AM4/8/22
to
On 4/7/22 18:41, Laurent Bonnaud wrote:

> However I got it to work nevertheless by adding the "ro" mount option
> in /etc/fstab for the root file system

This "solves" the quotacheck problem, but unfortunately it has many other negative consequences, such as:

Apr 08 05:01:29 hostname systemd[1]: swapfile.swap: Swap process exited, code=exited, status=255/EXCEPTION
Apr 08 05:01:29 hostname systemd[1]: swapfile.swap: Failed with result 'exit-code'.
Apr 08 05:01:29 hostname systemd[1]: Failed to activate swap /swapfile.

Apr 08 05:01:30 hostname systemd-tmpfiles[522]: rm_rf(/tmp): Read-only file system

Apr 08 05:01:30 hostname systemd[539]: systemd-timesyncd.service: Failed to set up mount namespacing: /run/systemd/unit-root/dev: Read-only file system
Apr 08 05:01:30 hostname systemd[539]: systemd-timesyncd.service: Failed at step NAMESPACE spawning /lib/systemd/systemd-timesyncd: Read-only file system

Such this "solution" can only be used as a "one shot" trick followed by a proper reboot with a rw file system.

--
Laurent.

Michael Biebl

unread,
Jul 4, 2022, 6:40:03 PM7/4/22
to
Control: tags -1 + upstream
I assume you are using stable.
Can you please test, if you can still reproduce this with v250 from
bullseye-backports and if so, report this upstream at
https://github.com/systemd/systemd/issues

Thanks,
Michael
OpenPGP_signature
0 new messages