RHCE6 Preperation (11) – Quota
来源:互联网 发布:天猫 淘宝商城男休闲鞋 编辑:程序博客网 时间:2024/05/05 06:12
Create quota for user alice and /home/alice, least/soft limit is 40K, when exceeding 80K, the system will display the exceeded the user quota.
1, check the kernel support the quota function,
[root@server4 home]# grep CONFIG_QUOTA /boot/config-2.6.32-358.6.1.el6.x86_64 CONFIG_QUOTA=yCONFIG_QUOTA_NETLINK_INTERFACE=y# CONFIG_QUOTA_DEBUG is not setCONFIG_QUOTA_TREE=yCONFIG_QUOTACTL=y[root@server4 home]#
2, modify the /etc/fstab to activate the quota support for the /home folder,
[root@server4 home]# vim /etc/fstabadd 'usrquota' and 'grpquota'
/dev/mapper/vgsrv-home /home ext4 defaults,usrquota,grpquota 1 23, remount the file system, make the quota effective,
mount -o remount,usrquota,grpquota /home
4, use quotacheck command to generate the basic quota configuration file,
quotacheck -cugmv /home
5, activate the quota limitation,
quotaon /home
6, use edquota command to configure the quota limit to specific user,
[root@server4 home]# edquota -u alice
modify the content to:
Disk quotas for user alice (uid 1004): Filesystem blocks soft hard inodes soft hard /dev/mapper/vgsrv-home 80 40 80 12 0 0here 40K as soft limit, 80K as hard limit.
7, use repquota to check the quota status,
[root@server4 home]# repquota /home*** Report for user quotas on device /dev/mapper/vgsrv-homeBlock grace time: 7days; Inode grace time: 7days Block limits File limitsUser used soft hard grace used soft hard grace----------------------------------------------------------------------root -- 37945 0 0 5 0 0 lucy -- 16 0 0 8 0 0 student -- 38337 0 0 226 0 0 mary -- 20 0 0 10 0 0 alice +- 80 40 80 7days 12 0 0 bobby -- 16 0 0 8 0 0 aclan -- 16 0 0 8 0 0
8, test the result,
[root@server4 home]# su - alice[alice@server4 ~]$ dd if=/dev/zero of=file1 bs=1k count=50dm-3: warning, user block quota exceeded.50+0 records in50+0 records out51200 bytes (51 kB) copied, 0.00173795 s, 29.5 MB/s
here the file1 created successful, however there is a warning, if continue to create file, it will fail,
[alice@server4 ~]$ dd if=/dev/zero of=file2 bs=1k count=30dm-3: write failed, user block limit reached.dd: writing `file2': Disk quota exceeded9+0 records in8+0 records out8192 bytes (8.2 kB) copied, 0.00401174 s, 2.0 MB/s
file2 still created successful, but already reached 80K, if create another 1K file file3,
[alice@server4 ~]$ dd if=/dev/zero of=file3 bs=1k count=1dd: opening `file3': Disk quota exceeded
0 0
- RHCE6 Preperation (11) – Quota
- RHCE6 Preperation (7) - vsftp,ISCSI,SMB
- RHCE6 Preperation (10) - SMTP,NFS, boot parameter
- RHCE6 Preperation (1) - change root password and network setup
- RHCE6 Preperation (2) - yum source and auto mount
- RHCE6 Preperation (3) - find & copy, lvm resize, swap partition create
- RHCE6 Preperation (4) - user/group, kernel install, ip_forward, printer, crontab
- RHCE6 Preperation (5) - ldap, NIS, NTP, setfacl, vsftp
- RHCE6 Preperation (6) - httpd, lvm, grep, ssh, nfs
- RHCE6 Preperation (8) - http, virtual host, http limited access
- RHCE6 Preperation (9) - SMTP,MTA, shell script, ftp
- Quota
- Interview Preperation
- RHCE6考试感想(转载)
- rhce6考试题及答案
- quota 详解---quota 是什么
- RHCE6.0考试题 (转载)
- RHCE6.4 rpm 安装gcc
- WEB项目中SpringMVC的配置步骤
- 关于召回率和准确率的理解
- 阶段性总结和如何定义我的“第二版”
- poj 1657 国际象棋棋盘上的距离
- zoj 2319 Beautiful People
- RHCE6 Preperation (11) – Quota
- phpredis中文手册(使用方法)——《redis中文手册》 php版
- 充实的九月,我要毕业了!
- Wavio Sequence +uva+最长升子序列dp(n*log(n))
- HDOJ 3966 Aragorn's Story
- C++笔试题深度分析 第一波 下
- android 分析工具
- 如何修复移动宽带720错误 win8.1
- cache 的设计与实现--转载