[Lxc-users] Mounting filesystem for container

Daniel Lezcano daniel.lezcano at free.fr
Sat Sep 18 10:11:18 UTC 2010


On 09/17/2010 11:41 PM, lxc at jelmail.com wrote:
> Hi, I just tried to mount a filesystem in a container and I got this:
>
> [root ~]# lxc-start -n mycontainer
> lxc-start: Operation not permitted - failed to mount '/dev/sdd1' on
> '/srv/lxc/mycontainer/mnt'
> lxc-start: failed to setup the mounts for 'mycontainer'
> lxc-start: failed to setup the container
> lxc-start: invalid sequence number 1. expected 2
> lxc-start: failed to spawn 'mycontainer'
> [root ~]#
>
> What I did was put this in /etc/lxc/mycontainer.fstab:
>
> /dev/sdd1 /srv/lxc/mycontainer/mnt ext3 defaults 0 1
>    

As mentioned Serge, that maybe the cgroup device white list which 
prevent you to do that.
You can check by temporarly comment out in /var/lib/lxc/mycontainer all 
the lxc.cgroup.devices.... lines and then launch the container again. If 
you are able to mount it, then you should add in the configuration file 
the line:

lxc.cgroup.devices.allow = <type> <major>:<minor> <perm>

<type> : b (block), c (char), etc ...
<major> : major number
<minor> : minor number (wildcard is accepted)
<perms> : r (read), w (write), m (mapping)





More information about the lxc-users mailing list