[lxc-users] LXD bind mount

david.andel at bli.uzh.ch david.andel at bli.uzh.ch
Sun Jan 3 11:05:24 UTC 2016


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20160103/082f6c7b/attachment.html>


More information about the lxc-users mailing list