[gelöst] LXC - empty mount points - Fixed in Jessie

Du hast Probleme mit Deinem eMail-Programm, Webbrowser oder Textprogramm? Dein Lieblingsprogramm streikt?
Antworten
markusre
Beiträge: 2
Registriert: 11.07.2014 12:08:39

[gelöst] LXC - empty mount points - Fixed in Jessie

Beitrag von markusre » 11.07.2014 12:24:10

Hallo miteinander,

ich verwende Wheezy als host und habe mit dem debian-wheezy template einen systemcontainer namens "ssh-container" angelegt.
Auf dem Host habe ich ein ein verschlüsseltes Raid /dev/mapper/maRAIDfs nach /mnt/maRAIDfs gemounted. Ich möchte im Container Zugriff darauf haben, am besten unter einem gleichlautenden mountpoint.

Hier der Inhalt meiner /var/lib/lxc/ssh-container/config

Code: Alles auswählen

lxc.rootfs = /var/lib/lxc/ssh-container/rootfs
lxc.tty = 4
lxc.pts = 1024
lxc.arch = amd64
lxc.utsname = ssh-container
lxc.cap.drop = sys_module mac_admin mac_override sys_time

# When using LXC with apparmor, uncomment the next line to run unconfined:
#lxc.aa_profile = unconfined

lxc.cgroup.devices.deny = a
# /dev/null and zero
lxc.cgroup.devices.allow = c 1:3 rwm
lxc.cgroup.devices.allow = c 1:5 rwm
# consoles
lxc.cgroup.devices.allow = c 5:1 rwm
lxc.cgroup.devices.allow = c 5:0 rwm
lxc.cgroup.devices.allow = c 4:0 rwm
lxc.cgroup.devices.allow = c 4:1 rwm
# /dev/{,u}random
lxc.cgroup.devices.allow = c 1:9 rwm
lxc.cgroup.devices.allow = c 1:8 rwm
lxc.cgroup.devices.allow = c 136:* rwm
lxc.cgroup.devices.allow = c 5:2 rwm
# rtc
lxc.cgroup.devices.allow = c 254:0 rm

# mounts point
lxc.mount.entry = proc proc proc nodev,noexec,nosuid 0 0
lxc.mount.entry = sysfs sys sysfs defaults  0 0
lxc.mount.entry = /mnt/maRAIDfs /var/lib/lxc/ssh-container/rootfs/mnt/maRAIDfs none bind 0 0
lxc.mount.entry = /home/user /var/lib/lxc/ssh-container/rootfs/mnt/tmp1 none bind 0 0
Den letzten Eintrag habe ich zum testen angelegt. Beide mount points im Container sind leer.

Der Aufruf des Containers

Code: Alles auswählen

lxc-start -n ssh-container -o tmp.txt -l INFO 
und die Ausgabe in tmp.txt ist leider auch nicht aufschlussreich:

Code: Alles auswählen

      lxc-start 1405074080.179 INFO     lxc_conf - tty's configured
      lxc-start 1405074080.179 INFO     lxc_start - 'ssh-container' is initialized
      lxc-start 1405074080.179 INFO     lxc_cgroup - [1] found cgroup mounted at '/sys/fs/cgroup',opts='rw,relatime,perf_event,blkio,net_cls,freezer,devices,cpuacct,cpu,cpuset,clo
      lxc-start 1405074080.206 INFO     lxc_cgroup - created cgroup '/sys/fs/cgroup//lxc/ssh-container'
      lxc-start 1405074080.257 INFO     lxc_conf - 'ssh-container' hostname has been setup
      lxc-start 1405074080.258 INFO     lxc_conf - mount points have been setup
      lxc-start 1405074080.259 INFO     lxc_conf - cgroup has been setup
      lxc-start 1405074080.259 INFO     lxc_conf - console has been setup
      lxc-start 1405074080.259 INFO     lxc_conf - 4 tty(s) has been setup
      lxc-start 1405074080.260 INFO     lxc_conf - created new pts instance
      lxc-start 1405074080.260 INFO     lxc_conf - set personality to '0x0'
      lxc-start 1405074080.260 NOTICE   lxc_conf - 'ssh-container' is setup.
      lxc-start 1405074080.260 NOTICE   lxc_start - exec'ing '/sbin/init'
      lxc-start 1405074080.260 NOTICE   lxc_start - '/sbin/init' started with pid '22786'

Grüße

Markus
Zuletzt geändert von markusre am 12.07.2014 11:06:10, insgesamt 2-mal geändert.

markusre
Beiträge: 2
Registriert: 11.07.2014 12:08:39

Re: LXC - empty mount points

Beitrag von markusre » 11.07.2014 14:01:05

An Update on the issue:

when taking https://linuxcontainers.org/downloads/lxc-1.0.4.tar.gz, compiling it and installing (and fixing some paths) the mount works just fine. Meaning both /home/user and /mnt/maRAIDfs can be seen in their mount points inside the container.

So I assume this is a bug with the old version, which is in the wheezy repository.

Regards

Markus

rendegast
Beiträge: 15041
Registriert: 27.02.2006 16:50:33
Lizenz eigener Beiträge: MIT Lizenz

Re: [gelöst] LXC - empty mount points - Fixed in Jessie

Beitrag von rendegast » 12.07.2014 16:52:20

Du könntest vor dem lxc-start einen bind-mount in das rootfs/ anlegen.
mfg rendegast
-----------------------
Viel Eifer, viel Irrtum; weniger Eifer, weniger Irrtum; kein Eifer, kein Irrtum.
(Lin Yutang "Moment in Peking")

Antworten