[root@1ocalhost ~]# chmod 777 /disk/
#给/disk目录赋予权限,lamp1用户要拥有写权限
[root@localhost ~]# su - lamp1
#切换成lamp1用户
[lamp1@1ocalhost ~]$ cd /disk/
#进入/disk目录
[lamp1@1ocalhost disk]$ touch 11
#建立文件
[lamp1@localhost disk]$ touch 22
[lamp1@localhost disk]$ touch 33
[lamp1@localhost disk]$ touch 44
[lamp1@1ocalhost disk]$ touch 55
[lamp1@localhost disk]$ touch 66
[lamp1@localhost disk]$ touch 77
[lamp1@localhost disk]$ touch 88
[lamp1@1ocalhost disk]$ touch 99
sdb1: warning, user file quota exceeded.
#有警告信息了,因为软限制是 8 个
[lamp1@localhost disk]$ ls
11 22 33 44 55 66 77 88 99 aquota. group aquota.user lost+found
#虽然警告了,但是第9个文件依然建立
[lamp1@localhost disk]$ touch 10
[lamp1@localhost disk]$ touch 111
sdb1: write failed, user file limit reached.
touch:无法创建"111":超出磁盘配额
#超出磁盘配额
[lamp1@localhost disk]$ ls
10 11 22 33 44 55 66 77 88 99 aquota. group aquota.user lost+found
#第11个文件没有建立
[root@localhost ~]# repquota -uvs /disk/
*** Report for user quotas on device /dev/sdbl Block grace time: 8days; Inode grace time: 8days
Block limits File limits
User used soft hard grace used soft hard grace
root -- 13 0 0 2 0 0
lampl -+ 0 40000 50000 10 8 10 7days
lamp2 -- 0 245M 293M 0 0 0
lamp3 -- 0 245M 293M 0 0 0
Statistics:
Total blocks: 7
Data blocks: 1
Entries: 4
Used average: 4.000000
[lamp1@localhost disk]$ rm -rf 10 #删除文件10,空出文件个数
[lamp1@localhost disk]$ dd if=/dev/zero of=/disk/tesffile bs=1M count=60
#建立tesffile文件,指定文件大小为60MB
sdb1: warning, user block quota exceeded.
sdb1: write failed, user block limit reached.
dd:正在写入"/disk/111":超出磁盘配额
#报错,超出磁盘配额
记录了 49+0的读入
记录了 48+0的写出
51200000字节(51 MB)已复制,0.538582 秒,95.1 MB/秒
[lamp1 @localhost disk]$ ll -h tesffile
-rw-rw-r-- 1 lamp1 lamp1 49M 4月 17 02:52 tesffile
#查看一下tesffile文件的大小,并没有超出50MB的硬限制
新闻热点
疑难解答