Control Web Panel

WebPanel => CentOS Configuration => Topic started by: Administrator on September 09, 2014, 09:59:48 PM

Title: How to setup user quotas ?
Post by: Administrator on September 09, 2014, 09:59:48 PM
Let's say that your /home partition is in / mount point

install quota on your centos
Code: [Select]
yum install quota
Edit: /etc/fstab   
Code: [Select]
vi /etc/fstab 
replace "defaults" with "usrjquota=quota.user,jqfmt=vfsv0" for / mount point

Before (in some cases this can be different!):
Code: [Select]
UUID=ac567666-9385-4ef5-885c-80f61ec64647       /       ext3    defaults        1       1After Replace:
Code: [Select]
UUID=ac567666-9385-4ef5-885c-80f61ec64647       /       ext3    usrjquota=quota.user,jqfmt=vfsv0        1       1
Code: [Select]
mount -o remount /
quotacheck -avugm
quotaon -avug



If you have /home in /etc/fstab then you will need to edit line matching /home
replace "defaults" with "usrjquota=quota.user,jqfmt=vfsv0" for /home mount point

Before:
Code: [Select]
UUID=ac567666-9385-4ef5-885c-80f61ec64647       /home       ext3    defaults        1       1After Replace:
Code: [Select]
UUID=ac567666-9385-4ef5-885c-80f61ec64647       /home       ext3    usrjquota=quota.user,jqfmt=vfsv0        1       1
Code: [Select]
mount -o remount /home
quotacheck -avugm
quotaon -avug

Now you need to add this into the CWP Configuration
Code: [Select]
mkdir -p /usr/local/cwp/.conf/
echo "/home" > /usr/local/cwp/.conf/quota_part.conf


How to check if quota works ?
Code: [Select]
repquota -a This will display you user limits

Set a quota for all users by package from cwp
Code: [Select]
/scripts/cwp_api account update_diskquota_all

If you had previously added users then you will need to update the quota for them, you can do that by clicking on each account edit and then saving changes, or you can edit packages and save them for all users.

XFS Quota (only for XFS file system!!!)
Code: [Select]
yum -y install quota quota-devel
edit file: /etc/fstab and add usrquota,grpquota example:
/dev/mapper/centos_root-home /home xfs defaults,usrquota,grpquota 0 0

before example
Code: [Select]
/dev/mapper/centos_root-home /home xfs defaults 0 0aftere example
Code: [Select]
/dev/mapper/centos_root-home /home xfs defaults,usrquota,grpquota 0 0
Activate quota as XFS for /home
in CWP.admin go to Left Menu -> Server Settings --> Disk Quota , and set
Quota Partition: /home
Quota Type: xfs

reboot the server

Next, activate quota for all accounts
in cwp.admin go to Left Menu -> Packages -> List Packages
edit all packages you have and select "Update Quota" to set the quota for all accounts using this package.

How to check if /home is mounted with quota
Code: [Select]
mount |grep homeif you have there listed usrquota,grpquota for /home then all should work fine.
=============
XFS: In some cases, you would also need to modify grub conf if the above fails

Code: [Select]
# mount | grep ' / '
/dev/mapper/cl-root on / type xfs (rw,relatime,attr2,inode64,noquota)


 If you see "noquota" in the xfs mount options for the / partition then you would need to modify file: /etc/default/grub
Find the line with the variable "GRUB_CMDLINE_LINUX" and at end of the line add: "rootflags=uquota,pquota"

Example:
Code: [Select]
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb quiet rootflags=uquota,pquota"
Make backup and create grub config for boot
Code: [Select]
cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.orig
grub2-mkconfig -o /boot/grub2/grub.cfg
echo xfs > /usr/local/cwp/.conf/quota_type.conf

now reboot the server
Code: [Select]
reboot
after reboot run API to set quota for all users
Code: [Select]
/scripts/cwp_api account update_diskquota_all
Note: If you want emails and user home to be under the same quota then /var/vmail and /home need to be on the same partition.
Title: Re: How to setup user quotas ?
Post by: skycom on September 10, 2014, 01:11:33 PM
Hello, I had install my CentOS Web Panel and I config Quota like said here. Now I create a Domain and I´m traying to upload an archive.

In the FileZilla, give me an error and its create me a file with 0K of space.

Any Help?
Title: Re: How to setup user quotas ?
Post by: Administrator on September 10, 2014, 05:05:26 PM
login to user panel and check quota usage
Title: Re: How to setup user quotas ?
Post by: Teucrus on November 14, 2014, 05:41:05 PM
Hi,
My /etc/fstab only has these records in it:

none    /dev/pts        devpts  rw,gid=5,mode=620       0       0
none    /dev/shm        tmpfs   defaults                0       0

