Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Dev Section Modification & Patches
  • Search

[HOWTO] fix centos7 quota system on a xfs filesystem Topic is solved

Section with modification and patches for Vesta
Post Reply
  • Print view
Advanced search
2 posts • Page 1 of 1
bberg
Posts: 4
Joined: Sun Jun 14, 2015 12:03 am

[HOWTO] fix centos7 quota system on a xfs filesystem
  • Quote

Post by bberg » Mon Oct 05, 2020 7:38 am

centos7 seems to use xfs for the root filesystem (/) by default.
if you install vesta with the quota option enabled, this will cause errors.

vesta will change the fstab, adding mount options that are unknown to xfs.
when you boot with those options on, the root filesystem will be mounted read-only and services will not start.

here's the fix:

if your root filesystem is already mounted read-only, remount it

Code: Select all

mount -o remount,rw partition-id /
edit /etc/fstab and replace the mount options from something like this

Code: Select all

UUID=partition-id / xfs defaults,usrquota,grpquota,and-other-opts 0 0
to this

Code: Select all

UUID=partition-id / xfs defaults,uquota 0 0
the fstab option is not enough to enable quota on that partition.
you need to add kernel grub parameter to your grub configuration.
edit /etc/default/grub and append rootflags=uquota to GRUB_CMDLINE_LINUX
it may look like this

Code: Select all

GRUB_CMDLINE_LINUX="console=tty0 crashkernel=auto net.ifnames=0 console=ttyS0 rootflags=uquota"
backup the current grub file and rebuild it.

Code: Select all

cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.bkp
grub2-mkconfig -o /boot/grub2/grub.cfg
reboot the machine.

you may confirm that quotas are enabled if you see the usrquota option when listing your parititions.

Code: Select all

mount | grep xfs
vesta's quota system is managed by a script located at

Code: Select all

/usr/local/vesta/bin/v-update-user-quota
this script calls the setquota command to set users limits, but xfs uses the xfs_quota command.
append this line to the end of the script, but before logging

Code: Select all

test ! "$quota" == 'unlimited' && xfs_quota -x -c "limit -u bsoft=${quota}m bhard=${quota}m $user" $mnt
now that quotas are enabled, and the script is fixed, you must set the limits for each of your users.

Code: Select all

/usr/local/vesta/bin/v-update-user-quota user1
/usr/local/vesta/bin/v-update-user-quota user2
you may confirm that a user has limits by checking the xfs_quota reports

Code: Select all

xfs_quota -x -c 'report -h' /
and that's it.
future updates may replace this script, so you must keep an eye on it.

warning: editing fstab and grub may break your system. use caution.
Top

dlozev
Posts: 8
Joined: Mon Sep 16, 2019 8:39 pm

Os: CentOS 6x
Web: apache + nginx
Re: [HOWTO] fix centos7 quota system on a xfs filesystem
  • Quote

Post by dlozev » Sun Aug 14, 2022 11:26 pm

Thanks! That working.
But I have a problem with editing /etc/default/grub. When I tried to edit it as root, I receved error: Permission denied

OS: CentOS 7
Top


Post Reply
  • Print view

2 posts • Page 1 of 1

Return to “Modification & Patches”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

cron

Login  •  Register

I forgot my password