001、查看一下当前系统
[root@PC1 home]# hostnamectl Static hostname: PC1 Icon name: computer Chassis: n/a Machine ID: 8f7f58c7ef6f42489c3251e9f474be72 Boot ID: e43741739e584fb4930cf608e15aed74 Virtualization: vmware Operating System: Red Hat Enterprise Linux Server 7.0 (Maipo) CPE OS Name: cpe:/o:redhat:enterprise_linux:7.0:GA:server Kernel: Linux 3.10.0-123.el7.x86_64 Architecture: x86_64
002、查看是否支持磁盘容量配额
[root@PC1 home]# mount | grep boot /dev/sda1 on /boot type xfs (rw,relatime,seclabel,attr2,inode64,noquota) ## noquota, 说明不支持磁盘容量配额
003、修改配置文件
[root@PC1 home]# vim /etc/fstab ## 编辑配置文件 # # /etc/fstab # Created by anaconda on Tue Sep 13 14:28:43 2022 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # /dev/mapper/rhel-root / xfs defaults 1 1 UUID=70a81f5c-a185-4bf5-8bea-38a638645def /boot xfs defaults,uquota 1 2 /dev/mapper/rhel-swap swap swap defaults 0 0
004、重启系统
reboot
005、查看磁盘容量配额权限
[root@PC1 home]# mount | grep boot ## 检查磁盘容量配额 /dev/sda1 on /boot type xfs (rw,relatime,seclabel,attr2,inode64,usrquota) ## 已经包含磁盘容量配额
006、