255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 1305 10377990 8e Linux LVM
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
/dev/sdb1 1 125 1004031 83 Linux
/dev/sdb2 126 391 2136645 5 Extended
/dev/sdb5 126 391 2136613+ 83 Linux
[root@localhost ~]# useradd -g vgroup vuser1
[root@localhost ~]# useradd -g vgroup vuser2
[root@localhost ~]# passwd vuser1
Changing password for user vuser1.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@localhost ~]# passwd vuser2
Changing password for user vuser2.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@localhost ~]#
注意输入密码的时候是不回显的,只要输入的时候确保正确即可,输两次。
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
8.5G 2.8G 5.3G 35% /
/dev/sda1 99M 12M 82M 13% /boot
tmpfs 302M 0 302M 0% /dev/shm
/dev/sdb5 2.1G 68M 1.9G 4% /mnt/quota
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
/dev/sdb5 /mnt/quota ext3 defaults,usrquota,grpquota 0 0
~
~
~
~
~
~
/dev/mapper/VolGroup00-LogVol00 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/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/dev/sdb5 on /mnt/quota type ext3 (rw,usrquota,grpquota)
好了。已经设置完毕
quotacheck: Scanning /dev/sdb5 [/mnt/quota] done
quotacheck: Checked 3 directories and 4 files
[root@localhost ~]# ll /mnt/quota/
total 32
-rw------- 1 root root 7168 Aug 6 20:53 aquota.group
-rw------- 1 root root 7168 Aug 6 20:53 aquota.user
drwx------ 2 root root 16384 Jul 24 14:36 lost+found
[root@localhost ~]#
/dev/sdb5 [/mnt/quota]: group quotas turned on
/dev/sdb5 [/mnt/quota]: user quotas turned on
Filesystem blocks soft hard inodes soft hard
/dev/sdb5 0 45000 50000 0 0 0
Grace period before enforcing soft limits for users:
Time units may be: days, hours, minutes, or seconds
Filesystem Block grace period Inode grace period
/dev/sdb5 2days 7days
~
~
~
查看用户的磁盘配额设置值:
Disk quotas for user vuser1 (uid 504):
Filesystem blocks quota limit grace files quota limit grace
/dev/sdb5 0 45000 50000 0 0 0
Disk quotas for user vuser2 (uid 505):
Filesystem blocks quota limit grace files quota limit grace
/dev/sdb5 0 45000 50000
Filesystem blocks soft hard inodes soft hard
/dev/sdb5 0 180000 200000 0 0 0
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
/sbin/quotaon -avug
~
~
:x