[[email protected] ~]# chmod 777 /disk/
#給/disk目錄賦予許可權,lamp1使用者要擁有寫許可權
[[email protected] ~]# su - lamp1
#切換成lamp1使用者
[[email protected] ~]$ cd /disk/
#進入/disk目錄
[[email protected] disk]$ touch 11
#建立檔案
[[email protected] disk]$ touch 22
[[email protected] disk]$ touch 33
[[email protected] disk]$ touch 44
[[email protected] disk]$ touch 55
[[email protected] disk]$ touch 66
[[email protected]t disk]$ touch 77
[[email protected] disk]$ touch 88
[[email protected] disk]$ touch 99
sdb1: warning, user file quota exceeded.
#有警告資訊了,因為軟限制是 8 個
[[email protected] disk]$ ls
11 22 33 44 55 66 77 88 99 aquota. group aquota.user lost+found
#雖然警告了,但是第9個檔案依然建立
[[email protected] disk]$ touch 10
[[email protected] disk]$ touch 111
sdb1: write failed, user file limit reached.
touch:無法建立"111":超出磁碟配額
#超出磁碟配額
[[email protected] disk]$ ls
10 11 22 33 44 55 66 77 88 99 aquota. group aquota.user lost+found
#第11個檔案沒有建立
[[email protected] ~]# 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
[[email protected] disk]$ rm -rf 10 #刪除檔案10,空出檔案個數
[[email protected] 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的硬限制