Description
After a fresh linuxmuster-setup run, quotaon@srv.service fails at every boot:
× quotaon@srv.service - Enable File System Quotas
Active: failed (Result: exit-code)
Process: 976 ExecStart=/usr/sbin/quotaon -ug /srv (code=exited, status=2)
quotaon[976]: quotaon: using . on /dev/sdb1 [/srv]: File exists
quotaon[976]: quotaon: using . on /dev/sdb1 [/srv]: File exists
systemd[1]: quotaon@srv.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
systemd[1]: Failed to start quotaon@srv.service - Enable File System Quotas.
Root cause
/srv (/dev/sdb1) came out of curtin/mke2fs with the modern ext4 on-disk
quota feature (tune2fs -O quota) already enabled - confirmed from the
customer's setup log:
#### Checking quota feature on /dev/sda2 ....................... Enabled! ####
#### Checking quota feature on /dev/sdb1 ....................... Enabled! ####
Both root (/dev/sda2) and /srv (/dev/sdb1) already had the feature
active before linuxmuster-setup ever ran, so e_fstab.py's
check_quota_features() never called enable_ext4_quota() for either.
Once the on-disk feature is active, the kernel auto-activates quota
tracking as soon as the filesystem is mounted - before any quotaon call
runs. e_fstab.py's own mask_redundant_quotaon_units() already handled
this for root (masking quotaon-root.service/quotaon.service), but
assumed root was the only filesystem that could ever have the on-disk
feature ("it's the only filesystem that ever gets the on-disk feature
here"). That assumption doesn't hold on installers/images whose mke2fs
defaults already bake the quota feature into every ext4 filesystem, not
just root - so systemd's own generated quotaon@srv.service unit is left
unmasked and keeps trying (and failing) to turn on what the kernel already
turned on, at every boot.
Fix
Fixed by 5bb7f7e (fix/quotaon-nonroot-ondisk-quota, merged in 5444a89):
mask_redundant_quotaon_units() now takes the ext4_mounts list and, for
every non-root mount whose device already has the on-disk quota
feature (checked via tune2fs -l), masks that mount's specific
quotaon@<escaped-mount>.service instance (name resolved via
systemd-escape --path). Mounts still on the older external
aquota.user/aquota.group mechanism are left untouched, since those
genuinely need quotaon to run after every boot.
Released in 7.4.17.
Remediation for already-affected installs
The fix only takes effect on the next full linuxmuster-setup run, which
isn't something to ask a customer to redo just for this. Manual
workaround for an already-provisioned server:
# quota is already active kernel-side regardless of the failed unit
quotaon -p -u /srv
quotaon -p -g /srv
repquota /srv
sudo systemctl mask quotaon@srv.service
sudo systemctl reset-failed quotaon@srv.service
🤖 Generated with Claude Code
Description
After a fresh
linuxmuster-setuprun,quotaon@srv.servicefails at every boot:Root cause
/srv(/dev/sdb1) came out of curtin/mke2fs with the modern ext4 on-diskquota feature (
tune2fs -O quota) already enabled - confirmed from thecustomer's setup log:
Both root (
/dev/sda2) and/srv(/dev/sdb1) already had the featureactive before
linuxmuster-setupever ran, soe_fstab.py'scheck_quota_features()never calledenable_ext4_quota()for either.Once the on-disk feature is active, the kernel auto-activates quota
tracking as soon as the filesystem is mounted - before any
quotaoncallruns.
e_fstab.py's ownmask_redundant_quotaon_units()already handledthis for root (masking
quotaon-root.service/quotaon.service), butassumed root was the only filesystem that could ever have the on-disk
feature ("it's the only filesystem that ever gets the on-disk feature
here"). That assumption doesn't hold on installers/images whose
mke2fsdefaults already bake the
quotafeature into every ext4 filesystem, notjust root - so systemd's own generated
quotaon@srv.serviceunit is leftunmasked and keeps trying (and failing) to turn on what the kernel already
turned on, at every boot.
Fix
Fixed by 5bb7f7e (
fix/quotaon-nonroot-ondisk-quota, merged in 5444a89):mask_redundant_quotaon_units()now takes theext4_mountslist and, forevery non-root mount whose device already has the on-disk
quotafeature (checked via
tune2fs -l), masks that mount's specificquotaon@<escaped-mount>.serviceinstance (name resolved viasystemd-escape --path). Mounts still on the older externalaquota.user/aquota.groupmechanism are left untouched, since thosegenuinely need
quotaonto run after every boot.Released in
7.4.17.Remediation for already-affected installs
The fix only takes effect on the next full
linuxmuster-setuprun, whichisn't something to ask a customer to redo just for this. Manual
workaround for an already-provisioned server:
# quota is already active kernel-side regardless of the failed unit quotaon -p -u /srv quotaon -p -g /srv repquota /srv sudo systemctl mask quotaon@srv.service sudo systemctl reset-failed quotaon@srv.service🤖 Generated with Claude Code