Debian 7.0
Sponsored Link

Set Disk Quota2013/06/05

 
Set Disk Quota. This example shows to set it at /home
[1] Set Disk Quota
root@dlp:~#
aptitude -y install quotatool
root@dlp:~#
vi /etc/fstab
# add "usrquota" for the line like follows

/dev/mapper/tmp-root
/ ext4 errors=remount-ro 0 1

UUID=09ba8cc3-dc1a-4a35-8e19-78de63e555ee /boot ext2 defaults 0 2
/dev/mapper/tmp-swap_1
none swap sw 0 0

/dev/mapper/vg_target00-lv_target00
/home ext4 defaults
,usrquota
0 1
root@dlp:~#
# reboot
root@dlp:~#
quotacheck -um /home
# create a file for quota

root@dlp:~#
quotaon -uv /home
# enable quota

/dev/mapper/vg_target00-lv_target00 [/home]: user quotas turned on
root@dlp:~#
quotaon -p -a
# make sure settings

group quota on /home (/dev/mapper/vg_target00-lv_target00) is off
user quota on /home (/dev/mapper/vg_target00-lv_target00) is on
root@dlp:~#
edquota -u wheezy
# set quota for a user 'wheezy'
# specify quota. the example below set 1G for it

Disk quotas for user wheezy (uid 1000):
  Filesystem
blocks
  soft
hard
 inodes
  soft
hard

/dev/mapper/vg_target00-lv_target00   32  
1024000
 
1024000
    8   0 0
root@dlp:~#
# make sure status

*** Report for user quotas on device /dev/mapper/vg_target00-lv_target00
Block grace time: 7days; Inode grace time: 7days
                        Block limits                File limits
User            used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
root      --      20       0       0              2     0     0
wheezy    --      20 1024000 1024000              5     0     0
fedora    --      20       0       0              5     0     0
[2] Apply a setting for a user to another user.
root@dlp:~#
edquota -p wheezy fedora
# apply quota for 'wheezy' to user 'fedora'

root@dlp:~#
# make sure status

*** Report for user quotas on device /dev/mapper/vg_target00-lv_target00
Block grace time: 7days; Inode grace time: 7days
                        Block limits                File limits
User            used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
root      --      20       0       0              2     0     0
wheezy    --      20 1024000 1024000              5     0     0
fedora    --      20 1024000 1024000              5     0     0
Matched Content