Saturday, December 19, 2009

File System - Disk Quota

Disk space can be restricted by implementing disk quotas which alert a system admin before a user consumes too much disk space or a partition becomes full.

Configuring Disk Quotas

Enable quotas per file system by modifying /etc/fstab
# vi /etc/fstab
/dev/VG0/LV2 /home ext3 defaults,usrquota,grpquota 1 2
/dev/VG0/LV3 swap swap defaults 0 0

Remount the file system
# mount -o remount /home

Create quota database file (to generate aquota.user & aquota.group files)
# quotacheck -cug /home
option c for create quota file, u for user quota file & g for group quota file

Assigning quotas per user
# edquota username
add soft and hard values

Assigning quotas per group
# edquota -g groupname

Assigning quotas per filesystem
# edquota -t

Now enable quotas
# quotaon -vug /home

Reporting on disk quotas
# repquota /home

No comments:

Post a Comment