empty directory listing for mounts, but only some of them...

14 views
Skip to first unread message

Heiko G

unread,
Feb 21, 2023, 12:31:33 PM2/21/23
to lxc-users
Hi there,
I recognized some strange behavior for mounting directories inside lxc containers from a host system. I try to mount several directories in my container configuration:

-----------------------------------------------------
# Distribution configuration
lxc.include = /usr/share/lxc/config/debian.common.conf
lxc.arch = amd64

# Container specific configuration
# see https://www.claudiokuenzler.com/blog/1095/unable-to-start-container-lxc-4.0-failed-to-mount-permission-denied-apparmor
lxc.uts.name = web02
lxc.rootfs.path = dir:/var/lib/lxc/web02/rootfs
lxc.apparmor.profile = generated
lxc.apparmor.allow_nesting = 1

# mount needed host directorys (nas) to container
lxc.mount.entry = /mnt/nas/vm/docker            /var/lib/lxc/web02/rootfs/var/lib/docker    none    rw,bind 0 0
#lxc.mount.entry = /mnt/nas/www                /var/lib/lxc/web02/rootfs/mnt/nas/www        none    rw,bind    0 0
lxc.mount.entry = /mnt/nas/documentation_html/site    /var/lib/lxc/web02/rootfs/mnt/nas/wiki        none    bind    0 0
lxc.mount.entry = /mnt/nas/mp3_klassik            /var/lib/lxc/web02/rootfs/mnt/nas/mp3_klassik    none    bind     0 0
lxc.mount.entry = /mnt/nas/mp3                /var/lib/lxc/web02/rootfs/mnt/nas/mp3        none    bind     0 0
lxc.mount.entry = /mnt/nas/ebooks            mnt/nas/ebooks    none    bind    0 0

-----------------------------------------------------

/mnt/nas is a mounted partition on my host system containing several directories the container needs access to. The problem is, that only two of the mounts lead to successful directory listings inside the container...
I tried to experiment with absolute and relative mount points, but no change. Permissions are equal on the host. Inside the container I get success messages for the mounts even when the listing shows no files:

Feb 21 18:17:04 web02.lan.webtux.de systemd[1]: mnt-nas-ebooks.mount: Succeeded.
Feb 21 18:17:04 web02.lan.webtux.de systemd[1]: mnt-nas-mp3.mount: Succeeded.
Feb 21 18:17:04 web02.lan.webtux.de systemd[1]: mnt-nas-mp3_klassik.mount: Succeeded.

I am using Debian bullseye 5.10.0-21 using lxc 4.0.6-2+deb11u1

Any ideas on that?
Thank you for helping out

Andreas Laut

unread,
May 5, 2023, 9:47:00 AM5/5/23
to lxc-...@lists.linuxcontainers.org
Hi,

let me ask you a question:

The output of systemd is from the lxc?

I mean this

Feb 21 18:17:04 web02.lan.webtux.de systemd[1]: mnt-nas-ebooks.mount:
Succeeded.
Feb 21 18:17:04 web02.lan.webtux.de systemd[1]: mnt-nas-mp3.mount:
Succeeded.
Feb 21 18:17:04 web02.lan.webtux.de systemd[1]: mnt-nas-mp3_klassik.mount:
Succeeded.

The bind mounts are done through starting the lxc and so there is
nothing to do for the lxc and no mount operation to log as I know. Do
you have it somewhere else configured and mount a empty dir over it?

Cheers,


Andreas Laut
System-Administrator
--
Spark 5 GmbH
Rheinstr. 97
64295 Darmstadt
Germany
--
Fon: +49-6151-8508-021
Fax: +49-6151-8508-111
E-Mail: andrea...@spark5.de


Web: https://www.spark5.de
--
Geschäftsführer: Henning Munte, Michael Mylius
Amtsgericht Darmstadt, HRB 7809
--

Am 21.02.23 um 18:31 schrieb 'Heiko G' via lxc-users:
Reply all
Reply to author
Forward
0 new messages