Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFR] Add filesystem quotas for each user #39

Open
joglomedia opened this issue Sep 25, 2019 · 1 comment
Open

[NFR] Add filesystem quotas for each user #39

joglomedia opened this issue Sep 25, 2019 · 1 comment
Labels
new feature request New feature request / suggestion

Comments

@joglomedia
Copy link
Owner

joglomedia commented Sep 25, 2019

Limit the amount of disk space a user or group can use on a filesystem. Without such limits, a user could fill up the machine’s disk and cause problems for other users and services.

apt-get update
apt-get install quota

## Install kernel quota modules.

if find /lib/modules/$(uname -r) -type f -name '*quota_v*.ko*' > /dev/null 2>&1; then
    echo "Kernel quota modules already exists";
else
    echo "Kernel quota modules not found. Installing...";
    apt-get install linux-image-extra-virtual
fi

Add usrquota,grpquota to fstab

nano /etc/fstab

something like this

UUID=a8254f0f-c87f-4299-88ee-7e9aea768cbe / ext4 errors=remount-ro,usrquota,grpquota 0 1

sudo mount -o remount /

Verify

cat /proc/mounts | grep 'quota,usrquota,grpquota'

Enabling quota

quotacheck -ugm /
sudo quotaon -v /

Set user quota

setquota OPTIONS <user|group|project> -a|
setquota -u lemper 200M 220M 0 0 /

Generate quota reports

repquota -s /

References

@joglomedia joglomedia added the new feature request New feature request / suggestion label Sep 25, 2019
@joglomedia joglomedia changed the title Add filesystem quotas for each user [NFR] Add filesystem quotas for each user Aug 13, 2021
@joglomedia
Copy link
Owner Author

OpenVZ VPS doesn't support quotas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature request New feature request / suggestion
Projects
None yet
Development

No branches or pull requests

1 participant