LINUX用户磁盘配额Quota设置流程
第一步:创建用户,用户组
脚本:
#!/bin/bash groupadd quotagrp for username in quota1 quota2 quota3 quota4 quota5 do useradd -g quotagrp $username echo "password" |passwd --stdin $username done
LABEL=/home /home ext3 defaults[color=red],usrquota,grpquota [/color] 1 2
mount -o remount,usrquota,grpquota /home
quotachck -avug -mf
Block limits File limitsUser used soft hard grace used soft hard gracemyquota1 -- 88 400000 500000 11 0 0
*** Report for user quotas on device /dev/sda2Block grace time: 14days; Inode grace time: 7days Block limits File limitsUser used soft hard grace used soft hard grace----------------------------------root -- 173M 0 0 4 0 0 chenlixin -- 11832 0 0 481 0 0 pro1 -- 168 0 0 21 0 0 pro2 -- 160 0 0 20 0 0 pro3 -- 80 0 0 10 0 0 myquota1 -- 88 391M 489M 11 0 0 myquota2 -- 80 391M 489M 10 0 0 myquota3 -- 80 391M 489M 10 0 0 myquota4 -- 80 391M 489M 10 0 0 myquota5 -- 80 391M 489M 10 0 0 quota1 -- 80 391M 489M 10 0 0 quota2 -- 80 0 0 10 0 0 quota3 -- 80 0 0 10 0 0 quota4 -- 80 0 0 10 0 0 quota5 -- 80 0 0 10 0 0 Statistics:Total blocks: 8Data blocks: 1Entries: 15Used average: 15.000000