I can't seem to find the / mount point. The above is the only contents of the file.
Title: Re: How to setup user quotas ?
Post by: Administrator on November 18, 2014, 12:40:00 AM
on the OpenVZ VPS servers you should contact your hosting provider to do that for you.
Title: Re: How to setup user quotas ?
Post by: Teucrus on November 18, 2014, 08:50:38 AM
I am my hosting provider. I own the whole dedicated server. Are you saying I should install it on the host server?
I have root access to both the vps and the dedicated server.
Title: Re: How to setup user quotas ?
Post by: Administrator on November 18, 2014, 11:49:19 PM
you need to enable it on the main node
http://wiki.openvz.org/User_Guide/Managing_Resources#Turning_On_and_Off_Second-Level_Quotas_for_Container
Title: Re: How to setup user quotas ?
Post by: ashokjp on November 23, 2014, 09:32:21 PM
Should we enable journalled quota ?

at hardware level secondary quota enabled but still this is the output
Filesystem      Size  Used Avail Use% Mounted on
/dev/simfs       60G  3.5G   57G   6% /
none            512M  4.0K  512M   1% /dev
[root@s2 ~]# mount -o remount /
mount: permission denied

[root@s2 ~]# quotacheck -avugm
quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown.
quotacheck: Quota for users is enabled on mountpoint / so quotacheck might damage the file.
Please turn quotas off or use -f to force checking.
Title: Re: How to setup user quotas ?
Post by: Administrator on November 23, 2014, 11:43:31 PM
for openvz system you need to contact your hosting provider.
Title: Re: How to setup user quotas ?
Post by: erm3nda on December 16, 2014, 07:03:59 AM
Related to OpenVZ, the first check we have to do is change another's fresh user account the try to write disk.

If you can write disk with ANY user you have not reach OpenVZ container and it's your server problem/missconfiguration. If you reach global Container limits, you can write at all, plus the VPS can shutdown due to that and restart in recovery mode.

A example to write test can be using dd, by creating dummy file:
dd if=/dev/urandom of=delete-me bs=128M count=1; sync; rm -f delete-me; echo "Test finished. File removed.";

This will write 128Mb of random content and show you statistitcs.

Regards.
Title: Re: How to setup user quotas ?
Post by: infinitech07 on December 30, 2014, 10:49:47 AM
I had the quota installed and set the necessary settings on /etc/fstab, but sometimes when restarted the server and re-login onto CWP it showed the quota notification again.

How can I set the quota permanently onto the server??

Quote
[root@server ~]# ll /dev/root
ls: cannot access /dev/root: No such file or directory
[root@server ~]# ln -s /dev/xvda /dev/root
[root@server ~]# ll /dev/root
lrwxrwxrwx 1 root root 9 Dec 30 10:37 /dev/root -> /dev/xvda
[root@server ~]# mount -o remount /
[root@server ~]# quotacheck -avugm
quotacheck: Scanning /dev/root [/] done
quotacheck: Old group file name could not been determined. Usage will not be substracted.
quotacheck: Checked 11062 directories and 110366 files
[root@server ~]# quotaon -avug
/dev/root [/]: user quotas turned on
Title: Re: How to setup user quotas ?
Post by: Administrator on January 01, 2015, 03:46:47 PM
what is the output of:
df -h
cat /etc/fstab
Title: Re: How to setup user quotas ?
Post by: alexchar on January 09, 2015, 11:59:53 PM
What about KVM? I didn't understood what should I replace as I don't have
Code: [Select]
UUID=ac567666-9385-4ef5-885c-80f61ec64647       /       ext3    defaults        1       1or
Code: [Select]
mount -o remount /
quotacheck -avugm
quotaon -avug

I'm using KVM Vps server.
Title: Re: How to setup user quotas ?
Post by: MyBuddyBen on February 02, 2015, 02:21:05 PM
Can someone do a YouTube video of how to do this?  ;D It would help me a bunch!
Title: Re: How to setup user quotas ?
Post by: Administrator on February 04, 2015, 02:20:12 AM
new version will have quota setup script to do this automatically for you.
Title: Re: How to setup user quotas ?
Post by: cacedicam on February 15, 2015, 11:54:43 AM
hi
i have quota problem to apply tuto but not work, i have lastest version for cwp
how to fix it ?
Title: Re: How to setup user quotas ?
Post by: devnull on February 15, 2015, 06:18:03 PM

Are you using a VPS server?

You followed http://forum.centos-webpanel.com/centos-configuration/how-to-setup-user-quotas/

See the comment :

 >Re: How to setup user quotas ?
>« Reply #8 on: November 23, 2014, 11:43:31 PM »

  >  Quote

>for openvz system you need to contact your hosting provider.



Title: Re: How to setup user quotas ?
Post by: erm3nda on February 19, 2015, 01:12:51 AM
Thank you sir.

My waiting has rewarded me with work done by you.
Just kidding, thank you really :)
Title: Re: How to setup user quotas ?
Post by: tomidjx on March 23, 2015, 01:20:28 PM
new version will have quota setup script to do this automatically for you.

I tried the quota setup script, and it seems to work, however, when i logout and login again still get the message that i need to set up quotas..

