- 论坛徽章:
- 0
|
在AIX系统中,限制一个用户对文件系统的磁盘空间使用,可以采用限额技术。
AIX的DISK QUOTAS 是基于Berkley Disk Quota Syetem的。
设置过程经过以下几个步骤:
1、使用CHFS命令,修改文件系统的配置。如为/home启用配额,使用以下命令:
chfs -a "quota=userquota,groupquota" /home
2、指定限额配置文件名称
chfs -a "userquota=/home/quota.user" -a "groupquota=/home/quota.group"
以上的文件系统属性修改之后,体现在 /etc/filesystems 文件中 /home 节
/home:
dev = /dev/hd1
vfs = jfs
log = /dev/hd8
mount = true
check = true
vol = /home
free = false
quota = userquota,groupquota
3、生产限额配置文件
quotacheck -a -v
会在/home文件系统的主目录下生成两个文件:/home/quota.user /home/quota.group
ibm43P:root>pwd
/home
ibm43P:root>ls -l
total 50
drwxr-xr-x 2 alexchan staff 512 Sep 04 15:54 alexchan
drwxr-xr-x 2 dbaao DBAAO 512 Jul 25 10:02 dbaao
drwxr-xr-x 2 dbsso DBSSO 512 Jul 25 10:02 dbsso
drwxr-xr-x 2 guest usr 512 Aug 26 2005 guest
drwx------ 2 root system 512 May 23 15:43 lost+found
drwxr-xr-x 2 notes notes 512 May 24 10:02 notes
drwxr-xr-x 2 notes3 notes 512 May 25 15:47 notes3
-rw-r----- 1 root system 32064 Sep 04 15:59 quota.group
-rw-r----- 1 root system 9664 Sep 04 15:59 quota.user
drwxr-xr-x 2 root system 512 Aug 31 09:33 scripts
4、配用限额对那些用户生效,如用户alexchan
edquota -u alexchan
修改相应的值,保存推出。
5、修改 /etc/rc 文件,增加以下内容:
echo "Starting Disk Quota Service..."
/usr/sbin/quotacheck -a
/usr/sbin/quotaon -a
echo "Disk Quota started! "
6.reboot 机器,一切OK。
重点:配置文件 /etc/filesystems、quota.user和quota.group文件的生成与配置。
还有,每次修改限额配置之后,一定要执行 quotacheck -a -v 命令
用户限额配置的复制
edquota -p alexchan testuser 命令可实现激alexchan的配置应用于testuser用户。同样也适用于组复制。
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/74291/showart_1096200.html |
|