<div dir="ltr">Hi,<div><br></div><div>I've just gone through this recently to expose a data/ partition and found a bunch of docs with several different methodologies (and some scripted utils):</div><div><br></div><div>- <a href="https://github.com/lxc/lxd/issues/2025">https://github.com/lxc/lxd/issues/2025</a> (explains the theory/problem)</div><div>- <a href="https://github.com/lxc/lxd/issues/2526">https://github.com/lxc/lxd/issues/2526</a></div><div>- <a href="https://gist.github.com/nottrobin/a66d3d5b9722149136d7fc6f93dae59f">https://gist.github.com/nottrobin/a66d3d5b9722149136d7fc6f93dae59f</a> (Script)</div><div>- <a href="https://github.com/antitoine/lxd-functions">https://github.com/antitoine/lxd-functions</a></div><div>- <a href="https://gist.github.com/bloodearnest/ebf044476e70c4baee59c5000a10f4c8">https://gist.github.com/bloodearnest/ebf044476e70c4baee59c5000a10f4c8</a> (another script)</div><div><br></div><div>for myself I arrived to the same conclusion as <font color="#212121">Sjoerd, the easiest thing was to chown the dir on the host to match the uuid on the guest. If you read the links above you'll understand the uuid mapping and by running ls on the container's data you can double-check your root's uuid on the guest (by default it should be 100000 on ubuntu). After a chown/chgrp root will have access to it on the guest and will be able to further add dirs for specific users. Do not that even root on the guest won't be able to chown the folder itself so if you want the entire partition to be owned by mysql you need to find mysql's uid and chown on the host to that.</font></div><div><font color="#212121"><br></font></div><div><font color="#212121">hope that helps,</font></div><div><font color="#212121"><br></font></div><div><font color="#212121">Spike</font></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Apr 18, 2017 at 4:59 AM Gabriel Marais <<a href="mailto:gabriel.j.marais@gmail.com">gabriel.j.marais@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
>> I was trying to mount a block device where my mysql data would live.<br>
>> How do I go about changing the permissions/ownership?<br>
><br>
> I guess the easiest is to change the uid/guid on the host to match the desired uid/gid in the container.<br>
<br>
Is there any pointer/doc on how to do that?<br>
<br>
><br>
> Cheers,<br>
> Sjoerd<br>
> _______________________________________________<br>
> lxc-users mailing list<br>
> <a href="mailto:lxc-users@lists.linuxcontainers.org" target="_blank">lxc-users@lists.linuxcontainers.org</a><br>
> <a href="http://lists.linuxcontainers.org/listinfo/lxc-users" rel="noreferrer" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br>
><br>
<br>
--<br>
<br>
<br>
<br>
<br>
Regards<br>
<br>
Gabriel Marais<br>
<br>
Office: <a href="tel:+27%2086%20146%206546" value="+27861466546" target="_blank">+27 861 466 546 x 7001</a><br>
Mobile: <a href="tel:+27%2083%20663%202222" value="+27836632222" target="_blank">+27 83 663 2222</a><br>
Mail: <a href="mailto:gabriel.j.marais@gmail.com" target="_blank">gabriel.j.marais@gmail.com</a><br>
<br>
Unit 11, Ground Floor, Berkley Office Park<br>
Cnr Bauhinia & Witch Hazel Str,<br>
Highveld, Centurion, South-Africa<br>
0157<br>
<br>
PO Box 15846, Lyttelton, South Africa, 0140<br>
_______________________________________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org" target="_blank">lxc-users@lists.linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" rel="noreferrer" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a></blockquote></div>