我已经configuration我的盒子,以允许一个特定的用户高达2GB的存储感谢quota 。
我想我已经正确启用它。 /etc/fstab显示usrquota,grpquota , quotaon说一切正常, 但我已经能够违反配额今天。
从SSH,我sudo到该用户,并试图创build一个4GB的文件
# sudo -u targetuser bash ##the user cannot use SSH targetuser@host:~> dd if=/dev/zero of=prova.bin count=4096 bs=1048536 sda1: warning, user block quota exceeded. ^C^C3592+0 records in 3592+0 records out 3766341312 bytes (3,8 GB) copied, 333,72 s, 11,3 MB/s
edquota -u targetuser显示(我删除文件后)
Disk quotas for user targetuser (uid 1006): Filesystem blocks soft hard inodes soft hard /dev/sda1 181200 2097072 22097072 10230 0 0
在删除大象之前,我也可以写一个新的文件。
这个问题非常简单:Linux为什么不停止写更多而不是仅仅警告?
当用户尝试写入超过他允许的数量时,我能做些什么来提出错误?