CentOS – Quota Howto

Posted: 17th September 2014 by Thorben Hemmler in CentOS, Serveradministration

Quota installieren

yum install quota

fstab anpassen

#
# /etc/fstab
# Created by anaconda on Wed Feb 26 15:33:49 2014
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/VolGroup-lv_root /                       ext4    defaults        1 1
UUID=80b61fc2-a941-4eda-80e0-92158bd186f8 /boot                   ext4    defaults        1 2
/dev/mapper/VolGroup-lv_swap swap                    swap    defaults        0 0
/dev/mapper/VolGroup-lv_web     /web            ext4    defaults,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0       1 2
/dev/mapper/VolGroup-lv_mysql   /mysql          ext4    defaults        1 1
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0

Verzeichnis neu mounten

mount -o remount /web

Quotacheck ausfürhren

quotacheck -avugm

Hierbei können folgende Meldungen ausgegeben werden (können ignoriert werden)

quotacheck: Scanning /dev/sda2 [/web] done
quotacheck: Cannot stat old user quota file: No such file or directory
quotacheck: Cannot stat old group quota file: No such file or directory
quotacheck: Cannot stat old user quota file: No such file or directory
quotacheck: Cannot stat old group quota file: No such file or directory
quotacheck: Checked 131 directories and 865 files
quotacheck: Old file not found.
quotacheck: Old file not found.

Quota einschalten

quotaon -avug

Einem User die entsprechende Quota geben:

setquota -u testuser -F vfsv0 0 1000000 0 0 /web