Univention Bugzilla – Bug 31277
UMC module doesn't allow the configuration of quota for the root partition
Last modified: 2014-08-07 17:41:39 CEST
The UMC module currently doesn't work with the partition scheme of a standard UCS installation (i.e. a LVM volume, which spans all available hard disks), since the root partition doesn't allow quota. Currently the root partition isn't even shown in the list of available partitions. It should instead be listed greyed-out. Clicking on it could display the necessary steps to enable quota on the root partition [1] or even configure the needed provisions automatically. [1] - add "root2flags=quota" ro UCR grub/append and reboot - add the "usrquota" stanza to /etc/fstab
(In reply to comment #0) > The UMC module currently doesn't work with the partition scheme of a standard > UCS installation (i.e. a LVM volume, which spans all available hard disks), > since the root partition doesn't allow quota. > > Currently the root partition isn't even shown in the list of available > partitions. It should instead be listed greyed-out. Clicking on it could > display the necessary steps to enable quota on the root partition [1] or even > configure the needed provisions automatically. > > [1] > - add "root2flags=quota" ro UCR grub/append and reboot > - add the "usrquota" stanza to /etc/fstab After installing the recent quota erratum enabling support for ext4, the root partition is correctly displayed. However, after enabling quota support with the steps outlined above, the root partition is correctly shown as having active quota support, but it's not yet possible to configure quota rules for the UMC module, see screenshot
Created attachment 5213 [details] Screenshot of quota module
*** Bug 25415 has been marked as a duplicate of this bug. ***
Requested at ticket #2014051221012319
Created attachment 5912 [details] quota.patch seems only a limitation in the frontend for hardcoded partitions mounted on "/". Attached patch removed the restriction.
fixed. Configuring the root partition is not restricted anymore. YAML: 2014-05-30-univention-quota.yaml
Removing the check is not enough, because the build the initial quota usage statistics "quotacheck" needs to be run to create "/aquota.user". It tries to remount the file-system read-only to get a consistent state; that doesn't work by default for the root filesystem, as lots of processes are running by default and have open files for writing: $ git grep -n quotacheck umc/python/quota/tools.py:180: result = subprocess.call(('/sbin/quotacheck', '-u', partition.mount_point)) # quotacheck -vug / quotacheck: Cannot remount filesystem mounted on / read-only so counted values might not be right. Please stop all programs writing to filesystem or use -m flag to force checking. A quick check shows that adding "-m" works.
univention-quota 8.0.6-3.122.201406101149 On ext* filesystems quotacheck is called with -m if the mountpoint is /. > -m, --no-remount do not remount filesystem read-only On XFS no remount of / is done.
Created attachment 5941 [details] '/' quota activation not working
Created attachment 5942 [details] '/' quota activation working
Does not works for me with ext* (see screenshot): "Failed to activate quota support. Restarting the quota services has failed" Meanwhile, with patched 'quota/tools.py' on another instance (as suggested by Philipp in comment 7) it works (another screenshot): if create: result = subprocess.call(('/sbin/quotacheck', '-um', partition.mount_point)) if result not in [0, 6]: return {'partitionDevice': partition.spec, 'success': False, 'message': _('Generating the quota information file failed')} if subprocess.call(('/usr/sbin/invoke-rc.d', 'quota', 'restart')): return {'partitionDevice': partition.spec, 'success': False, 'message': _('Restarting the quota services has failed')} Both instances have ext4: # /etc/fstab: static file system information. # # <file system> <mount point> <type> <options> <dump> <pass> UUID=b118c268-a34c-4a04-b354-6a99aa8a34cb / ext4 acl,errors=remount-ro,user_xattr,usrquota 0 1 proc /proc proc defaults 0 0 UUID=0282a4bf-e9a9-4570-b756-32a7010f02f9 /boot ext4 defaults,acl,user_xattr,usrquota 0 0
sorry, the check was with the wrong 'univention-quota' package...
Actually, does not work with ext3 and univention-quota 8.0.6-3.122.201406101149 too: root@master091:~# aptitude show univention-quota Paket: univention-quota Zustand: Installiert Automatisch installiert: ja Version: 8.0.6-3.122.201406101149 Priorität: -- Bereich: univention # /etc/fstab: static file system information. # # <file system> <mount point> <type> <options> <dump> <pass> /dev/vda1 / ext3 acl,errors=remount-ro,user_xattr,usrquota 0 1 proc /proc proc defaults 0 0 /dev/xvda3 none swap sw 0 0 The quota for '/' activates, but cannot be set after... Internal module error: An error occured during command processing. Server error message: Failed to modify quota settings for user test_user2 on partition /dev/vda1
Created attachment 5961 [details] failed to set quota for user in the umc
The changes works fine on ext4 filesystems. I did not check ext3 as mentioned in comment 13. REOPEN: After activating on a xfs '/' partition the notification message says quota has been successfully activated. But the UMC module still shows 'deactivated' and i can not configure any quota for the partition. Clicking on 'Refresh' or reopening the module or logout/login does not work either. After rebooting, the quota is shown as activated, but setting a user quota does not work on a xfs '/' partition: The kernel boot parameter 'rootflags=usrquota' has to be added. After fixing this bug, the UCS documentation should be updated (http://docs.univention.de/manual-3.2.html#shares::quota) We should discuss if we restrict the visible users in the Quota module to domain users. Currently, if quota is activated on the '/' partition, 15 users are already shown on a UCS installation without any additional services installed.
Created attachment 5962 [details] user quota module with system users visible
(In reply to Erik Damrose from comment #15) > The kernel boot parameter 'rootflags=usrquota' has to be added. The fstab mount option 'usrquota' does not need to be present for xfs.
(In reply to Erik Damrose from comment #17) > The fstab mount option 'usrquota' does not need to be present for xfs. univention-user-quota relies on the options being present, though.
The option 'rootflags=usrquota' is now added to or removed from the kernel line when (de)activating root partition with XFS. The notification about a system reboot is also shown. univention-quota (8.0.6-5) YAML has been updated.
ucs-test 60_umc-system/50_umc-service-quotas-management runs fine on ext systems. It does not support the necessary reboot for xfs. REOPEN: Translation is incomplete: If i deactivate the quota on a german UCS with xfs i get the following pop-up: "Deaktivierung der Quota-Unterstützung ist fehlgeschlagen: To disable quota support for the root filesystem the system have to be rebooted." The translation is also wrong when activating quota functionality. Please fix the typo: "the system ha_s_ to be rebooted" The message is also not entirely accurate: The (de)activation did not fail, it is not yet completed due to the pending reboot.
(In reply to Erik Damrose from comment #20) > REOPEN: > Translation is incomplete: If i deactivate the quota on a german UCS with > xfs i get the following pop-up: > "Deaktivierung der Quota-Unterstützung ist fehlgeschlagen: To disable quota > support for the root filesystem the system have to be rebooted." > The translation is also wrong when activating quota functionality. The bug here was that the python file had the wrong translation domain, so it always returned the english text! I fixed that, too. > Please fix the typo: "the system ha_s_ to be rebooted" fixed YAML updated. Merged to UCS 4.0 branch.
(In reply to Florian Best from comment #21) > Merged to UCS 4.0 branch. r51439 was missing, i merged it to the 4.0 branch. ok: Merge to UCS 4.0 ok: univention-quota 8.0.6-7 ok: YAML
http://errata.univention.de/ucs/3.2/158.html