RHEL6系统上的磁盘配额(3)

来源:未知 责任编辑:责任编辑 发表时间:2014-05-20 18:34 点击:

从查询的结果来看,yufei用户有5M的空间,但最多不超过10M。文件数量为162个,但最多不超过165个。
第六步:测试
这一步在实际工作没有啦,我们只是为了演示,才做的这一步。当然,如果你想在实际工作中测试的话,也是可以的。
[root@yufei ~]# su - yufei
[yufei@yufei ~]$ mkdir test
[yufei@yufei ~]$ cd test/
[yufei@yufei test]$ dd if=/dev/zero of=file1 bs=1M count=2
2+0 records in
2+0 records out
2097152 bytes (2.1 MB) copied, 0.008217 s, 255 MB/s
[yufei@yufei test]$ dd if=/dev/zero of=file2 bs=1M count=2
2+0 records in
2+0 records out
2097152 bytes (2.1 MB) copied, 0.00576349 s, 364 MB/s
[yufei@yufei test]$ dd if=/dev/zero of=file3 bs=1M count=2
2+0 records in
2+0 records out
2097152 bytes (2.1 MB) copied, 0.00753033 s, 278 MB/s
[yufei@yufei test]$ ls -l
total 6144
-rw-rw-r--. 1 yufei yufei 2097152 May 29 21:03 file1
-rw-rw-r--. 1 yufei yufei 2097152 May 29 21:03 file2
-rw-rw-r--. 1 yufei yufei 2097152 May 29 21:03 file3
创建了3个2M的文件,外加一个test目录,这时候我们再来看看用户的配额情况
[yufei@yufei test]$ quota
Disk quotas for user yufei (uid 500):
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
      /dev/sda1    7208*   5120   10240   6days     163*    162     165   6days
这时候我们看到的信息就和前面的不一样了,超过软限制的,就带上了*号了。而且宽限时间为6天。在目前的情况下,我最多还能创建2个文件,最多还能有2M多的空间。
下面我们继续来增加文件。
[yufei@yufei test]$ touch touchfile1
[yufei@yufei test]$ touch touchfile2
[yufei@yufei test]$ touch touchfile3
touch: cannot touch `touchfile3': Disk quota exceeded
看到没有,当我们再创建第三个文件的时候,提示,超过磁盘配额了。
[yufei@yufei test]$ ls touchfile*
touchfile1  touchfile2
第三个文件没有创建成功啊!!
因为空间没有还是有的,我可以继续向里面增加数据。但文件是增加不了。我们接下来测试数据的空间限制。
[yufei@yufei test]$ rm -fr touchfile*
[yufei@yufei test]$ dd if=/dev/zero of=file4 bs=1M count=2
2+0 records in
2+0 records out
2097152 bytes (2.1 MB) copied, 0.00672323 s, 312 MB/s
这时间的空间还有不到1M,我们再来创建个2M的文件,看看会出现什么样的情况。
[yufei@yufei test]$ dd if=/dev/zero of=file5 bs=1M count=2
dd: writing `file5': Disk quota exceeded
1+0 records in
0+0 records out
1007616 bytes (1.0 MB) copied, 0.0059845 s, 168 MB/s
注意最上面的一行,提示超出磁盘配额。
[yufei@yufei test]$ ls -l
total 9176
-rw-rw-r--. 1 yufei yufei 2097152 May 29 21:03 file1
-rw-rw-r--. 1 yufei yufei 2097152 May 29 21:03 file2
-rw-rw-r--. 1 yufei yufei 2097152 May 29 21:03 file3
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
用户名: 验证码:点击我更换图片
最新评论 更多>>

推荐热点

  • /etc/fstab 详解
  • nginx主主集群
  •  LVS-NAT和LVS-DR模式的实现详解
  •  RHCE考试之磁盘配额
  • 学习笔记:ACL详解
  • suse linux双网卡双网关配置
  •  LVM逻辑卷管理器
  •  Nginx主主负载均衡架构
  • ubuntu学习Mysql

快速直达

操作系统导航

LinuxWindows虚拟机
网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
Copyright © 2008-2015 计算机技术学习交流网. 版权所有

豫ICP备11007008号-1