how do I know quotas are set correctly? in the packages i can set quotas and quotas are showing uo in list packages, however, the warning message about setting up quotas on the dashboard will reappear anytime i login in admin CWP.

any advice will be greatly appreciated.
Title: Re: How to setup user quotas ?
Post by: Administrator on March 24, 2015, 06:14:10 PM
try by checking all users quota

Code: [Select]
repquota -a -s
Title: Re: How to setup user quotas ?
Post by: tomidjx on March 27, 2015, 03:16:41 PM
try by checking all users quota

Code: [Select]
repquota -a -s

I don't get any output from that command, no errors, no messages, it just goes to next line, as [root@myuser]#

what output should i get? cwp let me set up quotas and select/modify  packages when creating an account.
I did "setup disk quotas" in admin panel and get message 
"Quota Configuration file /usr/local/cwp/.conf/quota_part.conf Already Exist!"

however the warning message remain when i do login in admin.

if i try to open quota_part.conf (with nano) there's nothing inside, just "/"
Title: Re: How to setup user quotas ?
Post by: tomidjx on March 27, 2015, 11:32:11 PM
try by checking all users quota

Code: [Select]
repquota -a -s

I don't get any output from that command, no errors, no messages, it just goes to next line, as [root@myuser]#

what output should i get? cwp let me set up quotas and select/modify  packages when creating an account.
I did "setup disk quotas" in admin panel and get message 
"Quota Configuration file /usr/local/cwp/.conf/quota_part.conf Already Exist!"

however the warning message remain when i do login in admin.

if i try to open quota_part.conf (with nano) there's nothing inside, just "/"

I had a second (and 3rd) look at this 3d, and tried to follow avery clues to fgure out what to do.

1) i tried to yum install quotas and got this output:
Package 1:quota-3.17-21.el6_5.x86_64 already installed and latest version
Nothing to do
2 ) i tried to edit /etc/fstab
and got this output:
# /etc/fstab
# Created by anaconda on Sun Mar  9 13:40:48 2014
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/xvda       /               ext4    noatime,errors=remount-ro       0 1
/dev/xvdb       none            swap    sw                              0 0
tmpfs                   /dev/shm                tmpfs   nodev,nosuid,noexec,mode=1777        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
/proc                    /proc                   proc    defaults        0 0

I'm not sure how i should replace default as indicated by the administrator.
Apparently in the new version it should be all set from the admin panel, and i tried, to no avail so far.

Any useful advice will be very welcome.
Title: Re: How to setup user quotas ?
Post by: brijendrasial on March 28, 2015, 01:28:30 AM
As you dont have a separate partition for /home so you need to add quota for root. Replace noatime,errors=remount-ro with noatime,errors=remount-ro,usrjquota=quota.user,jqfmt=vfsv0

After than run the commands below:
mount -o remount /
quotacheck -avugm
quotaon -avug

Now verify if quota is enabled:
repquota -a
Title: Re: How to setup user quotas ?
Post by: tomidjx on March 28, 2015, 01:01:56 PM
As you dont have a separate partition for /home so you need to add quota for root. Replace noatime,errors=remount-ro with noatime,errors=remount-ro,usrjquota=quota.user,jqfmt=vfsv0

After than run the commands below:
mount -o remount /
quotacheck -avugm
quotaon -avug

Now verify if quota is enabled:
repquota -a
Thanks a lot for your suggestions. Unfortunately it didn't work, this command "quotacheck -avugm" gave me this output: Cannot stat() mounted device /dev/root: No such file or directory.

I gave up and deleted the whole thing. It's too complicated for me, there are a number of things which didn't work for me..
set up quotas, mod_security configuration, mod_rewrite...Bind not starting..

It's a pity as I really like the panel for what it should be, but I spent about a week trying to figure it out. 
Probably the best way for me would be to have it managed, but then for the cost I'll stick with cPanel, it works like a charm and support nginx with a plugin (and for me nginx it's a priority).

Thanks everyone. I'll check out future development of this panel, in particular I will look at a significant improvement with documentation with regard to configuration, and nginx support.
Title: Re: How to setup user quotas ?
Post by: hopefaith on August 04, 2015, 08:25:36 AM
I just want to clarify.... Im using the latest version, it has this feature but in the root dashboard,
it is still showing a "warning about this feature not set up"... Is this a Bug or what???
Title: Re: How to setup user quotas ?
Post by: Javilonas on August 08, 2015, 06:05:56 AM
try by checking all users quota

Code: [Select]
repquota -a -s

I don't get any output from that command, no errors, no messages, it just goes to next line, as [root@myuser]#

what output should i get? cwp let me set up quotas and select/modify  packages when creating an account.
I did "setup disk quotas" in admin panel and get message 
"Quota Configuration file /usr/local/cwp/.conf/quota_part.conf Already Exist!"

however the warning message remain when i do login in admin.

if i try to open quota_part.conf (with nano) there's nothing inside, just "/"

