- 论坛徽章:
- 0
|
因工作比较忙,这段时间都没有来管理我的博客了,也学习了一些东西,整理好之后,我会将它记在博客上,用于以后参考。今天我就先贴上QUOTA......
我的硬盘总共分有几下几挂载 点:
[root@localhost home]# df -h
Filesystem 容量 已用 可用 已用% 挂载点
/dev/hda13 8.4G 2.0G 5.9G 26% /
/dev/hda9 981M 412M 520M 45% /bak
/dev/hda8 99M 8.4M 86M 9% /boot
none 110M 0 110M 0% /dev/shm
/dev/hda10 2.0G 92M 1.8G 5% /var
/dev/hda11 2.0G 37M 1.8G 2% /home
加入quota所使用的参 数, 我想对/home进行quota配置(红色部分)
[root@localhost home]# vi /etc/fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/1 / ext3 defaults 1 1
LABEL=/bak /bak ext3 defaults 1 2
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
LABEL=/home1 /home ext3 defaults,usrquota,grpquota 1 2
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
LABEL=/var1 /var ext3 defaults 1 2
LABEL=SWAP-hda12 swap swap defaults 0 0
/dev/hdd /media/cdrom auto
pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed
0 0
/dev/fd0 /media/floppy auto
pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed
0 0
检测,有些版本可能要先创建aquota.group与aquota.user文件
[root@localhost home]# quotacheck -avug
quotacheck: Scanning /dev/hda11 [/home] quotacheck: Cannot stat old user quota file: 没有那个文件或目录
quotacheck: Cannot stat old group quota file: 没有那个文件或目录
quotacheck: Cannot stat old user quota file: 没有那个文件或目录
quotacheck: Cannot stat old group quota file: 没有那个文件或目录
done
quotacheck: Checked 68 directories and 90 files
quotacheck: Old file not found.
quotacheck: Old file not found.
[root@localhost home]# ll
总用量 56
-rw------- 1 root root 7168 11月 5 13:54 aquota.group
-rw------- 1 root root 7168 11月 5 13:54 aquota.user
drwx------ 2 root root 16384 10月 26 16:12 lost+found
drwxrwx--- 3 root pub 4096 11月 5 11:49 pub
drwx------ 14 xiao xiao 4096 11月 5 13:28 xiao
编辑用户xiao的磁盘限额,soft为90M,hard为100M
[root@localhost home]#edquota -u xiao
Disk quotas for user xiao (uid 500):
Filesystem blocks soft hard inodes soft hard
/dev/hda11 2176 90000 100000 149 0 0
查看用户xiao的磁盘限额
[root@localhost home]# quota -v -u xiao
Disk quotas for user xiao (uid 500):
Filesystem blocks quota limit grace files quota limit grace
/dev/hda11 2176 90000 100000 149 0 0
将xiao的quota值复制给deng
[root@qwcn ~]# edquota -p xiao -u deng
[root@qwcn ~]# quota -v -u xiao deng
Disk quotas for user xiao (uid 500):
Filesystem blocks quota limit grace files quota limit grace
/dev/hda11 2176 90000 100000 149 0 0
Disk quotas for user deng (uid 509):
Filesystem blocks quota limit grace files quota limit grace
/dev/hda11 8 90000 100000 1 0 0
[root@qwcn ~]#
设定pub组的soft为500M,hard为550M
[root@localhost home]#edquota -g pub
Disk quotas for group pub (gid 509):
Filesystem blocks soft hard inodes soft hard
/dev/hda11 32 500000 550000 4 4 0
Disk quotas for group pub (gid 509):
Filesystem blocks soft hard inodes soft hard
/dev/hda11 32 500000 550000 4 4 0
[root@qwcn ~]# quota -v -g pub
Disk quotas for group pub (gid 509):
Filesystem blocks quota limit grace files quota limit grace
/dev/hda11 32 500000 550000 4 4 0
[root@qwcn ~]#
启动/dev/hda11的quota
[root@localhost home]# quotaon -uvg /dev/hda11
/dev/hda11 [/home]: group quotas turned on
/dev/hda11 [/home]: user quotas turned on
查 看报告
[root@localhost home]# repquota -avug
*** Report for user quotas on device /dev/hda11
Block grace time: 7days; Inode grace time: 7days
Block limits File limits
User used soft hard grace used soft hard grace
----------------------------------------------------------------------
root -- 35844 0 0 5 0 0
xiao -- 2176 90000 100000 149 0 0
1234 -- 16 0 0 2 0 0
deng -- 8 90000 100000 1 0 0
Statistics:
Total blocks: 7
Data blocks: 1
Entries: 4
Used average: 4.000000
*** Report for group quotas on device /dev/hda11
Block grace time: 7days; Inode grace time: 7days
Block limits File limits
Group used soft hard grace used soft hard grace
----------------------------------------------------------------------
root -- 35836 0 0 4 0 0
xiao -- 2176 0 0 149 0 0
pub -- 32 500000 550000 4 4 0 6days
Statistics:
Total blocks: 7
Data blocks: 1
Entries: 3
Used average: 3.000000
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/8334/showart_55321.html |
|