[lxc-users] lxc config device add

sjoerd at sjomar.eu sjoerd at sjomar.eu
Tue Apr 18 11:31:23 UTC 2017


April 18, 2017 1:28 PM, "Gabriel Marais" <gabriel.j.marais at gmail.com> wrote:

> Hi Guys
> 
> I added a block device to a container through the command
> 
> lxc config device add vmh01-db-master-01 storage disk 
> path=/var/lib/mysql source=/mnt/db-master-01-varlibmysql/
> 
> On the container:-
> /dev/mapper/3600a098000a2f553000003fe58f63589-part1 50G 52M 47G 
> 1% /var/lib/mysql
> 
> On my host:-=
> /dev/mapper/3600a098000a2f553000003fe58f63589-part1 
> 50G 52M 47G 1% /mnt/db-master-01-varlibmysql
> 
> The permissions/owner in the container looks like this:
> drwxr-xr-x 3 nobody nogroup 4096 Apr 18 09:02 mysql
> 
> I am unable to change permissions or modify the user/group
> 
> root at vmh01-db-master-01 [11:24:22] :~# chown root:root /var/lib/mysql
> chown: changing ownership of '/var/lib/mysql': Operation not permitted
> 
> I was trying to mount a block device where my mysql data would live.
> How do I go about changing the permissions/ownership?

I guess the easiest is to change the uid/guid on the host to match the desired uid/gid in the container.

Cheers,
Sjoerd


More information about the lxc-users mailing list