I had a second (and 3rd) look at this 3d, and tried to follow avery clues to fgure out what to do.

1) i tried to yum install quotas and got this output:
Package 1:quota-3.17-21.el6_5.x86_64 already installed and latest version
Nothing to do
2 ) i tried to edit /etc/fstab
and got this output:
# /etc/fstab
# Created by anaconda on Sun Mar  9 13:40:48 2014
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/xvda       /               ext4    noatime,errors=remount-ro       0 1
/dev/xvdb       none            swap    sw                              0 0
tmpfs                   /dev/shm                tmpfs   nodev,nosuid,noexec,mode=1777        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
/proc                    /proc                   proc    defaults        0 0

I'm not sure how i should replace default as indicated by the administrator.
Apparently in the new version it should be all set from the admin panel, and i tried, to no avail so far.

Any useful advice will be very welcome.

Replace:
Quote
/dev/xvda       /               ext4    noatime,errors=remount-ro       0 1

for:
Quote
/dev/xvda      /        ext4    noatime,errors=remount-ro,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0     0       1

Then do not forget:
Quote
ln /dev/root /dev/xvda

mount -o remount /
quotacheck -avugm
quotaon -avug

repquota -a
Title: Re: How to setup user quotas ?
Post by: Samekas on December 09, 2015, 04:56:52 PM
Lets say that your /home partition is in / mount point

install quota on your centos
Code: [Select]
yum install quota
Edit: /etc/fstab   
Code: [Select]
vi /etc/fstab 
replace "defaults" with "usrjquota=quota.user,jqfmt=vfsv0" for / mount point

Before:
Code: [Select]
UUID=ac567666-9385-4ef5-885c-80f61ec64647       /       ext3    defaults        1       1After Replace:
Code: [Select]
UUID=ac567666-9385-4ef5-885c-80f61ec64647       /       ext3    usrjquota=quota.user,jqfmt=vfsv0        1       1
Code: [Select]
mount -o remount /
quotacheck -avugm
quotaon -avug



If you have /home in /etc/fstab then you will need to edit line matching /home
replace "defaults" with "usrjquota=quota.user,jqfmt=vfsv0" for /home mount point

Before:
Code: [Select]
UUID=ac567666-9385-4ef5-885c-80f61ec64647       /home       ext3    defaults        1       1After Replace:
Code: [Select]
UUID=ac567666-9385-4ef5-885c-80f61ec64647       /home       ext3    usrjquota=quota.user,jqfmt=vfsv0        1       1
Code: [Select]
mount -o remount /home
quotacheck -avugm
quotaon -avug

Now you need to add this into the CWP Configuration
Code: [Select]
mkdir -p /usr/local/cwp/.conf/
echo "/home" > /usr/local/cwp/.conf/quota_part.conf


How to check if quota works ?
Code: [Select]
repquota -a This will display you user limits

If you had a previously added users then you will need to update quota for them, you can do that by clicking on each account edit and then saving changes, or you can edit packages and save it for all users.

Hello,

Mine is diferent, I have this:

/dev/md2        /       ext3    errors=remount-ro       0       1
/dev/md3        /var    ext4    defaults,usrquota,grpquota      1       2
/dev/sda4       swap    swap    defaults,usrquota,grpquota      0       0
/dev/sdb4       swap    swap    defaults,usrquota,grpquota      0       0
proc            /proc   proc    defaults,usrquota,grpquota              0       0
sysfs           /sys    sysfs   defaults,usrquota,grpquota              0       0
tmpfs           /dev/shm        tmpfs   defaults,usrquota,grpquota      0       0
devpts          /dev/pts        devpts  defaults,usrquota,grpquota      0       0


What to replace? Thank you in advance!
Title: Re: How to setup user quotas ?
Post by: Igor S. on December 11, 2015, 10:12:11 AM
Hi, try to edit your /etc/fstab file.
Title: Re: How to setup user quotas ?
Post by: Samekas on December 17, 2015, 03:59:44 PM
Hi, try to edit your /etc/fstab file.

I know , but what to change exactly? thanks
Title: Re: How to setup user quotas ?
Post by: pjlarambla on February 11, 2016, 08:04:33 PM
Hi,

Am quite new to all this have just installed CWP 2 days ago setup going quite well accept for these Quotas.

My VPS is open not sure if I got on to the suppliers of this that they would do this for me on my VPS as it is Unmanaged
as this is now 2016 it is a long time since the admin said the following statement and I have the latest install of CWP.
Seems a bit wrong
Statement: new version will have quota setup script to do this automatically for you. has this scrip been isued and if so where can we get it eyes not to good.
Can any one tell me what exactly are these quotas and why are the  needed.if it disk space surely the packages should limit what customers would use.

Many thanks All
Title: Re: How to setup user quotas ?
Post by: worldbus on February 13, 2016, 12:47:46 PM
I using centos web panel on dedicated server.
quota enabled on server, but control panel user data is not synced.

