<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Feb 2, 2015 at 8:35 PM, Fajar A. Nugraha <span dir="ltr"><<a href="mailto:list@fajar.net" target="_blank">list@fajar.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Mon, Feb 2, 2015 at 7:45 PM, Tomasz Chmielewski <span dir="ltr"><<a href="mailto:mangoo@wpkg.org" target="_blank">mangoo@wpkg.org</a>></span> wrote:<br></span><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>If you want to disable sync for the container, the best you can do is<br>
probably use some filesystem that can do so. For example, zfs has<br>
"sync=disabled" per-dataset settings. So you can have "sync=standard"<br>
for filesystems used by the host, and "sync=disabled" for filesystems<br>
used by containers.<br>
</blockquote>
<br></span>
That's a weird advice, given that lxc are Linux containers, and ZFS is not in Linux kernel (I know that there are some 3rd party porting attempts, but it's not really applicable in many situations).<div><div><br></div></div></blockquote><div><br></div><div></div></span></div>Honestly, that's the best advice I can give. It's straightforward, simple, and works.</div><div class="gmail_extra"><br></div><div class="gmail_extra">There are lots of zfsonlinux users using it on production environment. Even lxc-create supports zfs as backingstore, to a degree (man lxc-create). And doing the above is the equivalent of having eatmydata running on everything that access that dataset.</div><div class="gmail_extra"><br></div></div></blockquote><div><br></div><div><br></div><div>FYI, this is what I just tested on ubuntu utopic with lxc 1.1.0 from daily ppa</div><div><br></div><div><div># zfs get sync,compression rpool/lxc</div><div>NAME PROPERTY VALUE SOURCE</div><div>rpool/lxc sync disabled inherited from rpool</div><div>rpool/lxc compression lz4 inherited from rpool</div><div><br></div><div># lxc-create -B zfs --zfsroot=rpool/lxc -t download -n test -- -d ubuntu -r utopic -a amd64<br></div><div>Using image from local cache</div><div>Unpacking the rootfs</div><div><br></div><div>---</div><div>You just created an Ubuntu container (release=utopic, arch=amd64, variant=default)</div><div><br></div><div>To enable sshd, run: apt-get install openssh-server</div><div><br></div><div>For security reason, container images ship without user accounts</div><div>and without a root password.</div><div><br></div><div>Use lxc-attach or chroot directly into the rootfs to set a root password</div><div>or create user accounts.</div><div><br></div><div># df -h | grep test<br></div><div>rpool/lxc/test 46G 184M 46G 1% /var/lib/lxc/test/rootfs</div><div><br></div><div><div><div># zfs get sync,compression,compressratio,used,logicalused rpool/lxc/test</div><div>NAME PROPERTY VALUE SOURCE</div><div>rpool/lxc/test sync disabled inherited from rpool</div><div>rpool/lxc/test compression lz4 inherited from rpool</div><div>rpool/lxc/test compressratio 2.04x -</div><div>rpool/lxc/test used 183M -</div><div>rpool/lxc/test logicalused 371M -</div></div></div><div><br></div><div># lxc-start -n test</div><div><div><br class=""># lxc-ls -f --running</div><div>NAME STATE IPV4 IPV6 GROUPS AUTOSTART </div><div>--------------------------------------------------</div><div>test RUNNING 10.0.4.111 - - NO </div></div><div><div><br class=""># lxc-attach -n test -- hostname</div><div>test</div></div><div><br></div><div><div># lxc-attach -n test -- df -h</div><div>Filesystem Size Used Avail Use% Mounted on</div><div>rpool/lxc/test 46G 142M 46G 1% /</div><div>cgroup 12K 0 12K 0% /sys/fs/cgroup</div><div>none 100K 4.0K 96K 4% /dev</div><div>none 4.0K 0 4.0K 0% /sys/fs/cgroup/cgmanager</div><div>none 1.2G 48K 1.2G 1% /run</div><div>none 5.0M 0 5.0M 0% /run/lock</div><div>none 5.9G 0 5.9G 0% /run/shm</div><div>none 100M 0 100M 0% /run/user</div><div><br></div></div><div># lxc-stop -n test</div><div><br></div></div><div>-- </div><div>Fajar</div></div></div></div>