Tanti Technology

My photo
Bangalore, karnataka, India
Multi-platform UNIX systems consultant and administrator in mutualized and virtualized environments I have 4.5+ years experience in AIX system Administration field. This site will be helpful for system administrator in their day to day activities.Your comments on posts are welcome.This blog is all about IBM AIX Unix flavour. This blog will be used by System admins who will be using AIX in their work life. It can also be used for those newbies who want to get certifications in AIX Administration. This blog will be updated frequently to help the system admins and other new learners. DISCLAIMER: Please note that blog owner takes no responsibility of any kind for any type of data loss or damage by trying any of the command/method mentioned in this blog. You may use the commands/method/scripts on your own responsibility. If you find something useful, a comment would be appreciated to let other viewers also know that the solution/method work(ed) for you.

Wednesday, 30 August 2017

Quota's Concept on RHEL/CentOS 6


  Quota allows Administrator to specify restriction in two ways :

  1) Restricting a user or a group by creating files in a specific location.
  2) Restricting a user or a group by the disk space in a specific location.
    
The idea behind quotas is that users are forced to stay under their disk consumption limit or with number of files in a particular location.


Quota is handled on a per user, per file system basis.

Quotas are of two types :
   User level quotas      - usrquota
   Group level quotas     - grpquota



To apply userquota

vi /etc/fstab

/dev/sda5     /home    ext4  defaults,usrquota 0 0

(add usrquota beside defaults)

#mount -o remount,rw /home

(to remount /home partition)


to check quotas
#quotacheck -cvug  /home


to on quota

# quotaon /home

to set quota for an user

# edquota -u  

/dev/sda5      blocks    soft    hard inodes soft     hard
32          0          0         12        0         0



here blocks means the data already present in that users home directory
soft means at which space u want to send a warning to user 
hard means at which space u want to restrict user to write into his home directory
note: for both soft&hard we have to add block size
by defaults quotas will be in off mode we have to manually switchon quotas
#quotaon /home

to check:
1)login as user

type dd if=/dev/zero of=myfile bs=1024 count=10

dd =diskdrive
if = input file (/dev/zero means it's  a null file)
of = output file 
bs=blocksize(default in bytes)
count= howmany no.of blocks u want to create


to check quota as an admin
#repquota /home


to set users mahesh quota for user suresh

#edquota -p mahes suresh


To work with group quota



 to work with groupquota we have to create quota enabled partition


create a partition
format with ext4 file system
create a new mountpoint

#mount -o  usrquota,grpquota

#quotacheck -cugv

edquota -g  

No comments:

Post a Comment