for example "repquota -a -s"
Code: [Select]
[root@static ~]# repquota -a -s
*** Report for user quotas on device /dev/md3
Block grace time: 7days; Inode grace time: 7days
                        Block limits                File limits
User            used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
root      --  86967M       0       0          75704     0     0
daemon    --       8       0       0              3     0     0
lp        --       8       0       0              2     0     0
nobody    --   51492       0       0           4237     0     0
rpc       --      12       0       0              4     0     0
abrt      --      24       0       0              4     0     0
rpcuser   --      16       0       0              5     0     0
haldaemon --       8       0       0              2     0     0
ntp       --       8       0       0              2     0     0
postfix   --      76       0       0             49     0     0
mysql     --   22000       0       0            155     0     0
dovecot   --       4       0       0              3     0     0
named     --      64       0       0              9     0     0
apache    --       8       0       0              2     0     0
vmail     --      16       0       0              8     0     0
vacation  --       4       0       0              2     0     0
nginx     --     196       0       0              2     0     0
masiup1   --   45280    500G    500G           3571     0     0
short     --    134M    500G    500G          16294     0     0
#507      --   19592       0       0             26     0     0
#1000     --   11860       0       0            887     0     0
#119      --    8420       0       0            345     0     0

CWP data after login for "masiup1":
Code: [Select]
System Stats

Disk Space: 44MB / 512000MB ( 0%)
Inode Usage: 3571 / 0 ( 0% ) Info

Whats wrong and how can resolve this issue?
Title: Re: How to setup user quotas ?
Post by: alband on May 22, 2016, 12:33:54 AM
I using centos web panel on dedicated server.
quota enabled on server, but control panel user data is not synced.

for example "repquota -a -s"
Code: [Select]
[root@static ~]# repquota -a -s
*** Report for user quotas on device /dev/md3
Block grace time: 7days; Inode grace time: 7days
                        Block limits                File limits
User            used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
root      --  86967M       0       0          75704     0     0
daemon    --       8       0       0              3     0     0
lp        --       8       0       0              2     0     0
nobody    --   51492       0       0           4237     0     0
rpc       --      12       0       0              4     0     0
abrt      --      24       0       0              4     0     0
rpcuser   --      16       0       0              5     0     0
haldaemon --       8       0       0              2     0     0
ntp       --       8       0       0              2     0     0
postfix   --      76       0       0             49     0     0
mysql     --   22000       0       0            155     0     0
dovecot   --       4       0       0              3     0     0
named     --      64       0       0              9     0     0
apache    --       8       0       0              2     0     0
vmail     --      16       0       0              8     0     0
vacation  --       4       0       0              2     0     0
nginx     --     196       0       0              2     0     0
masiup1   --   45280    500G    500G           3571     0     0
short     --    134M    500G    500G          16294     0     0
#507      --   19592       0       0             26     0     0
#1000     --   11860       0       0            887     0     0
#119      --    8420       0       0            345     0     0

CWP data after login for "masiup1":
Code: [Select]
System Stats

Disk Space: 44MB / 512000MB ( 0%)
Inode Usage: 3571 / 0 ( 0% ) Info

Whats wrong and how can resolve this issue?


You can change the user quota creating a package, then edit the user and assign package.
Title: Re: How to setup user quotas ?
Post by: tshetumd on May 23, 2016, 04:49:08 AM
Quotas for most of the users are not showing,  I have many users  tough. Please find the out of repquota -a -s and advise me .

*** Report for user quotas on device /dev/mapper/vg_yonphula-LogVol01_Root
Block grace time: 7days; Inode grace time: 7days
                        Block limits                File limits
User            used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
root      --   1805M       0       0          47239     0     0       
daemon    --       8       0       0              3     0     0       
nobody    --   51472       0       0           4232     0     0       
postfix   --      76       0       0             49     0     0       
tdhendup  --   88084       0       0           6628     0     0       
tshetum   --    134M       0       0          16299     0     0       
slhamo    --    137M       0       0          16488     0     0       
mysql     --   22004       0       0            155     0     0       
dovecot   --       4       0       0              3     0     0       
named     --      36       0       0              9     0     0       
vmail     --      16       0       0              8     0     0       
vacation  --       4       0       0              2     0     0       
rapagovb  --      32       0       0              9     0     0       
yellowbh  --   19592   1024M   1024M             26     0     0       
#1000     --   25596       0       0           1869     0     0       
#119      --    8420       0       0            345     0     0       

PS: we are using KVM
Thanks
Title: Re: How to setup user quotas ?
Post by: pixelpadre on June 13, 2016, 03:39:03 PM
I clicked on setup quotas and received this message:
Quota Configuration file /usr/local/cwp/.conf/quota_part.conf Already Exist!
Title: Re: How to setup user quotas ?
Post by: pixelpadre on June 13, 2016, 06:29:47 PM
I clicked on setup quotas and received this message:
Quota Configuration file /usr/local/cwp/.conf/quota_part.conf Already Exist!

