文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>磁盘配额quota的使用

磁盘配额quota的使用

时间:2006-10-14  来源:hubble.king

磁盘配额

/sbin/quotaon /fs Enables quotas for the /fs filesystem.

/sbin/quotaoff /fs Disables quota tracking.

/usr/sbin/edquota name Edits the quota settings for user name. Can also be used to set defaults, or to copy quota settings

from one user to another.

/usr/bin/quota Allows users to see their current resource consumption and limits.

/usr/sbin/repquota Generates a report of disk consumption by all users for a quota-enabled filesystem.

/sbin/quotacheck Scans a filesystem for quota usage. Initializes the quota databases.
-------------------------------------------
1。编辑 /etc/fstab
/dev/hdd1   /home   ext3   exec,dev,suid,rw,usrquota,grpquota   1   2
2。mount -o remount /home
3。in /home
touch aquota.group aquota.user
4。 quotacheck -avugm
5。 edquota -u test (test is a realy user)
如果是0那表示没有限制
Disk quotas for user quotauser (uid 511):      
                    (20192K)                   (13个文件)
Filesystem             blocks     soft     hard   inodes   soft   hard
/dev/hdc1               20192       10       15       13     10     15

6。 0 4 * * 6 /sbin/quotacheck -avug

技巧

edquota -up test michael randy donna (把设置过限制的test用户的配置,同步到michael randy donna用户)

edquota -p mj `awk -F: '$3 > 499 {print $1}' /etc/passwd` (把设置过限制的mj用户的配置,同步到 uid>499的用户上)

监控
查看 /home用户以用的配置
repquota -u /home
  举例说明磁盘配额的实现方法:
#useradd linux       增加用户linux
#passwd linux       修改用户linux的密码
#mkdir /www/linux     建立新文件夹
#chown linux.linux /www/linux 更改文件夹的属主
#vi /etc/fstab         增加如下行:
/dev/hda7 /www ext3   defaults,usrquota 0 0
#mkfs –t ext3 /dev/sdb1   格式化分区
#quotacheck -cu /www   生成aquota.user 文件
#quotacheck -vu /www   生成相关的信息
#repquota   –au       显示所有的磁盘配额信息
#edquota   -u linux   对用户linux设置配额
#edquota   -t       设置宽限期
#edquotaon   /www   开启/www目录上的磁盘配额
相关阅读 更多 +
排行榜 更多 +
gg

gg

游戏工具 下载
超能格斗大师

超能格斗大师

动作格斗 下载
代驾司机管家

代驾司机管家

交通出行 下载