[lxc-users] mount 2nd LV in a LVM container

Flo florian.engelmann at gmail.com
Thu Feb 6 09:17:32 UTC 2014


Hi Serge,

any update on this? Are you able to mount 2nd LVM volumes in a container?

Regards,
Flo


On Tue, Feb 4, 2014 at 8:47 AM, Flo <florian.engelmann at gmail.com> wrote:

> Hi Serge
>
> On Mon, Feb 3, 2014 at 10:09 PM, Serge Hallyn <serge.hallyn at ubuntu.com>wrote:
>
>> Quoting Flo (florian.engelmann at gmail.com):
>> > Hi,
>> >
>> > is it possible to mount a 2nd logical volume into a LVM based container?
>> >
>> > I tried:
>> >
>> > /dev/lxc2/glusterfs-test srv/glusterfs ext4 defaults 0 0
>>
>> lxc2 is vgname and glusterfs-test is lvname?
>>
>
> Sorry there was a typo - "lvs" looks like this:
>
>   LV                   VG     Attr      LSize   Pool      Origin Data%
>  Move Log Copy%  Convert
>   thin_pool            lxc1   twi-a-tz- 800.00g                    0.00
>
>   glusterfs            lxc2   Vwi-aotz- 300.00g thin_pool          1.61
>
>   glusterfs-test       lxc2   Vwi-a-tz-  10.00g thin_pool          1.28
>
>   storage01-jobs2-prod lxc2   Vwi-a-tz-  30.00g thin_pool          3.99
>
>   thin_pool            lxc2   twi-a-tz- 800.00g                    0.77
>
>   home                 system -wi-ao---   4.77g
>
>   opt                  system -wi-ao---   1.91g
>
>   root                 system -wi-ao---   9.54g
>
>   srv                  system -wi-ao---   1.91g
>
>   swap                 system -wi-ao---  61.04g
>
>   temp                 system -wi-ao---   3.81g
>
>   var                  system -wi-ao---   7.63g
>
>   var_log              system -wi-ao---   3.81g
>
>
> here is my fstab:
> #> cat /var/lib/lxc/storage01-jobs2-prod/fstab
> /srv/glusterfs srv/glusterfs none bind 0 0
> /dev/mapper/lxc1-glusterfs--test srv/glusterfs-test ext4 0 2
>
>
>
>>
>> > and
>> >
>> > /dev/lxc2/glusterfs-test srv/glusterfs none defaults 0 0
>> >
>> > or
>> >
>> > /dev/mapper/lxc2-glusterfs--test .....
>> >
>> >
>> > into my /var/lib/lxc/<containername>/fstab
>> >
>> > but none did work. A bind mount does work:
>> >
>> > /srv/glusterfs srv/glusterfs none bind 0 0
>> >
>> > but I don't want the FS mounted on the global host.
>> >
>> > Do I have to allow access to the device?
>> >
>> > lxc.cgroup.devices.allow = ????
>>
>> Can you do 'lxc-start -n cname -l info -o debug.out' and show
>> us the debug.out?
>>
>
> #> lxc-start -d -n storage01-jobs2-prod -l debug -o /tmp/2d
> lxc-start: command get_cgroup failed to receive response
> #> cat /tmp/2d
>       lxc-start 1391499461.367 INFO     lxc_start_ui - using rcfile
> /var/lib/lxc/storage01-jobs2-prod/config
>       lxc-start 1391499461.369 WARN     lxc_log - lxc_log_init called with
> log already initialized
>       lxc-start 1391499461.374 INFO     lxc_lsm - LSM security driver
> AppArmor
>       lxc-start 1391499461.375 DEBUG    lxc_conf - allocated pty
> '/dev/pts/0' (5/6)
>       lxc-start 1391499461.375 DEBUG    lxc_conf - allocated pty
> '/dev/pts/1' (7/8)
>       lxc-start 1391499461.375 DEBUG    lxc_conf - allocated pty
> '/dev/pts/2' (9/10)
>       lxc-start 1391499461.375 DEBUG    lxc_conf - allocated pty
> '/dev/pts/4' (11/12)
>       lxc-start 1391499461.375 INFO     lxc_conf - tty's configured
>       lxc-start 1391499461.375 DEBUG    lxc_start - sigchild handler set
>       lxc-start 1391499461.375 DEBUG    lxc_console - opening
> /var/lib/lxc/storage01-jobs2-prod/console.out for console peer
>       lxc-start 1391499461.376 DEBUG    lxc_console - using
> '/var/lib/lxc/storage01-jobs2-prod/console.out' as console
>       lxc-start 1391499461.376 INFO     lxc_start - 'storage01-jobs2-prod'
> is initialized
>       lxc-start 1391499461.378 INFO     lxc_monitor - using monitor sock
> name lxc/ad055575fe28ddd5//var/lib/lxc
>       lxc-start 1391499461.388 DEBUG    lxc_start - Not dropping
> cap_sys_boot or watching utmp
>
>       lxc-start 1391499461.393 DEBUG    lxc_conf - instanciated veth
> 'vethCMC65T/vethE9KCCQ', index is '167'
>       lxc-start 1391499461.398 DEBUG    lxc_conf - instanciated veth
> 'veth90WWTD/vethNPY8DI', index is '169'
>       lxc-start 1391499461.402 DEBUG    lxc_cgroup - cgroup 'devices.deny'
> set to 'a'
>       lxc-start 1391499461.402 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c *:* m'
>       lxc-start 1391499461.402 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'b *:* m'
>       lxc-start 1391499461.402 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 1:3 rwm'
>       lxc-start 1391499461.402 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 1:5 rwm'
>       lxc-start 1391499461.402 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 5:0 rwm'
>       lxc-start 1391499461.402 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 5:1 rwm'
>       lxc-start 1391499461.402 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 1:8 rwm'
>       lxc-start 1391499461.402 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 1:9 rwm'
>       lxc-start 1391499461.402 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 5:2 rwm'
>       lxc-start 1391499461.402 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 136:* rwm'
>       lxc-start 1391499461.402 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 254:0 rm'
>       lxc-start 1391499461.402 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 10:229 rwm'
>       lxc-start 1391499461.402 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 10:200 rwm'
>       lxc-start 1391499461.402 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 1:7 rwm'
>       lxc-start 1391499461.402 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 10:228 rwm'
>       lxc-start 1391499461.402 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 10:232 rwm'
>       lxc-start 1391499461.402 DEBUG    lxc_cgroup - cgroup
> 'memory.limit_in_bytes' set to '16G'
>       lxc-start 1391499461.403 DEBUG    lxc_cgroup - cgroup
> 'memory.soft_limit_in_bytes' set to '15G'
>       lxc-start 1391499461.403 INFO     lxc_cgroup - cgroup has been setup
>       lxc-start 1391499461.420 DEBUG    lxc_conf - move 'front' to '14739'
>       lxc-start 1391499461.445 DEBUG    lxc_conf - move 'back' to '14739'
>       lxc-start 1391499461.445 INFO     lxc_conf - 'storage01-jobs2-prod'
> hostname has been setup
>       lxc-start 1391499461.468 DEBUG    lxc_conf - mac address
> '00:16:3f:ae:ee:f5' on 'front' has been setup
>       lxc-start 1391499461.468 DEBUG    lxc_conf - 'front' has been setup
>       lxc-start 1391499461.500 DEBUG    lxc_conf - mac address
> '00:16:3b:83:b6:a7' on 'back' has been setup
>       lxc-start 1391499461.500 DEBUG    lxc_conf - 'back' has been setup
>       lxc-start 1391499461.500 INFO     lxc_conf - network has been setup
>       lxc-start 1391499461.502 DEBUG    bdev - trying to mount
> '/dev/lxc2/storage01-jobs2-prod'->'/usr/lib/x86_64-linux-gnu/lxc' with
> fstype 'ext3'
>       lxc-start 1391499461.503 INFO     bdev - mounted
> '/dev/lxc2/storage01-jobs2-prod' on '/usr/lib/x86_64-linux-gnu/lxc', with
> fstype 'ext3'
>       lxc-start 1391499461.504 DEBUG    lxc_conf - mounted
> '/dev/lxc2/storage01-jobs2-prod' on '/usr/lib/x86_64-linux-gnu/lxc'
>       lxc-start 1391499461.504 DEBUG    lxc_conf - Set exec command to
> /sbin/init
>
>       lxc-start 1391499461.512 INFO     lxc_conf - Autodev not required.
>       lxc-start 1391499461.521 DEBUG    lxc_conf - remounting
> /srv/glusterfs on /usr/lib/x86_64-linux-gnu/lxc/srv/glusterfs to respect
> bind or remount options
>       lxc-start 1391499461.521 DEBUG    lxc_conf - mounted
> '/srv/glusterfs' on '/usr/lib/x86_64-linux-gnu/lxc/srv/glusterfs', type
> 'none'
>       lxc-start 1391499461.521 ERROR    lxc_conf - Invalid argument -
> failed to mount '/dev/mapper/lxc1-glusterfs--test' on
> '/usr/lib/x86_64-linux-gnu/lxc/srv/glusterfs-test'
>       lxc-start 1391499461.521 ERROR    lxc_conf - failed to setup the
> mounts for 'storage01-jobs2-prod'
>       lxc-start 1391499461.521 ERROR    lxc_start - failed to setup the
> container
>       lxc-start 1391499461.521 ERROR    lxc_sync - invalid sequence number
> 1. expected 2
>       lxc-start 1391499461.521 WARN     lxc_conf - failed to remove
> interface 'front'
>       lxc-start 1391499461.521 WARN     lxc_conf - failed to remove
> interface 'back'
>       lxc-start 1391499461.596 ERROR    lxc_start - failed to spawn
> 'storage01-jobs2-prod'
>       lxc-start 1391499461.597 ERROR    lxc_commands - command get_cgroup
> failed to receive response
>
>
> Regards,
> Florian
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20140206/78d3707c/attachment.html>


More information about the lxc-users mailing list