fstab


#
# /etc/fstab
# Created by anaconda on Sun Mar  9 13:40:48 2014
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/sda       /               ext4    noatime,errors=remount-ro,usrjquota=quota.user,jqfmt=vfsv0       0 1
/dev/sdb       none            swap    sw                              0 0
tmpfs                   /dev/shm                tmpfs   nodev,nosuid,noexec,mode=1777        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
/proc                    /proc                   proc    defaults        0 0
Title: Re: How to setup user quotas ?
Post by: pixelpadre on June 13, 2016, 10:10:31 PM
I am using Linode vps.  there is no /dev/root so how can I fix this?
Title: Re: How to setup user quotas ?SOLVED
Post by: pixelpadre on June 13, 2016, 11:05:40 PM
First you have to make a link to the missing root directory

In my case my main directory is /dev/sda  ...so shell command is ln -s /dev/sda /dev/root
Then I had to modify /etc/fstab file to show the user group addition string 
/dev/sda       /               ext4    noatime,errors=remount-ro,usrjquota=quota.user,jqfmt=vfsv0
Then I had to remount the hard drive
mount -o remount /dev/sda
then I had to login to cwp panel and click on users list.  Select your user to edit and immediately save with no changes.  That will implement quota for that user.

That should do it.  Its possible that the link will have to be recreated every time you reboot the server.  There is a work around here  https://forum.linode.com/viewtopic.php?t=8294#p64363 "xvda" would be changed to your hard drive location.
Title: Re: How to setup user quotas ?
Post by: erk1n on February 19, 2017, 09:20:45 PM
Hi CWP folks! It's a very good panel, only minor bugs and lack of reseller panel. Million thanks to the developers. I will upgrade it to Pro version and donate regularly as my project grows. I'm not a coder. At least, I would like to reports bugs to the developer team for contribution.

I just installed quota.
Then edited /etc/fstab file as below

Code: [Select]
/dev/mapper/cos-root /                   xfs   usrjquota=quota.user,jqfmt=vfsv0,noatime        0 0
UUID=05216e1d-8bc7-487c-8bbb-cecadd24010c /boot                   ext2   defaults,noatime        1 0

Then typed
Code: [Select]
mount -o remount /After typed
Code: [Select]
quotacheck -avugmGot this error message
Code: [Select]
quotacheck: Cannot find filesystem to check or filesystem not mounted with quota option.Typed
Code: [Select]
quotaon -avugNo response!

Checked if quota works by typing
Quote
repquota -a
No response!!

Tried many times but no, it doesn't work!

Maybe it's because of xfs file system? Any solution?

Thanks a lot.

System: VPS (KVM), Distro: CentOS 7.3
Title: Re: How to setup user quotas ?
Post by: erk1n on March 02, 2017, 02:12:11 PM
Up!!

Thanks.
Title: Re: How to setup user quotas ?
Post by: erk1n on March 13, 2017, 10:59:56 PM
Could you please help?
Title: Re: How to setup user quotas ?
Post by: nuffsaid on March 18, 2017, 06:14:56 PM
new version will have quota setup script to do this automatically for you.

The script is not working in mine, it just loads and refreshes the page ,nothing happens
Title: Re: How to setup user quotas ?
Post by: shakensoul on April 13, 2017, 06:46:27 PM
Disk Quota is not working. It only shows disk quota for root

Output of repquota -a

Code: [Select]
*** Report for user quotas on device /dev/vda1
Block grace time: 7days; Inode grace time: 7days
                        Block limits                File limits
User            used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
root      --  101018       0       0            340     0     0       

All user accounts show this message

Code: [Select]
Disk quotas for user xxxx (uid 1006): none

What could be the problem?
Title: Re: How to setup user quotas ?
Post by: kikloo on May 06, 2017, 08:18:59 AM
Hi,

I changed the /home line as suggested in the first post and then rebooted the server, now my server is offline and not coming back up,

I changed :

/dev/mapper/centos-home /home                   xfs     defaults        0 0

to

/dev/mapper/centos-home /home                   xfs     usrjquota=quota.user,jqfmt=vfsv0        0 0

And saved the file and did a reboot and now server is down.

What I have done wrong ?? Why CWP is not taking care of this automatically ???

Thanks.
Title: Re: How to setup user quotas ?
Post by: swarupggolui on October 05, 2017, 07:19:44 AM
Hello Sir
Sir I have quota Problem On My CWP Panel,
Show This Msg On CWP Panel
(setquota: Mountpoint (or device) / not found or has no quota enabled. setquota: Not all specified mountpoints are using quota. setquota: Mountpoint (or device) / not found or has no quota enabled. setquota: Not all specified mountpoints are using quota.)

I Am Using AWS And This IS My fstab File
---------------------------------------------------------------------------------------------

