We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on Vesta 2.0 and expect to release it by the end of 2024. Read more about it: https://vestacp.com/docs/vesta-2-development
[HOWTO] fix centos7 quota system on a xfs filesystem Topic is solved
[HOWTO] fix centos7 quota system on a xfs filesystem
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
edit /etc/fstab and replace the mount options from something like this
to this
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
backup the current grub file and rebuild it.
reboot the machine.
you may confirm that quotas are enabled if you see the usrquota option when listing your parititions.
vesta's quota system is managed by a script located at
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
now that quotas are enabled, and the script is fixed, you must set the limits for each of your users.
you may confirm that a user has limits by checking the xfs_quota reports
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.
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 /
Code: Select all
UUID=partition-id / xfs defaults,usrquota,grpquota,and-other-opts 0 0
Code: Select all
UUID=partition-id / xfs defaults,uquota 0 0
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"
Code: Select all
cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.bkp
grub2-mkconfig -o /boot/grub2/grub.cfg
you may confirm that quotas are enabled if you see the usrquota option when listing your parititions.
Code: Select all
mount | grep xfs
Code: Select all
/usr/local/vesta/bin/v-update-user-quota
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
Code: Select all
/usr/local/vesta/bin/v-update-user-quota user1
/usr/local/vesta/bin/v-update-user-quota user2
Code: Select all
xfs_quota -x -c 'report -h' /
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.
Re: [HOWTO] fix centos7 quota system on a xfs filesystem
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
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