[精讚] [會員登入]
2502

[CentOS] 設定和使用quota

“
quota 的觀念已經很老了,不過每次都會忘記所以寫下來,有需要觀念的朋友請參看鳥哥的網站吧
„

分享此文連結 //n.sfs.tw/10669

分享連結 [CentOS] 設定和使用quota@新精讚
(文章歡迎轉載,務必尊重版權註明連結來源)
2019-10-23 15:53:32 最後編修
2017-01-24 01:49:14 By 張○○
 

自動目錄

系統

Centos5.4

1. 安裝 quota

  預設 centos 5.4 安裝完畢是沒有qouta 的,所以要安裝。

  # yum install quota

 要設定quota 的目錄為 /home 記得在安裝系統時一定要獨立的劃出來,否則無法設定

2. 修改 /etc/fstab

 /dev/VolGroup00/LogVo102 /home                   ext3    defaults,usrquota,grpquota        1 2

 /dev/VolGroup00/LogVo102是我設定的 logical volumn,各位如果是實體的volumn 名稱可能會不一樣。

3. remount

設定完畢後不必重開機,可以直接 runtime remount
# mount -o remount /home

查看
# mount -l

4. 掃瞄檔案系統並建立 Quota 的記錄檔

#  quotacheck -avug
quotacheck: Scanning /dev/mapper/VolGroup00-LogVo102 [/home] |
quotacheck: Cannot stat old user quota file: 沒有此一檔案或目錄
quotacheck: Cannot stat old group quota file: 沒有此一檔案或目錄
quotacheck: Cannot stat old user quota file: 沒有此一檔案或目錄
quotacheck: Cannot stat old group quota file: 沒有此一檔案或目錄
done
quotacheck: Checked 6432 directories and 88501 files
quotacheck: Old file not found.
quotacheck: Old file not found.

初始化完畢就會在想設定quota 的目錄匣下產生 aquota.group  aquota.user 兩個檔,不要理他也不要刪除。

5. 設定軟硬限制

編輯單一使用者
# edquota -u username

或編輯群組
# edquota -g usergroup

Disk quotas for user axer (uid 501):
  Filesystem                           blocks       soft       hard     inodes     soft     hard
  /dev/mapper/VolGroup00-LogVo102      14868   10000000   12000000        638        0        0

blocks 是指該使用者目前的在碟容量(block數)
   soft / hard 軟硬限制容量(KB)
inodes 檔案數量,基本上一個檔案是一個inodes
   soft / hard 軟硬限制inodes數 -- 設為容量的 1/10~ 1/20差不多

6. 啟動/關閉 quota

# quotaon -avgu
# quotaoff -a


原文 2012-03-30 13:59:20

END

你可能感興趣的文章

[Centos7] 修改啟動的runlevel centos7的 runlevel修改和前面的版本都不一樣

安裝SPHINX支援中文 新版本的 sphinx 和舊版不同,網路上很多範例和教學是不能用的。此文是安裝和設定方法分享

[Centos7] 安裝apache+php7+mariadb10+selinux Centos7 安裝apache+php7+mariadb10+selinux

[CentOS] 新增修改及刪除使用者 新增、修改、刪除使用者和群組

[Centos8] 利用nmcli 設定ipv4 位址 Centos7之後修改網路設定變得比較麻煩一點,此篇介紹使用nmcli指令的方法

[Centos7] 安裝sphinx+php7 在centos7上安裝sphinx,在PHP7上運作正確

隨機好文

使用Google尋找你的手機 這近發現google竟然可以用來找android的手機,而且不需要經過什麼設定或安裝軟體。

[CodeIgniter3] 解決無法上傳特定檔案(.sb2)的問題 上傳時出現The filetype you are attempting to upload is not allowed,要怎麼解決?

外匯課程經驗 有天遇到某個朋友的正妹朋友,說她有個很棒的外匯投資課程,要我們去聽,只收場地費200大洋。她又說續效最差一個月也有1%,誰還在苦哈哈上班?

[MAC] 安裝APACHE+PHP OS Darwin OpenIDMac1deAir 15.6.0 Darwin Kernel Version 15.6.

[AS3] 變數型態 基本類型宣告 as3 有下列幾種基本類型:string, int, number, object, boolean, n