[lxc-users] LXD bind mount

Stéphane Graber stgraber at ubuntu.com
Sun Jan 3 16:46:37 UTC 2016


I'm assuming you are on 0.25. There is a permission issue for
bind-mounts which I've fixed in git now and will be in 0.26 (to be
released by Tuesday).

In the mean time, the following should fix it for you:

chmod +x /var/lib/lxd/devices/psql

https://github.com/lxc/lxd/commit/babe4a2782098d75a8c0ab19ea31865bc3d965ce

On Sun, Jan 03, 2016 at 12:05:24PM +0100, david.andel at bli.uzh.ch wrote:
> Ok, made some progress, but running into permission errors now:
> 
> lxduser at qumind:~$ lxc profile show share
> name: share
> config: {}
> devices:
>   share:
>     path: /share
>     readonly: "true"
>     source: /share
>     type: disk
> 
> With profiles default,share enabled the container does not start.
> With only default enabled the container starts, and has generated the directory /share.
> But the mount fails:
> 
> lxduser at qumind:~$ lxc info --show-log psql | egrep -v '(DEBUG|WARN|INFO|NOTICE)'
> Name: psql
> Status: Running
> Init: 16545
> Processcount: 12
> Ips:
>   eth0: IPV4    10.0.3.81       vethJCPIW7
>   lo:   IPV4    127.0.0.1
>   lo:   IPV6    ::1
> 
> Log:
> 
> 
> 
>             lxc 1451754530.015 ERROR    lxc_monitor - monitor.c:lxc_monitor_open:209 - connect : backing off 10
>             lxc 1451754530.170 ERROR    lxc_utils - utils.c:safe_mount:1686 - Invalid argument - Failed to mount /sys/kernel/debug onto /usr/lib/x86_64-linux-gnu/lxc/sys/kernel/debug
>             lxc 1451754530.171 ERROR    lxc_utils - utils.c:open_without_symlink:1620 - No such file or directory - Error examining efi in /usr/lib/x86_64-linux-gnu/lxc/sys/firmware/efi/efivars
> 
> 
>             lxc 1451818054.343 ERROR    lxc_monitor - monitor.c:lxc_monitor_open:209 - connect : backing off 10
>             lxc 1451818054.434 ERROR    lxc_utils - utils.c:safe_mount:1686 - Invalid argument - Failed to mount /sys/kernel/debug onto /usr/lib/x86_64-linux-gnu/lxc/sys/kernel/debug
>             lxc 1451818054.435 ERROR    lxc_utils - utils.c:open_without_symlink:1620 - No such file or directory - Error examining efi in /usr/lib/x86_64-linux-gnu/lxc/sys/firmware/efi/efivars
>             lxc 1451818054.435 ERROR    lxc_utils - utils.c:safe_mount:1686 - Permission denied - Failed to mount /var/lib/lxd/devices/psql/disk.share onto /usr/lib/x86_64-linux-gnu/lxc/share
>             lxc 1451818054.435 ERROR    lxc_conf - conf.c:mount_entry:1731 - Permission denied - failed to mount '/var/lib/lxd/devices/psql/disk.share' on '/usr/lib/x86_64-linux-gnu/lxc/share'
>             lxc 1451818054.436 ERROR    lxc_conf - conf.c:lxc_setup:3920 - failed to setup the mount entries for 'psql'
>             lxc 1451818054.436 ERROR    lxc_start - start.c:do_start:731 - failed to setup the container
>             lxc 1451818054.436 ERROR    lxc_sync - sync.c:__sync_wait:51 - invalid sequence number 1. expected 2
>             lxc 1451818054.436 ERROR    lxc_start - start.c:__lxc_start:1213 - failed to spawn 'psql'
> 
> 
>             lxc 1451818078.782 ERROR    lxc_utils - utils.c:safe_mount:1686 - Invalid argument - Failed to mount /sys/kernel/debug onto /usr/lib/x86_64-linux-gnu/lxc/sys/kernel/debug
>             lxc 1451818078.783 ERROR    lxc_utils - utils.c:open_without_symlink:1620 - No such file or directory - Error examining efi in /usr/lib/x86_64-linux-gnu/lxc/sys/firmware/efi/efivars
> 
> 
>             lxc 1451818210.406 ERROR    lxc_utils - utils.c:safe_mount:1686 - Invalid argument - Failed to mount /sys/kernel/debug onto /usr/lib/x86_64-linux-gnu/lxc/sys/kernel/debug
>             lxc 1451818210.407 ERROR    lxc_utils - utils.c:open_without_symlink:1620 - No such file or directory - Error examining efi in /usr/lib/x86_64-linux-gnu/lxc/sys/firmware/efi/efivars
>             lxc 1451818210.407 ERROR    lxc_utils - utils.c:safe_mount:1686 - Permission denied - Failed to mount /var/lib/lxd/devices/psql/disk.share onto /usr/lib/x86_64-linux-gnu/lxc/share
>             lxc 1451818210.407 ERROR    lxc_conf - conf.c:mount_entry:1731 - Permission denied - failed to mount '/var/lib/lxd/devices/psql/disk.share' on '/usr/lib/x86_64-linux-gnu/lxc/share'
>             lxc 1451818210.407 ERROR    lxc_conf - conf.c:lxc_setup:3920 - failed to setup the mount entries for 'psql'
>             lxc 1451818210.407 ERROR    lxc_start - start.c:do_start:731 - failed to setup the container
>             lxc 1451818210.408 ERROR    lxc_sync - sync.c:__sync_wait:51 - invalid sequence number 1. expected 2
>             lxc 1451818210.408 ERROR    lxc_start - start.c:__lxc_start:1213 - failed to spawn 'psql'
> 
> 
>             lxc 1451818499.315 ERROR    lxc_utils - utils.c:safe_mount:1686 - Invalid argument - Failed to mount /sys/kernel/debug onto /usr/lib/x86_64-linux-gnu/lxc/sys/kernel/debug
>             lxc 1451818499.315 ERROR    lxc_utils - utils.c:open_without_symlink:1620 - No such file or directory - Error examining efi in /usr/lib/x86_64-linux-gnu/lxc/sys/firmware/efi/efivars
> 
> I am starting the container as user lxduser without sudo permissions. Or is that not even needed? I figured that it is more secure than staring the containers as the default ubuntu user with sudo:ALL.
> 
> -----"lxc-users" <lxc-users-bounces at lists.linuxcontainers.org> wrote: -----
> To: LXC users mailing-list <lxc-users at lists.linuxcontainers.org>
> From: david.andel at bli.uzh.ch
> Sent by: "lxc-users" 
> Date: 01/02/2016 19:04
> Subject: [lxc-users] LXD bind mount
> 
> I am trying to implement bind mounting for LXD containers using a profile 'share' containing:
> 
> name: share
> config:
>   lxc.mount.entry = /share share none bind 0 0
> devices: {}
> 
> However, when I try to save (in vi) I get the error:
> 
> Config parsing error: yaml: unmarshal errors:
>   line 21: cannot unmarshal !!str `lxc.mou...` into map[string]string
> Press enter to open the editor again
> 
> What am I doing wrong?
>  
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users

> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users


-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20160103/ce1373d9/attachment.sig>


More information about the lxc-users mailing list