How to setup user quotas ?

Started by Administrator, September 09, 2014, 09:59:48 PM

Previous topic - Next topic

PakPos


takuda

How to make Disk Quota Setup for AWS Amazon on Centos 7.9?, please help me

utkuweb

[root@srv ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs         16G     0   16G   0% /dev
tmpfs            16G     0   16G   0% /dev/shm
tmpfs            16G   17M   16G   1% /run
tmpfs            16G     0   16G   0% /sys/fs/cgroup
/dev/md1        893G  3.5G  890G   1% /
tmpfs           3.2G     0  3.2G   0% /run/user/0
[root@srv ~]# cat /etc/fstab
/dev/md1 / xfs rw,relatime,attr2,inode64,sunit=1024,swidth=2048,noquota 0 0
/dev/md1 / xfs rw,relatime,attr2,inode64,sunit=1024,swidth=2048,noquota 0 0
/dev/md1 / xfs rw,relatime,attr2,inode64,sunit=1024,swidth=2048,noquota 0 0


What should I do?

anandmys

User panel shows account using 38GB (With -855MB in file system) while admin panel shows 18GB usage



cyberspace

Did you check real disk usage using "du", repquota, etc ? Are there some files located outside of the account and owned by your user ?

anandmys

my /etc/fstab/ contains

#
# /etc/fstab
# Created by anaconda on Mon Aug 19 17:42:13 2024
#
# 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.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
/dev/sda4 / xfs rw,seclabel,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota 0 0
UUID=37e38df4-28dc-4d9c-acb5-1a2fd7e6130b /boot                   xfs     defaults        0 0
UUID=3F31-DBA5          /boot/efi               vfat    defaults,uid=0,gid=0,umask=077,shortname=winnt 0 2
/swap swap swap sw 0 0


quota not working. What should be done?


overseer


anandmys

Quote from: Administrator on September 09, 2014, 09:59:48 PM
XFS: In some cases, you would also need to modify grub conf if the above fails

# mount | grep ' / '
/dev/mapper/cl-root on / type xfs (rw,relatime,attr2,inode64,noquota)



If you see "noquota" in the xfs mount options for the / partition then you would need to modify file: /etc/default/grub
Find the line with the variable "GRUB_CMDLINE_LINUX" and at end of the line add: "rootflags=uquota,pquota"

Example:
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb quiet rootflags=uquota,pquota"

Make backup and create grub config for boot
cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.orig
grub2-mkconfig -o /boot/grub2/grub.cfg
echo xfs > /usr/local/cwp/.conf/quota_type.conf


now reboot the server
reboot

after reboot run API to set quota for all users
/scripts/cwp_api account update_diskquota_all


cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.orig

I am getting the error

Quotecp: cannot stat '/boot/grub2/grub.cfg': No such file or directory

overseer

UEFI?
sudo grub2-mkconfig -o /boot/efi/EFI/almalinux/grub.cfg

anandmys

#69
Got this error

Quote# sudo grub2-mkconfig -o /boot/efi/EFI/almalinux/grub.cfg
/usr/bin/grub2-editenv: error: cannot open `/boot/grub2/grubenv.new': No such file or directory.
/sbin/grub2-mkconfig: line 274: /boot/efi/EFI/almalinux/grub.cfg.new: No such file or directory

The boot folder has only 'EFI' subfolder and nothing else

overseer

Are you indeed running on UEFI and not a standard, old BIOS? You may need to "prime the pump":
mkdir -p /boot/efi/EFI/almalinux/

anandmys

Ran this.

and tried

# sudo grub2-mkconfig -o /boot/efi/EFI/almalinux/grub.cfg
/usr/bin/grub2-editenv: error: cannot open `/boot/grub2/grubenv.new': No such file or directory.
Generating grub configuration file ...
done

overseer


anandmys

Fresh AL 8 installation

etc/fstab

Quote#
# /etc/fstab
# Created by anaconda on Mon Aug 19 17:42:13 2024
#
# 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.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
/dev/sda4 / xfs rw,seclabel,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota 0 0
UUID=37e38df4-28dc-4d9c-acb5-1a2fd7e6130b /boot                   xfs     defaults        0 0
UUID=3F31-DBA5          /boot/efi               vfat    defaults,uid=0,gid=0,umask=077,shortname=winnt 0 2

What should be done here?