<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Le 02/03/2015 22:00, Devon B. a écrit :<br>
</div>
<blockquote cite="mid:54F4CF55.70902@virtualcomplete.com"
type="cite">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
I couldn't figure out how to allow user/group quotas inside the
container and I couldn't find many resources other than failed
attempts or unresolved reports.<br>
<br>
I received the same error as you and tried making a fake device
using mknod to no avail. The problem is that the rootfs (/) is
always only mounted as (rw). So then it tries to fall back to the
other / in /proc/mounts which is the block device which isn't
available in the container (for good reason probably).<br>
<br>
I think the only possible way I had seen that quotas had worked
was using a bind mount from the container to a host mount with
usrquota enabled. However, in my case, this did not seem
appealing because I would have to maintain two filesystems for
each container (rootfs and the usrquota) and from what I remember,
the users/groups had to coexist on the host and the container so
it would only be viable on one container.<br>
<br>
<blockquote style="border: 0px none;"
cite="mid:BLU437-SMTP72B0E63DC63526A9443978F3100@phx.gbl"
type="cite">
<div style="margin:30px 25px 10px 25px;" class="__pbConvHr">
<div style="display:table;width:100%;border-top:1px solid
#EDEEF0;padding-top:5px">
<div
style="display:table-cell;vertical-align:middle;padding-right:6px;"><img
photoaddress="ff240@msn.com" photoname="PONCET Anthony"
src="cid:part1.03050204.02090406@msn.com"
name="compose-unknown-contact.jpg" height="25px"
width="25px"></div>
<div
style="display:table-cell;white-space:nowrap;vertical-align:middle;width:100%">
<a moz-do-not-send="true" href="mailto:ff240@msn.com"
style="color:#737F92
!important;padding-right:6px;font-weight:bold;text-decoration:none
!important;">PONCET Anthony</a></div>
<div
style="display:table-cell;white-space:nowrap;vertical-align:middle;">
<font color="#9FA2A5"><span style="padding-left:6px">Monday,
March 2, 2015 12:13 PM</span></font></div>
</div>
</div>
<div style="color:#888888;margin-left:24px;margin-right:24px;"
__pbrmquotes="true" class="__pbConvBody">Hi,
<br>
I know lxc doesn't manage or use quota, but how to used it in
one container?
<br>
I created one lv for my container, and I mounted with usrquota
and grpquota options.
<br>
But when I try to used quotacheck or quotaon (in my
container), I have an error : "impossible to use stat() on
/dev/mapper/vg_name-lv_name, file doesn't exist ".
<br>
Do you have an idea?
<br>
<br>
<br>
<br>
_______________________________________________
<br>
lxc-users mailing list
<br>
<a moz-do-not-send="true" class="moz-txt-link-abbreviated"
href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a>
<br>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://lists.linuxcontainers.org/listinfo/lxc-users">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br>
</div>
</blockquote>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
lxc-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a>
<a class="moz-txt-link-freetext" href="http://lists.linuxcontainers.org/listinfo/lxc-users">http://lists.linuxcontainers.org/listinfo/lxc-users</a></pre>
</blockquote>
Hi,<br>
I found how to can enable quota.<br>
1) Stop your container and edit the config file and add
"lxc.cgroup.devices.allow = b 252:x rwm".<br>
2) Add usrquota,grpquota options in fstab from rootfs container raw
IE: "uuid=.... /path/of/your/container/rootfs fs_type
defaults,usrquota,grpquota 0 2".<br>
3) After mounting lv in rootfs of your container with "sudo mount
-a", make (in container) a nod with "sudo mknod -m 660 /dev/dm-x 252
x" (dm-x = path of your lv and x = minor id of your peripheral lv
(ls -l /dev/dm-x)).<br>
4) Always in container, "sudo mkdir /dev/mapper && cd
/dev/mapper && sudo ln -s ../dm-x vg_name-lv_name &&
sudo touch /aquota.user && sudo touch /aquota.group
&& sudo chmod 600 /aquota.* && sudo quotacheck
-augv".<br>
5) On the host, enable quota with : "sudo quotaon -ugv
/path/of/your/container/rootfs/".<br>
<br>
But, now, when I try to set quota with quotatool or edquota -u user
(in the container), I had an error : "edquota: Unable to get the
quotas kernel to user 101001 /dev/mapper/vg_name-lv_name: Operation
not permitted<br>
edquota: Error trying quota /dev/mapper/vg_name-lv_name #101001
(101001 id): Operation not permitted<br>
edquota: Impossibble retrieve quota information for 101,001 users.<br>
"<br>
Can I add a capabilities to allow this access? Or an other track?<br>
<br>
Thanks.<br>
</body>
</html>