Red Hat Training
A Red Hat training course is available for Red Hat Enterprise Linux
3.5.2. 顯示磁碟配額限制和使用量
您可透過使用
gfs2_quota get
指令來顯示特定用戶和群組的配額限制與目前使用量。您亦可透過使用 gfs2_quota list
指令來顯示配額檔案的所有內容,在此情況下,所有非 zero 的硬性限制、非 zero 的警告限制或非 zero 的值的 ID 都會被列出。
3.5.2.1. 用法
Displaying Quota Limits for a User
gfs2_quota get -uUser
-fMountPoint
Displaying Quota Limits for a Group
gfs2_quota get -gGroup
-fMountPoint
Displaying Entire Quota File
gfs2_quota list -f MountPoint
User
- 一個用來顯示特定用戶資訊的用戶 ID。這能夠是個來自於 password 檔案的用戶名稱或是 UID 號碼。
Group
- 一個用來顯示特定群組資訊的群組 ID。這能夠是個來自於 group 檔案的群組名稱或是 GID 號碼。
MountPoint
- 指定動作所適用於的 GFS2 檔案系統。
3.5.2.2. 指令輸出
gfs2_quota
指令所顯示的 GFS2 配額資訊如下:
userUser
: limit:LimitSize
warn:WarnSize
value:Value
groupGroup
: limit:LimitSize
warn:WarnSize
value:Value
LimitSize
、WarnSize
和 Value
數字(值)的預設單位為 MB。若將 -k
、-s
或 -b
旗標附加至指令列的話,單位便會相應地被更改為 KB、磁區,或是檔案系統區塊。
User
- 資料關聯的用戶名稱或 ID。
Group
- 資料關聯的群組名稱或 ID。
LimitSize
- 為用戶或群組所設置的硬性限制。若沒有設置限制的話,這個值便會是零。
Value
- 用戶或群組實際上所使用的磁碟空間。
3.5.2.3. 註解(Comments)
當顯示配額資訊時,若將
-n
選項附加至指令列的話,gfs2_quota
指令便不會將 UID 和 GID 解析為名稱。
Space allocated to GFS2's hidden files can be left out of displayed values for the root UID and GID by adding the
-d
option to the command line. This is useful when trying to match the numbers from gfs2_quota
with the results of a du
command.
3.5.2.4. 範例
此範例顯示了所有設置了限制或是使用了
/mygfs2
檔案系統上任何磁碟空間的用戶和群組的配額資訊。
gfs2_quota list -f /mygfs2
此範例以扇區來顯示了
/mygfs2
檔案系統上的 users
群組的配額資訊。
gfs2_quota get -g users -f /mygfs2 -s