Disk Quotas

Print Friendly, PDF & Email

To check the current disk space on host, run df -lf command:

[root@tempest bin] df -lt
Filesystem Size Used Avail Use% Mountpoint
/dev/mapper/vg_tempest-lv_root 42G 827M 39G 3% / 
none 34G 709k 34G 1% /dev/shm 
/dev/sda1 508M 87M 396M 18% /boot 
/dev/mapper/vg_tempest-lv_home 666G 576G 57G 92% /home 
/dev/mapper/vg_tempest-lv_students 55G 46G 5.8G 89% /students 
/dev/mapper/vg_tempest-lv_usr 18G 16G 1.6G 91% /usr 
/dev/mapper/vg_tempest-lv_var 49G 25G 22G 53% /var 
/dev/mapper/vg_tempest-lv_tmp 11G 162M 9.7G 2% /tmp 
bigdata:/volume1/data 3.0T 2.6T 368G 88% /data

vg: volume group

lvm: logical volume manager

It is hard to shrink partitions but easy to grow them. So we would try to group them together and grow their sizes as needed.

Ideally, we would want to keep the percentage occupied of each disk below 90%. When one partition exceeds 90% usage, we would need to grow partition size by running the following command:

lvextend --size +{size} --resizefs {partition path}

For example, we can run the following command to increase the size of /students by 1GB:

lvextend --size +1GB --resizefs /dev/mapper/vg_tempest-lv_students

For more information, please refer to this post:

https://blogs.wellesley.edu/cssysadmin/2013/02/25/growing-logical-volume/

 

The default quota for student account is 100000 MB, and we would want to check account sizes frequently in cron.daily and notify a student if her account size is near or over data. This is accomplished by two scripts:

quota_near: checks each account against its max quota (100000 MB) and her near quota. If the student’s account size is greater than near quota, a notification email will be sent to the student’s .forward email account. If a student’s account size just gets over the limit, she has 7 days to clean up her account. If ta student’s account size still exceeds the maximum, her account will be locked. Note that student accounts with exceptions will not be checked. Whether each account is over limit, near limit, or doing fine is logged in /var/log/quota_near.log and /var/log/quota_over.log

For more information on quota_near emails, refer to this post:

https://blogs.wellesley.edu/cssysadmin/2012/12/14/over-quota-emails/

One Response to Disk Quotas

Leave a Reply

Your email address will not be published. Required fields are marked *