<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Feel a little dumb responding to my own
      question so soon. In case anyone else wants to figure out how to
      do this it turns out to be pretty simple.<br>
      <br>
      The built-in LXC fstab functionality is pretty awesome but can
      lead to some permissioning issues, I have found. To solve this,
      after creating the container but before starting it up, do your
      bind mount on the host itself (IE <i>mount --bind /source_path/
        ~/.local/share/lxc/container/rootfs/var/lib/postgresql/</i>).
      You can do it on the CLI or in your host fstab (which obviously
      has the benefit of being permanent). Make sure you set the
      appropriate permissions from the host (just match what the
      neighboring container path have if you are unsure) if you need to.<br>
      <br>
      Thanks any way to the list. Hope this helps someone.<br>
      <br>
      On 11/15/2014 01:27 PM, Nicholas J Ingrassellino wrote:<br>
    </div>
    <blockquote cite="mid:54679AF9.8010406@lifebloodnetworks.com"
      type="cite">
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      Howdy!<br>
      <br>
      I am experimenting with ZFS and LXC.<br>
      <br>
      As a test on my host I have two ZFS filesystems: <i>/tank/lxc</i>
      for containers and <i>/tank/lxc_postgresql</i> for bind mounting
      in a container. I have the container fstab working (<i>/tank/lxc_postgresql

        var/lib/postgresql none bind</i>) where <i>/tank/lxc_postgresql</i>
      on my host is equivalent to <i>/var/lib/postgresql/</i> within
      the container.<br>
      <br>
      The problem comes when I try to install PostgreSQL. It complains
      that, during install, it can not change the permissions on <i>/var/lib/postgresql/</i>.
      I have tried changing the permissions from the host (to the same
      permissions the rest of the folders in <i>/var/lib/</i> have) and
      from the container. I have tried bind mounting at <i>/media/postgresql/</i>
      and creating a symlink to <i>/var/lib/postgresql/</i> (not so
      much because I do not understand why it failed but because I was
      running out of ideas). I am not sure how to get this working...<br>
      <br>
      I ultimately want to do this with a number of containers (some
      should have dedup, some should have a different block sizes, ect)
      but can not even get it working with a single container. Any ideas
      would be appreciated.<br>
      <br>
      Thanks in advance!<br>
      <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>
    <br>
  </body>
</html>