quota 筆記
1,overview
implemented within the kernel
enabled on a per-filesystem basis
individual policies for groups or users
limit by the number of blicks or indoes
implement both soft and hard limits
initialization
partition mount options:usrquota,grpquota
initialize database:quotacheck[@more@]
2,setting quotas for users
implementation
start or stop quotas:quotaon,quotaoff
edit quotas directly:edquota username
from a shell:
setquota username 4096 5120 40 50 /foo
define prototypical users:
dequota -p user1 user2
3,reporting quota status
reporting
user inspection:quota
quota overviews:repquota
miscellaneous utilities:warnquota
設定步驟
1,mount是加上相關的選項 ,編輯/etc/fstab檔案,在home目錄的分割槽上面設定 usrquota或grpquota,
[root@tonykorn97 ~]# cat /etc/fstab
/dev/vol0/root / ext3 defaults 1 1
/dev/vol0/home /home ext3 usrquota,defaults 1 2
重新mount home分割槽
[root@tonykorn97 ~]# mount -o remount /home
[root@tonykorn97 ~]# mount
/dev/mapper/vol0-root on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/mapper/vol0-home on /home type ext3 (rw,usrquota)
2,建立quota資料庫
[root@tonykorn97 ~]# quotacheck -cugm /home
-c 建立新的
-u 使用者
-g 組
3,啟動quota限制
[root@tonykorn97 ~]# quotaon /home
4,編輯磁碟限額
[root@tonykorn97 ~]# edquota student
具體資訊
Disk quotas for user student (uid 500):
Filesystem blocks soft hard inodes soft hard
/dev/mapper/vol0-home 19 20 40 9 20 40
block: 已使用的塊大小,預設為1K
soft: 軟限制塊大小
hard: 硬限制塊大小
inodes:已使用檔案個數限制
soft: 軟限制檔案個數
hard: 硬限制檔案個數
5,執行quota顯示使用者資訊
[root@tonykorn97 ~]# quota student
Disk quotas for user student (uid 500):
Filesystem blocks quota limit grace files quota limit grace
/dev/mapper/vol0-home
19 20 40 9 20 40
[root@tonykorn97 ~]#
6,測試
[root@tonykorn97 ~]# su - student
[student@tonykorn97 ~]$ dd if=/dev/zero of=/home/student/test bs=1k count=10
dm-1: warning, user block quota exceeded.
10+0 records in
10+0 records out
10240 bytes (10 kB) copied, 0.000591459 seconds, 17.3 MB/s
[student@tonykorn97 ~]$ quota student
Disk quotas for user student (uid 500):
Filesystem blocks quota limit grace files quota limit grace
/dev/mapper/vol0-home
30* 20 40 7days 10 20 40
[student@tonykorn97 ~]$ dd if=/dev/zero of=/home/student/test bs=1k count=50
dm-1: warning, user block quota exceeded.
dm-1: write failed, user block limit reached.
dd: 寫入 “/home/student/test”: 超出磁碟限額
20+0 records in
19+0 records out
19456 bytes (19 kB) copied, 0.000943725 seconds, 20.6 MB/s
[student@tonykorn97 ~]$ quota student
Disk quotas for user student (uid 500):
Filesystem blocks quota limit grace files quota limit grace
/dev/mapper/vol0-home
40* 20 40 10 20 40
[student@tonykorn97 ~]$
取消quota限制
1,quotaoff關閉quota限制
[root@tonykorn97 ~]# quotaoff /home
2,刪除quota資料庫
[root@tonykorn97 ~]# edquota student
刪除檔案內容
3,修改/etc/fstab檔案,重新mount
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/312079/viewspace-1007388/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- HBase多租戶-Namespace Quota管理namespace
- Linux磁碟配額Quota配置Linux
- Linux Quota的配置實戰Linux
- Linux磁碟配額(Quota)(轉)Linux
- Oracle的表空間quota詳解Oracle
- Linux下的磁碟配額quotaLinux
- oracle的表空間quota詳講Oracle
- solaris 10_相關命令_quota_
- unlimited tablespace許可權和quota 配額MIT
- Netweaver和SAP雲平臺的quota管理
- 安裝及使用quota管理磁碟配額(轉)
- 印象筆記 --- 方法分享筆記筆記
- 筆記筆記
- CUUG筆記 ORACLE索引學習筆記筆記Oracle索引
- 主動筆記與被動筆記筆記
- rac例項報SVR4 Error: 49: Disc quota exceededVRError
- 淘寶記錄筆記筆記
- 心情筆記筆記
- 命令筆記筆記
- 筆記:Docker筆記Docker
- Meteor筆記筆記
- ES筆記筆記
- AbstractQueuedSynchronizer筆記筆記
- new筆記筆記
- vio筆記筆記
- Liunx筆記筆記
- Nacos 筆記筆記
- oracle筆記Oracle筆記
- html 筆記HTML筆記
- Cookie筆記Cookie筆記
- jQuery筆記jQuery筆記
- Restful 筆記REST筆記
- kafka 筆記Kafka筆記
- 路由筆記路由筆記
- webSocket筆記Web筆記
- 筆記1筆記
- 筆記-FMDB筆記
- canvas筆記Canvas筆記