Disk user quota is disabled after system reboot due to SELinux

Created:

2017-02-09 06:07:29 UTC

Modified:

2017-08-08 13:24:27 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Disk user quota is disabled after system reboot due to SELinux

Applicable to:

  • Plesk 12.5 for Linux

Symptoms

  • SELinux is enabled.
  • The filesystem user quota gets disabled after each reboot (even if SELinux is disabled):

    # quotaon -pa
    user quota on /home (/dev/mapper/vg-lv_home) is off
  • When trying to modify user quota, Permission denied error is shown:

    # quotaon -a
    quotaon: using //aquota.user on /dev/mapper/vg-lv_home [/]: Permission denied
  • The file context can not be fixed using restorecon utility on a running system:

    # restorecon -Fv /home/aquota.user
    restorecon reset /home/aquota.user context system_u:object_r:etc_runtime_t:s0->system_u:object_r:quota_db_t:s0
    restorecon set context /home/aquota.user->system_u:object_r:quota_db_t:s0 failed:'Operation not permitted'

Cause

Incorrect SELinux context is set to aquota.user and/or aquota.qroup

Resolution

1. Remove usrquota option from /dev/mapper/vg-lv_home in the /etc/fstab file (it will cause the immutable flag removal on the next reboot).
2. Reboot the server.
3. Set the proper SELinux context (the following example is for quotas on /home filesystem):
# semanage fcontext -a -t quota_db_t "/home/aquota.user"

# semanage fcontext -a -t quota_db_t "/home/aquota.group"

# restorecon -Rv /home

4. Add usrquota option on /dev/mapper/vg-lv_home in the /etc/fstab file.
5. Reboot the server again.

Have more questions? Submit a request
Please sign in to leave a comment.