#
# /etc/fstab
# Created by anaconda on Mon May  1 18:59:01 2017
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=29342a0b-e20f-4676-9ecf-dfdf02ef6683 /                       xfs     defaults        0 0
/swapfile   none    swap    defaults  0   0
-------------------------------------------------------------------------------------------------------------------
Can You Help Me Please?
Thanks..
Modify message
Title: Re: How to setup user quotas ?
Post by: kikloo on October 05, 2017, 07:55:32 AM
Quotas don't work properly in CWP. Wait for next version.
Title: Re: How to setup user quotas ?
Post by: infinitech07 on July 10, 2018, 02:01:19 PM
For those having the problem setting up the quota on XFS file system, hope the below tips would help you. I finally got this work for my server.

1. Follow the steps on this link.
https://help.directadmin.com/item.php?id=557

(Ignore the step 7,8).

2. Enter the command line "/usr/sbin/repquota /" to make sure the quota is working.

3. Follow the XFS instructions on this post page 1.

Reference sites:
- https://help.directadmin.com/item.php?id=557
- https://help.directadmin.com/item.php?id=42
- https://www.server-world.info/en/note?os=CentOS_7&p=quota
Title: Re: How to setup user quotas ?
Post by: voymacao on August 17, 2018, 11:37:12 AM
It still doesn't work for KVM with XFS file system.
Its being 2 days i'm struggling to find a solution for this.
Would definitely be very helpful if someone could provide clear instructions for users with no /home partition.

Title: Re: How to setup user quotas ?
Post by: fatihalp on September 22, 2018, 04:31:53 PM
How to make Disk Quota Setup for Google Cloud Virtual Instance - Centos 7? I couldn't make it work
Title: Re: How to setup user quotas ?
Post by: studio4host on September 24, 2018, 09:58:00 AM
info
http://forum.centos-webpanel.com/centos-configuration/how-to-setup-user-quotas/
Title: Re: How to setup user quotas ?
Post by: fatihalp on September 24, 2018, 10:21:16 AM
Is Google uses XFS files system?

info
http://forum.centos-webpanel.com/centos-configuration/how-to-setup-user-quotas/
Title: Re: How to setup user quotas ?
Post by: rajanm99 on March 09, 2019, 12:56:29 PM
I have managed to fix the quota in CentOS 7 +CWP - xfs formatted.

Code: [Select]
mount | grep ' / '
If the result is: /dev/vda1 on / type xfs (rw,relatime,attr2,inode64,noquota)

Then

Code: [Select]
nano /etc/default/grub

Add to the end of line of GRUB_CMDLINE_LINUX=
Code: [Select]
rootflags=uquota,gquota
Before
Code: [Select]
GRUB_CMDLINE_LINUX="console=tty0 crashkernel=auto console=ttyS0,115200"
After
Code: [Select]
GRUB_CMDLINE_LINUX="console=tty0 crashkernel=auto console=ttyS0,115200 rootflags=uquota,gquota"

Rebuild the grub config:
Code: [Select]
cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.orig
grub2-mkconfig -o /boot/grub2/grub.cfg

Then update the fstab

Code: [Select]
nano /etc/fstab
Change from
Code: [Select]
UUID=5f18...a0a / xfs defaults        0 0To
Code: [Select]
UUID=5f18...a0a / xfs defaults,usrquota,grpquota        0 0
Reboot

Now login to the cwp and update each package and check while saving (Update quota for all users using this package, also disables inode limits !)
Title: Enable quotas to OPENVZ
Post by: Freespirits_GR_Host on May 04, 2020, 10:17:32 AM
If your hosting company uses openvz platform and you use a container the only thing you have to do is the following
1. Ask them to enable second level quotas for your container
2. After it is enabled then go to Users --> User quota. You will ensure that quota is working
3. Finally go to Packages --> Packages and after you select each one of them click "update" having the "update quota" enabled.

You are ready to go and list your accounts and ensure that "Disk usage" is working normally.
Title: Re: How to setup user quotas ?
Post by: salehfauzan on July 15, 2020, 06:55:32 PM
After 2 year.
This work for me (kvm - xfs)
https://www.mysterydata.com/how-to-enable-xfs-disk-quota-in-centos-and-cwp-panel/
Title: Re: How to setup user quotas ?
Post by: M/s VIKASH TECH on July 28, 2020, 01:48:21 PM
Hello team,

I tried the above-mentioned steps, but the quota is still not working.
Can anyone help me with this.?

I am using the following configuration

CPU Model: Intel(R) Xeon(R) CPU X5650 @ 2.67GHz
CPU Details: 16 Core (2667 MHz)
Distro Name: CentOS Linux release 7.8.2003 (Core)
Kernel Version: 3.10.0-1127.13.1.el7.x86_64
Platform: x86_64 kvm

The file type is .xfs

I am getting issues in both admin and client panels.

In admin panel when I check inside "List accounts" section, it shows 0kb/100kb

In client section, it shows some random size.

In the file explorer, when logged in from the client portal, it shows 0kb / 0kb

Can someone suggest some solution for this?

