<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; color: #000000"><div>Hi, </div><div><br data-mce-bogus="1"></div><div>thanks everyone . </div><div>My concern is really inside the container </div><div>BRTFS is managing the quota and it's working well </div><div><br data-mce-bogus="1"></div><div><span style="font-family: 'trebuchet ms', sans-serif;" data-mce-style="font-family: 'trebuchet ms', sans-serif;">btrfs qgroup show -pcre /var/lib/lxd/containers</span><br><span style="font-family: 'trebuchet ms', sans-serif;" data-mce-style="font-family: 'trebuchet ms', sans-serif;">qgroupid rfer excl max_rfer max_excl parent child </span><br><span style="font-family: 'trebuchet ms', sans-serif;" data-mce-style="font-family: 'trebuchet ms', sans-serif;">-------- ---- ---- -------- -------- ------ ----- </span><br><span style="font-family: 'trebuchet ms', sans-serif;" data-mce-style="font-family: 'trebuchet ms', sans-serif;">0/5 433.75MiB 433.75MiB none none --- --- </span><br><span style="font-family: 'trebuchet ms', sans-serif;" data-mce-style="font-family: 'trebuchet ms', sans-serif;">0/261 1.59GiB 1.59GiB none none --- --- </span><br><span style="font-family: 'trebuchet ms', sans-serif;" data-mce-style="font-family: 'trebuchet ms', sans-serif;">0/264 315.33MiB 209.77MiB none none --- --- </span><br><span style="font-family: 'trebuchet ms', sans-serif;" data-mce-style="font-family: 'trebuchet ms', sans-serif;">0/265 1.53GiB 1.43GiB none none --- --- </span><br><span style="font-family: 'trebuchet ms', sans-serif;" data-mce-style="font-family: 'trebuchet ms', sans-serif;">0/333 989.68MiB 989.68MiB 10.00GiB none --- --- </span><br><span style="font-family: 'trebuchet ms', sans-serif;" data-mce-style="font-family: 'trebuchet ms', sans-serif;">0/336 3.14GiB 3.14GiB 10.00GiB none --- --- </span><br><span style="font-family: 'trebuchet ms', sans-serif;" data-mce-style="font-family: 'trebuchet ms', sans-serif;">0/384 562.26MiB 562.26MiB none none --- --- </span><br><span style="font-family: 'trebuchet ms', sans-serif;" data-mce-style="font-family: 'trebuchet ms', sans-serif;">0/389 627.48MiB 627.48MiB none none --- --- </span><br><span style="font-family: 'trebuchet ms', sans-serif;" data-mce-style="font-family: 'trebuchet ms', sans-serif;">0/390 361.76MiB 48.74MiB none none --- --- </span><br><strong><span style="font-family: 'trebuchet ms', sans-serif;" data-mce-style="font-family: 'trebuchet ms', sans-serif;">0/391 383.54MiB 70.52MiB 10.00GiB none --- --- </span></strong><br></div><div><br data-mce-bogus="1"></div><div><br></div><div>But inside the container, you can see the disk information from the host, not the disk from the container :(</div><div>The quota is set to 10Go </div><div><br data-mce-bogus="1"></div><div><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">df -h</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">Filesystem Size Used Avail Use% Mounted on</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">/dev/sdb 100G 10G 89G 11% /</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">none 492K 0 492K 0% /dev</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">/dev/sdb 100G 10G 89G 11% /dev/lxd</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">cgroup_root 10M 0 10M 0% /sys/fs/cgroup</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">udev 481M 0 481M 0% /dev/tty</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">tmpfs 497M 0 497M 0% /dev/shm</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">tmpfs 497M 6.3M 491M 2% /run</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;" data-mce-style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">tmpfs 5.0M 0 5.0M 0% /run/lock</span><br></div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div data-marker="__SIG_PRE__"><div><span style="color: rgb(51, 51, 51); font-family: times new roman,new york,times,serif;" data-mce-style="color: #333333; font-family: times new roman,new york,times,serif;">Cordialement,</span><span style="color: rgb(51, 51, 51); font-family: times new roman,new york,times,serif; font-weight: bold;" data-mce-style="color: #333333; font-family: times new roman,new york,times,serif; font-weight: bold;"><span style="color: rgb(51, 51, 51); font-family: times new roman,new york,times,serif; font-weight: bold;" data-mce-style="color: #333333; font-family: times new roman,new york,times,serif; font-weight: bold;"><br></span></span></div><div><br></div><div><span style="color: rgb(51, 51, 51); font-family: times new roman,new york,times,serif; font-weight: bold;" data-mce-style="color: #333333; font-family: times new roman,new york,times,serif; font-weight: bold;">Benoît </span><span style="color: rgb(51, 51, 51); font-family: times new roman,new york,times,serif; font-weight: bold;" data-mce-style="color: #333333; font-family: times new roman,new york,times,serif; font-weight: bold;"><br></span></div></div><br><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><b>De: </b>"Fajar A. Nugraha" <list@fajar.net><br><b>À: </b>"lxc-users" <lxc-users@lists.linuxcontainers.org><br><b>Envoyé: </b>Lundi 6 Juin 2016 00:58:18<br><b>Objet: </b>Re: [lxc-users] Real disk information inside container - Btrfs<br></div><br><div data-marker="__QUOTED_TEXT__">On Sun, Jun 5, 2016 at 10:37 PM, Benoit GEORGELIN - Association<br>Web4all <benoit.georgelin@web4all.fr> wrote:<br>> Hi ,<br>> I was wondering if the real disk information and usage will be one day<br>> inside the container or if this is technically not possible ?<br>> So far, using Btrfs with a subvolume , quotas are working like a charm but<br>> inside the container, disk information and usage are those of the host.<br>> I guess it's the same with ZFS.<br><br>What do you mean "disk information and usage"? "df -h"?<br><br>> The only ways I figured to have the right space usage inside the container<br>> is to work with LVM, make a dedicated vg and use it with the container.<br><br><br>I'm going to use zfs as an example here, because that is what I use.<br><br>If you use zfs, and you use quota (via "size" property,<br>https://github.com/lxc/lxd/blob/master/doc/configuration.md#type-disk),<br>"df -h" on a new container should ALMOST show the correct usage,<br>except for the fact that "Avail" is what you set earlier in lxc<br>config, and "Size" is slightly larger. That is because some things in<br>the new container does not really use additional space, since it's a<br>clone of the template. So you ended up with a "virtual disk" that is<br>slightly larger than what you specified.<br><br>If you want "Size" from the output from "df -h" to exactly match the<br>"size" you set in lxc config, you can manually do someting like this<br><br>zfs set refquota=10G pool/lxd/containers/container_name<br><br>refquota counts everything "used" by the container, even cloned space.<br>So again, if your main concern is "df -h" output, then zfs can give<br>you correct info, with this additional manual setup.<br><br>I'm not familiar enough with btrfs to know whether "refquota" is also<br>possible on btrfs<br>(http://www.seedsofgenius.net/solaris/zfs-vs-btrfs-a-reference says<br>"no", but it might be an old document). Asking on btrfs list would<br>probably get you better answer on this.<br><br>-- <br>Fajar<br>_______________________________________________<br>lxc-users mailing list<br>lxc-users@lists.linuxcontainers.org<br>http://lists.linuxcontainers.org/listinfo/lxc-users<br></div></div></body></html>