磁盘配额

*磁盘配额
1.查看磁盘配额是否开启

mount

2.新建|同步|格式化分区

[root@localhost Desktop]# fdisk /dev/vdb 新建分区
[root@localhost Desktop]# partprobe    同步分区
[root@localhost Desktop]# mkfs.xfs /dev/vdb1    格式化分区
meta-data=/dev/vdb1 isize=256 agcount=4, agsize=6400 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0
data = bsize=4096 blocks=25600, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=0
log =internal log bsize=4096 blocks=853, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@localhost Desktop]#

3.制作磁盘配额

[root@localhost Desktop]# mount -o usrquota,grpquota /dev/vdb1 /pub/ 制作配额
[root@localhost Desktop]# quotaon -ugv /dev/vdb1 开启配额
quotaon: Enforcing group quota already on /dev/vdb1
quotaon: Enforcing user quota already on /dev/vdb1
[root@localhost Desktop]# mount 查看配额是否开启
…..
/dev/vdb1 on /pub type xfs (rw,relatime,seclabel,attr2,inode64,usrquota,grpquota)
[root@localhost Desktop]# edquota -u student
Disk quotas for user student (uid 1000):
Filesystem blocks soft hard inodes soft hard
/dev/vdb1 0 20M 30M 0 0 0
——blocks 存储大小
——soft
——hard 配额大小
——inodes 文件个数
测试:
[root@localhost ~]# chmod 777 /pub/
[root@localhost ~]# su - student
Last login: Mon Mar 6 08:04:54 EST 2017 on pts/1
[student@localhost ~] ddif=/dev/zeroof=/pub/filebs=1Mcount=1515+0recordsin15+0recordsout15728640bytes(16MB)copied,0.00605853s,2.6GB/s[student@localhost ] du -sh /pub/file 查看文件大小
15M /pub/file
[student@localhost ~]$ dd if=/dev/zero of=/pub/file bs=1M count=25
25+0 records in
25+0 records out
26214400 bytes (26 MB) copied, 0.0138501 s, 1.9 GB/s
[root@localhost Desktop]# repquota -a 查看配额使用情况

4.永久配额

vim /etc/fstab
——/dev/sdb1 /pub xfs defaults,usrquota,grpquota 0 0
设备 挂载点 开启了配额 不检测,不备份
[root@localhost Desktop]# vim /etc/fstab
/dev/vdb1 /pub xfs defaults,userquota,grpquota 0 0
[root@localhost Desktop]# mount -a /etc/fstab
[root@localhost Desktop]#
mount -a 检测 /etc/fstab 文件是否配置正确

5.删除配额功能

vim /etc/fstab 删除 usrquota,grpquota
——defaults
umount /pub

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值