<div dir="ltr">Sorry, forgot to share the idea with the community, maybe it could be helpful for other LXC users too.<br><div><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Istvan Balazs</b> <span dir="ltr"><<a href="mailto:balazs.istvan@gmail.com">balazs.istvan@gmail.com</a>></span><br>
Date: 2013/4/15<br>Subject: Re: [Lxc-users] Running an NFS server within LXC<br>To: Papp Tamas <<a href="mailto:tompos@martos.bme.hu">tompos@martos.bme.hu</a>><br><br><br><div dir="ltr"><div><div><div><div><div><div>
Dear Tamás!<br><br></div>Theres is a workaround solution for this.<br><br>We are using NFS mounts inside KVM guests. But can be achieved with native hosts too.<br><br></div>1. The KVM guest is the one who mounts the NFS mount folder , let's say:<br>

</div>mount -t nfs 10.10.10.122:/nfsmount /nfsdata<br><br></div>2. Bind mount the NFS mounted partion into an existing custom LXC folder:<br></div>mount --bind /nfsdata /var/lib/lxc/lxccontainer/lxcnfsmount.<br><br>If the NFS base mount is /lxcnfsmount, and You would like to mount the subfolder "test1" to an other folder from the LXC container(/var/www/web1) You can do like this :<br>

<br>3.fstab entry content of the LXC container:(/var/lib/lxc/lxcontainer/fstab)<br></div><div> /var/lib/lxc/lxccontainer/rootfs/lxcnfsmount/test1 /var/lib/lxc/lxccontainer/rootfs/var/ww/web1 none rw,bind,noatime,nodiratime,nosuid,nodev,noexec     0 0<br>

<br></div><div>In this way you will be able to use the NFS mount in read-write mode, through the host system's (physical, or host KVM) NFS network stack.<br><br></div><div>Best Regards<br><br>I hope it helps. If not please let me know, I will be happy to give you a helping hand.<br>

<br>Balázs István<br>CyberManufactory Kft.<br>CEO<br></div><div>E-mail: <a href="mailto:info@ipfort.com" target="_blank">info@ipfort.com</a><br></div><div>Tel     : 00 36 70 210 0505 <br></div><div><div><div><div><br></div>
</div></div></div>
</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">2013/4/15 Papp Tamas <span dir="ltr"><<a href="mailto:tompos@martos.bme.hu" target="_blank">tompos@martos.bme.hu</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On 04/15/2013 12:34 PM, David Parks wrote:<br>
><br>
> It's really a no-go on LXC huh? That's too bad. Glusterfs seems like<br>
> overkill, I just want a remote mount for a small, but critical, backup<br>
> process. But it must be mounted, I'd rather not clutter up the host OS, as<br>
> the whole point of LXC was to keep configuration specific to various<br>
> application-components segregated in their own containers.<br>
<br>
</div>Yes, because the current "official" nfs linux implementation is kernel based. Userspace alternatives<br>
can be used. One is unfs3 (or something like that), but it didn't work for me last time I tested.<br>
Another one is glusterfs, it works great. It's overkill, but actually it's not so complicated as it<br>
looks for the first check. From this aspect it's an nfs server, that has other capabilities.<br>
<span><font color="#888888"><br>
tamas<br>
</font></span><div><div><br>
------------------------------------------------------------------------------<br>
Precog is a next-generation analytics platform capable of advanced<br>
analytics on semi-structured data. The platform includes APIs for building<br>
apps and a phenomenal toolset for data science. Developers can use<br>
our toolset for easy data analysis & visualization. Get a free account!<br>
<a href="http://www2.precog.com/precogplatform/slashdotnewsletter" target="_blank">http://www2.precog.com/precogplatform/slashdotnewsletter</a><br>
_______________________________________________<br>
Lxc-users mailing list<br>
<a href="mailto:Lxc-users@lists.sourceforge.net" target="_blank">Lxc-users@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/lxc-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/lxc-users</a><br>
</div></div></blockquote></div><br></div>
</div></div></div><br></div></div>