Link to home
Start Free TrialLog in
Avatar of luser9999
luser9999

asked on

Implement Disk quotas for a root file system

Hello All,

I have a question about disk quota for users in red hat linux. we have no separate file system for /home and we have only one (/) root file system for everything else on the system and also /boot file system. Is there any way that we can still implement quotas for users through their home directories was mounted on (/) root file system.

Do we need to have a separate file system (/home) compulsory for implementing disk quotas?

I need your suggestions/help on this

Thank you
Avatar of Voynich
Voynich

You can set quotas to your root filesystem as well. Just edit your /etc/fstab and add the usrquota,grpquota option. You don't need a separate filesystem.
Avatar of luser9999

ASKER

Thank you, let me try it on a test box here and will get back to you.
Hi Voynich:

I tried as you suggested, modified /etc/fstab and added usrquota,grpquota for / file system and then remounted fs as
mount -o remount,rw /

and then issued mount command,

[root@rhel5-mac ~]# mount
/dev/sda2 on / type ext3 (rw,usrquota,grpquota)
proc on /proc type proc (rw)
.....
.....

[root@rhel5-mac ~]# quotacheck -avgum
quotacheck: Scanning /dev/sda2 [/] quotacheck: Cannot stat old user quota file: No such file or directory
quotacheck: Cannot stat old group quota file: No such file or directory
quotacheck: Cannot stat old user quota file: No such file or directory
quotacheck: Cannot stat old group quota file: No such file or directory
done
quotacheck: Checked 13727 directories and 118296 files
quotacheck: Old file not found.
quotacheck: Old file not found.

I got the above error but both user and group quota files were created fine under /.

later I used,
#edquota test123
gave soft (50Mb) and hard (100MB) block limit for user test123, but the user did not receive any warning and he can save data more than 120 MB without reporting any quota error. It looks the quota isn't working properly.

[root@rhel5-mac ~]# repquota -a
*** Report for user quotas on device /dev/sda2
Block grace time: 7days; Inode grace time: 7days
                        Block limits                File limits
User            used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
root      -- 6440536       0       0         131916     0     0      
daemon    --      20       0       0              3     0     0      
lp        --      16       0       0              2     0     0      
rpc       --       4       0       0              1     0     0      
smmsp     --      12       0       0              2     0     0      
ntp       --       8       0       0              1     0     0      
rpcuser   --       8       0       0              1     0     0      
avahi     --      12       0       0              3     0     0      
mysql     --   21656       0       0             74     0     0      
xfs       --       0       0       0              1     0     0      
test123     --      68   50000  100000             18     0     0      

the user home directory contains data more than 120 MB but it can't be shown under repquota usage.
Could some one please help on this

thanks
ASKER CERTIFIED SOLUTION
Avatar of Voynich
Voynich

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That did it. I forgot to activate the quota. It looks to be working good now.

thank you :)
thanks