Are quota's needed? For single user?

Richard G

Verified User
Joined
Jul 6, 2008
Messages
12,773
Location
Maastricht
A friend of mine has rented a VPS for his site and forum and I advised him to get a Directadmin Personal license.

So I installed DA for him, but there was no quota enabled on the file system. Seems that is not done by default on VPS systems?
I contacted the provider if quota could be used because it's a VPS. They said we can do anything we like with it.
There is no limitation set by us that would prevent any software installation, except hosting virtual machines (nested virtualization is not possible).

So probably this could be done, but is it necessary? As he is the only user making use of this VPS like should be with a personal license.

I restored a backup for him, and got quota errors like this:
<b>Error with system Quotas</b>
setquota: Mountpoint (or device) / not found or has no quota enabled.
setquota: Not all specified mountpoints are using quota.

<a href='http://help.directadmin.com/item.php?id=42'>Debug Guide</a>

<b>Error with system Quotas</b>
setquota: Mountpoint (or device) / not found or has no quota enabled.
setquota: Not all specified mountpoints are using quota.

<a href='http://help.directadmin.com/item.php?id=42'>Debug Guide</a>

Cannot read /home/admin/backups/backup/packages.list to restore packages: Unable to open /home/admin/backups/backup/packages.list for reading.
No such file or directory

The packages.list might also be because there is only admin, he does not need any packages so none were created.

So is quota needed for a single user on a VPS or not?

If it would be wise to have, what should I do, /etc/fstab contains this lines only:
Code:
UUID=3fb84ba0-e245-4c52-99f4-3f642f12290d /                       ext4    defaults,noatime        1 0
UUID=8ebdeacb-276f-4596-8e2f-ab4c3835e297 /boot                   ext4    defaults,noatime        1 0
Can I just change this to:
Code:
UUID=3fb84ba0-e245-4c52-99f4-3f642f12290d /                       ext4    defaults,noatime,usrquota,grpquota        1 0
UUID=8ebdeacb-276f-4596-8e2f-ab4c3835e297 /boot                   ext4    defaults,noatime        1 0
reboot and run
Code:
/sbin/quotaoff -a; /sbin/quotacheck -avugm; /sbin/quotaon -a;

Or does it also nees the rw like:
Code:
defaults,noatime,rw,usrquota,grpquota
I just checked on two fresh server installations with full licenses, they have working quota it seems, but the "rw" is also not present in /etc/fstab lines.

But I read it here:
https://help.directadmin.com/item.php?id=42
If are getting errors and no output is displayed for the repquota command, you'll need to check your /etc/fstab file to make sure that it contains the rw,userquota,groupquota line beside the partition that is using the quotas.
 
Hello Richard,

You should decide whether or not system quotas are needed or for you/your friend on the VPS. Don't ask us about it ;)
 
Hello Alex.

I think it was not clear why I asked this.

I asked because of the errors on the restore. I wanted to make sure if using quota's was necessary for good functioning of Directadmin.
If that does not matter and DA and applications will keep working fine, he won't need quota's.

However... We do have another VPS which we might want quota's on and a couple of servers which do use quota, but do not have the RW option in there.

So I still like to no if when quota is used, the RW is indeed required or not.
And also my second question if changing the fstab like suggested is correct for enabling quota on the other VPS.
 
DirectAdmin can work fine with quotas disabled, disk quotas are optional. In certain cases you might want to enable quotas, if you don't want to let your site to fill all the disk space, in a case if you have too little disk size.

rw is included in defaults in fstab


Default settings are defined per file system at the file system level. For ext3 file systems these can be set with the tune2fs command. The normal default for Ext3 file systems is equivalent to rw,suid,dev,exec,auto,nouser,async(no acl support). Modern Red Hat based systems set acl support as default on the root file system but not on user created Ext3 file systems. Some file systems such as XFS enable acls by default. Default file system mount attributes can be overridden in /etc/fstab.

https://en.wikipedia.org/wiki/Fstab

Check ext4, it might be the same.
 
Thank you Alex.
It's good to know these warnings can be ignored on restores and that there is no setting to disable quota's in Directadmin which prevents them appearing (except for pop counting).

It's that I normally don't work with VPS systems and wondered why on default Centos 7 installations with EXT 4 quota's are enabled but not on VPS systems. I thought VPS provider disabled it.

So if I understand correctly for ext4 in Centos 7 I can just add the "usrquota,grpquota" to the line and restart the VPS and check quota for DA from there via the help file.
 
The settings set in /etc/fstab might differ from hoster to hoster, and depend on pre-configured template from which a new VM is generated.

Disk Quotas on VPS and a bare metal server should be enabled the same way, there is no difference here. For ext4 it's only about modifying /etc/fstab the way you mentioned.
 
I just tried to enable quotas, just to work with it on a VPS.
At first I got an error, so I rand this command from the help file:
Code:
/sbin/quotaoff -a; /sbin/quotacheck -avugm; /sbin/quotaon -a;

So it installed quota:
[root@server: ~]# /sbin/quotaoff -a; /sbin/quotacheck -avugm; /sbin/quotaon -a;
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: Scanning /dev/sda2 [/] done
quotacheck: Cannot stat old user quota file //aquota.user: No such file or directory. Usage will not be subtracted.
quotacheck: Cannot stat old group quota file //aquota.group: No such file or directory. Usage will not be subtracted.
quotacheck: Cannot stat old user quota file //aquota.user: No such file or directory. Usage will not be subtracted.
quotacheck: Cannot stat old group quota file //aquota.group: No such file or directory. Usage will not be subtracted.
quotacheck: Checked 18267 directories and 82585 files
quotacheck: Old file not found.
quotacheck: Old file not found.

After that when running the repquota command, it looked good but....
Code:
[root@server: ~]# /usr/sbin/repquota /
*** 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      -- 5216912       0       0          79806     0     0       
mail      --     932       0       0            170     0     0       
polkitd   --       8       0       0              2     0     0       
postfix   --      16       0       0             27     0     0       
chrony    --      12       0       0              3     0     0       
named     --      96       0       0              8     0     0       
rpc       --       4       0       0              2     0     0       
webapps   --   89288       0       0           8224     0     0       
apache    --       4       0       0              1     0     0       
diradmin  --  165528       0       0           2308     0     0       
mysql     --  871380       0       0            581     0     0       
majordomo --     384       0       0             36     0     0       
admin     -- 4792228       0       0           9222     0     0       
clamav    --  258920       0       0              9     0     0       
#500      --      64       0       0             11     0     0       
#501      --    2600       0       0            315     0     0       
#502      --     816       0       0            126     0     0

Why is it showing #500, #501 and #502? Because those are not in /etc/passwd and this is DA with a personal license. Or is it like this because it's a personal license?
 
Yes but then you would expect
501
502
503

and not
#501
#502
#503

Wondering what they could be since you can't have normal users on a personal license and system users normally have id's below 501.
 
No, I would not. In Unix/Linux all-numeric usernames can exist.

Check:
Code:
repquota -a -n


from man pages:

Code:
-n, --no-names
              Don't resolve UIDs/GIDs to names. This can speedup printing a lot.
 
Thank you Alex.

I know that numeric usernames can exist, but I never seen UIDs with comments before. That's what I was wondering about.
 
Back
Top