quotas in jails

Ernie Luzar luzar722 at gmail.com
Tue Nov 12 23:43:08 UTC 2019


Valeri Galtsev wrote:
> 
> 
> On 2019-11-12 12:13, Ernie Luzar wrote:
>> Valeri Galtsev wrote:
>>>
>>>
>>> On 2019-11-07 15:34, Ernie Luzar wrote:
>>>> Has anyone been able to get quotas to work in multiple jails?
>>>
>>> I'm not certain I quite understand what you are asking.
>>>
>>> I'm successfully using UFS-2 filesystem quotas. In my case 
>>> filesystems with quotas set up as you usually would are mounted on 
>>> host system, and nullfs mounted beneath jail's root point (can be on 
>>> various levels).
>>>
>>> Valeri
>> Thank you for your reply Valeri. But I am having trouble comprehending 
>> what your words are saying as related to the system configuration files.
>>
>> I am working with RELEASE 12.0 and quotas is included in the delivered 
>> kernel so need to compile the quota option into the kernel.
> 
> Example:
> 
> In /etc/fstab I have
> 
> /dev/da0p6   /path/to/data ufs     rw,userquota     2       2
> /path/to/data   /jails/jail1/insidejail/data   nullfs  rw  0  0
> 
I think you jumped over some very import information here.
/dev/da0p6 would seem to indicate that when you allocated the da0 disk 
drive you created partitions on the disk drive which you planed to use 
to segregate your jails by partition. Is that a correct interpretation?

If you showed the da0 disk layout with the partition directory trees and 
the jail.conf definition statements for the example jail and used the 
real fstab statements containing the real paths then it would become 
easier to see the complete picture of how things relate to each other.


> # execute
> 
> mount -a
> 
> # set quotas for some user:
> 
> edquota -u -e /home:100G:110G:1000000:1100000 prototypeuser
> 
> # set quota for range of userids same as that of user: prototypeuser
> 
> edquota -u -e /path/to/data:100G:110G:1000000:1100000 prototypeuser
> 
> 
> You are done.
> 
> 
> Thanks.
> Valeri
> 
> 
>>
>> I used bsdinstall to install the system from scratch and selected to 
>> use the whole hard drive as a single partition. I manually added 
>> quota_enable="YES" to the rc.conf file and rebooted. In the boot 
>> messages I see message that quote started normally.
>>
>> My jail is a directory tree type at path /usr/jails/jailname and I can 
>> start and stop that jail using the jail command with no problems.
>>
>> My goal is for the jail users to issue the quota commands to check on 
>> how much space they have used of the allowed space.
>>
>> The man jail documentation says the path /usr/jails/jailname is called 
>> a filesystem. I this the same thing you are calling a filesystem?
>>
>> An excerpt of the configuration statements and the name of the files 
>> they go in would sure be helpful in understanding how you have your 
>> jail quota environment setup.
>>
>> Thanks in advance for any help.
> 



More information about the freebsd-questions mailing list