Regards,
Vikash Mishra,
https://cloudpoko.com/ (https://cloudpoko.com/)
jtttps://vikashtech.com/ (http://jtttps://vikashtech.com/)
Title: Re: How to setup user quotas ?
Post by: Jason on August 13, 2020, 02:26:43 PM
new version will have quota setup script to do this automatically for you.

Hi its 2020 sorry to dig up an old post, but is there an auto script for this QUOTA Setup yet?

Regards
Title: Re: How to setup user quotas ?
Post by: wes on September 18, 2020, 05:28:06 PM
how do you make it a hard quota, and stop when it reaches, also, how do you get the email from the root / to /home where the space actually is
Title: Re: How to setup user quotas ?
Post by: Volnei on May 13, 2021, 07:09:41 PM
Hi everyone.

I'm starting now, and read a few about the problem.

On my a2 Hosting VPS the /etc/fstab is empty

The mount command have the output the following:

Code: [Select]
[root@srv001 etc]# mount
/dev/ploop11654p1 on / type ext4 (rw,relatime,stripe=384,data=ordered,balloon_ino=12)
none on /sys type sysfs (rw,relatime)
none on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct,cpu)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_prio,net_cls)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)
proc on /proc type proc (rw,relatime)
none on /dev type devtmpfs (rw,nosuid,mode=755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=23,pipe_ino=881813032,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=881813032)
mqueue on /dev/mqueue type mqueue (rw,relatime)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=419432k,mode=700)
Title: Re: How to setup user quotas ?
Post by: juniorLinuxadmin on August 01, 2021, 09:12:30 AM
Could you please someone guide me on setting up quota for user accounts properly?

I am using A KVM vps (/dev/vda1  is mounted on  /    and home folder is inside /   )

mount
(output)
/dev/vda1 on / type ext4 (rw,relatime,quota,usrquota,grpquota,data=ordered)
------------------------------------------------
 /etc/fstab  file has followings
#
# /etc/fstab
# Created by anaconda on Tue May 18 17:44:59 2021
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/vda1 / ext4 rw,relatime,quota,usrquota,grpquota,data=ordered 0 0
tmpfs /dev/shm tmpfs defaults,nodev,nosuid,noexec 0 0

/swapfile   none    swap    sw    0   0
proc /proc proc defaults,hidepid=2,gid=nohidproc 0 0


--------------------------------------------
repquota -a output

                        Block limits                         File limits
User            used    soft           hard       grace    used  soft  hard  grace
testuser --  717684 1048576 1048576              26444   0     0

---------------------------------------------

When I go to disk quota setup menu in CWP it says Quota Configuration file /usr/local/cwp/.conf/quota_part.conf Already Exist!

/usr/local/cwp/.conf/quota_part.conf   file has  /


 (My issues is that disk space usage doesn't reflect on users control panel)  it stays at  Usage  0%   0/1024MB
(in CWP admin panel I can see disk space usage properly 700MB/1024MB)  The issue appears to be only in CWP users' panel




Title: Re: How to setup user quotas ?
Post by: anandmys on March 16, 2022, 12:43:55 PM
Hi

See the 2 images. In list packages (Reseller login), usage is almost correct. In user login there is a different usage story.

Any help?

(https://ibb.co/RQ6rNmn)
(https://ibb.co/NNHs7K5)
Title: Re: How to setup user quotas ?
Post by: anandmys on June 13, 2022, 12:13:00 PM
Note: If you want emails and user home to be under the same quota then /var/vmail and /home need to be on the same partition.

I have my /var/vmail and /home on same partition.

This is not working

Any suggestions?
Title: Re: How to setup user quotas ?
Post by: PakPos on July 18, 2022, 02:45:36 AM
new version will have quota setup script to do this automatically for you.
https://forum.centos-webpanel.com/index.php?topic=12175.msg41970;topicseen#msg41970

any idea how to solved it ?
Title: Re: How to setup user quotas ?
Post by: takuda on November 10, 2022, 10:02:29 PM
How to make Disk Quota Setup for AWS Amazon on Centos 7.9?, please help me
Title: Re: How to setup user quotas ?
Post by: utkuweb on March 19, 2023, 07:51:13 PM
[root@srv ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs         16G     0   16G   0% /dev
tmpfs            16G     0   16G   0% /dev/shm
tmpfs            16G   17M   16G   1% /run
tmpfs            16G     0   16G   0% /sys/fs/cgroup
/dev/md1        893G  3.5G  890G   1% /
tmpfs           3.2G     0  3.2G   0% /run/user/0
[root@srv ~]# cat /etc/fstab
/dev/md1 / xfs rw,relatime,attr2,inode64,sunit=1024,swidth=2048,noquota 0 0
/dev/md1 / xfs rw,relatime,attr2,inode64,sunit=1024,swidth=2048,noquota 0 0
/dev/md1 / xfs rw,relatime,attr2,inode64,sunit=1024,swidth=2048,noquota 0 0


What should I do?