Sunday 7 October 2012

how to set disk quota in linux for a user



Crete a partition if required

Fdisk /dev/sda

Create partition

Create user =vijay

#useradd vijay  [user add]

#passwd 12345  [set password for user vijay]

Create directory =redhat

#mkdir redhat [for create redhat directory]
 
Setp =2 

#chmod 777 /redhat [set default permission on the directory]

#vi  /etc/fstab    [entry in this file below mention detail ]

/dev/sda3         /redhat           ext3     usrquota          0 0
:wq
 [note: entry only that partition which is you make like that /dev/sda3, /dev/sda4, dev/sda5]

Mount –a

Mkfe2fs –J /dev/sda3     [format the partition ]

Mount –o remount /redhat

Quotacheck –mug /redhat

Ls /redhat [show quota]

Setquota –u vijay 30 70 5 8 /redhat 

30 warning disk quota 70 disk quota 5 warning file quota  8 file quota

Quotaon /redhat

Repquota –a [show all user quota ]

Quotaoff /vijay     [quota off on the user]

No comments:

Post a Comment