配額系統可以限制對使用者與群組可用的磁碟空間。設定時,必須有核心支援它 (以 CONFIG_QUOTA
選項編譯) — 使用 Debian 核心時。配額管理軟體在 quota Debian 套件內。
在檔案系統內啟用配額時,必須指明e usrquota
與 grpquota
選項於 /etc/fstab
中,分別供使用者與群組使用。重新啟動電腦後,就能在未使用的磁碟空間中更新配額 (必須如此,才能重新計算已使用的磁碟空間)。
edquota user
(或 edquota -g group
) 命令允許在仍有磁碟空間的前提下,改變配額。
配額系統允許您設定四個限制:
two limits (called “soft” and “hard”) refer to the number of blocks consumed. If the filesystem was created with a block-size of 1 kibibyte, the 1024 available bytes of each block can only be assigned to one file. Unsaturated blocks thus induce losses of disk space. A quota of 100 blocks, which theoretically allows storage of 102,400 bytes, will, however, be saturated with just 100 files of 500 bytes each, only representing 50,000 bytes in total.
two limits (“soft” and “hard”) refer to the number of inodes used. Each file occupies at least one inode to store information about it (permissions, owner, timestamp of last access, etc.). It is thus a limit on the number of user files.
“軟的” 限制可以被暫時超越;超過 warnquota
命令指定的配額時,由 cron
命令提出警告。“硬的” 限制必須遵守:系統拒絕任何超出硬配額的操作。
使用 edquota -t
命令,可以設定超過軟限制的 “寬限期”。寬限期後,軟限制將視為硬限制。使用者將減少其磁碟空間的使用量至配額之內。