Linux
사용자별 용량 제한
마니씨
2010. 1. 11. 12:15
#mount #vi /etc/fstab |
LABEL=/home 의 defaults 뒤에 ,usrquota 추가 저장
#touch /home/quota.user #mount -o remount /home #mount |
하면 home의 정보에 usrquota 가 추가된것을 확인 할 수 있다.
#cd /home #quotacheck -a -m #convertquota -u /home #ll |
#edquota -t #edquota -u aha01 |
soft 20000 hard 25000 으로 수정, 저장한다. (20M, 25M)
#quotaon -a #quotaoff -a #quotaon -a #edquota -p aha01 aha02 aha03 aha04 aha05 --> aha01 의 quota 설정을 2,3,4,5 에게도 복사해준다. #repquota -a *** Report for user quotas on device /dev/hda3 Block grace time: 7days; Inode grace time: 7days Block limits File limits User used soft hard grace used soft hard grace ---------------------------------------------------------------------- root -- 149236 0 0 4 0 0 aha01 -- 96 50000 60000 12 0 0 aha02 -- 96 50000 60000 12 0 0 aha03 -- 96 50000 60000 12 0 0 aha04 -- 96 50000 60000 12 0 0 aha05 -- 96 50000 60000 12 0 0 |
aha01~5로 접속하여
$ du -sh ~ $cp -r /etc . $du -sh ~ $quota $mkdir ttt $rm -rf etc $df -h |
로 용량 테스트 해보기
#quotaoff -a #rm -rf /home/quota.user #rm -rf /home/aquota.user #groupadd aja #useradd -G aja ja01~05 #nl /etc/group #nl /etc/passwd soft :30M, hard : 35M |