Disk quota inside LXC container.

Tutorial how to enable quota in ISPCONFIG

I Run "quota with ISPCONFIG" and its running ok


1.On proxmox server uncoment:
"lxc.aa_profile = lxc-container-default-with-mounting" in
/usr/share/lxc/config/debian.common.conf
next reboot server

2.Make some CT debian 8.6 from my modify debian with sytemd working : https://forum.proxmox.com/threads/debian-8-6-lxc-template-with-systemd-feature-request.30212/

in /etc/pve/lxc/ find your CT ex. 101.conf
and add lines:
lxc.aa_profile: unconfined
mount -o remount,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0 /

Its very important to add this lines becouse CT will not work without that!

3.Login to your CT and on bash write:
"df"
You shoul see which is your base system loop
exl. /dev/loop0 or /dev/loop1 ...

4. open:
nano /etc/fstab and add this line:
/dev/loop0 / ext4 errors=remount-ro,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0 0 1

i your loop was not 0 but 1 or something els just rename it to loop1 loop2......

Important thing is quota will not working after reboot of CT so make a script to run this every boot:in CRON:
a)
nano /etc/init.d/mystartup.sh

b)
Insert in file:

#!/bin/bash
echo ^ ^ Setting up customized environment ^ ^ ^

mount -o remount /
quotacheck -avugm
quotaon -avug

c)
make executable file:
chmod +x /etc/init.d/mystartup.sh
update-rc.d mystartup.sh defaults 100
--------------------------------------
Now you may Install ISPCONFIG with working quota.

AWARE that this tut will chcange CT to insecure.

If someone has a better tut or make some scipt to automate this that will be great.
 
Hi
Does quote only works on rootfs? I have a container with an additional mount point on which I enabled quota (via webgui). But it doesn't work as expected:

Code:
quotacheck -vguma
quotacheck: Cannot find filesystem to check or filesystem not mounted with quota option.

After that I enabled quota also for the rootfs and there it seems to work:

Code:
cat /etc/mtab
/dev/rbd0 / ext4 rw,relatime,stripe=1024,data=ordered,jqfmt=vfsv0,usrjquota=aquota.user,grpjquota=aquota.group 0 0
/dev/rbd2 /mnt/ceph ext4 rw,relatime,stripe=1024,data=ordered 0 0
...

The configuration looks like this:

Code:
arch: amd64
cores: 4
hostname: samba
memory: 2048
mp1: ceph-data:vm-207-disk-1,mp=/mnt/ceph,quota=1,size=48G
nameserver: 8.8.8.8
net0: name=eth0,bridge=vmbr0,gw=192.168.101.10,hwaddr=##:##:##:##:##,ip=192.168.101.42/24,type=veth
ostype: debian
rootfs: ceph-lxc:vm-207-disk-2,quota=1,size=8G
searchdomain: 192.168.101.5
swap: 2048

What I have to do that quota also works on mount points?
Thanks in advance!
 
Tutorial how to enable quota in ISPCONFIG

2.Make some CT debian 8.6 from my modify debian with sytemd working : https://forum.proxmox.com/threads/debian-8-6-lxc-template-with-systemd-feature-request.30212/

in /etc/pve/lxc/ find your CT ex. 101.conf
and add lines:
lxc.aa_profile: unconfined
mount -o remount,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0 /

Its very important to add this lines becouse CT will not work without that!

This does not work.

"vm 202 - lxc.aa_profile is deprecated and was renamed to lxc.apparmor.profile"

secondly a naked remount command in an lxc.conf file?

"vm 202 - unable to parse config: mount -o remount,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0 /"

Doesnt seem correct.

I cannot turn on quota on the container in the GUI, it is greyed out despite being an ext4 fs on a zvol.
 
I have this problem but I can not find a solution cpanel
proxmox v5-4-6 + CENTOS 7.4 lxc + cpanel v80.0.11
Filesystem quotas are currently disabled. Click to enable
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!