[Lxc-users] Some /dev/dm-* not exists in guest

Serge Hallyn serge.hallyn at canonical.com
Mon May 21 12:39:47 UTC 2012


Just guessing, but

1. can you mknod the devices in the container?  Can the container then
use them?

2. which device are the containers on?  I.e. what do pvscan, vgscan,
and lvscan on the host show?  Does the container actually have access
to all the physical disks involved as well?

-serge

Quoting Giovanni Lovato (heruan at aldu.net):
> I'm using LXC on Ubuntu 12.04, and I have 4 LVM logical volumes:
> 
> lxc-host$ ls -l /dev/dm-*
> brw-rw---- 1 root disk 252, 0 May 19 11:47 /dev/dm-0
> brw-rw---- 1 root disk 252, 1 May 19 11:47 /dev/dm-1
> brw-rw---- 1 root disk 252, 2 May 19 11:47 /dev/dm-2
> brw-rw---- 1 root disk 252, 3 May 19 11:47 /dev/dm-3
> brw-rw---- 1 root disk 252, 4 May 19 11:47 /dev/dm-4
> 
> I need dm-3 and dm-4 to be available on a guest, but I only see dm-0 and dm-4
> 
> lxc-guest$ ls -l /dev/dm-*
> brw-rw---- 1 root disk 252, 0 May 13 03:05 /dev/dm-0
> brw-rw---- 1 root disk 252, 4 May 19 02:35 /dev/dm-4
> 
> This is the guest configuration:
> #### BEGIN ####
> lxc.network.type = veth
> lxc.network.flags = up
> lxc.network.link = br2
> lxc.network.name = eth0
> lxc.network.ipv4 = 192.168.2.13/24
> 
> lxc.utsname = lxc-guest
> 
> lxc.devttydir =  lxc
> lxc.tty = 4
> lxc.pts = 1024
> lxc.rootfs = /var/lib/lxc/lxc-guest/rootfs
> lxc.mount  = /var/lib/lxc/lxc-guest/fstab
> lxc.arch = i686
> lxc.cap.drop = sys_module mac_admin
> # uncomment the next line to run the container unconfined:
> #lxc.aa_profile = unconfined
> 
> lxc.cgroup.devices.deny = a
> # Allow any mknod (but not using the node)
> lxc.cgroup.devices.allow = c *:* m
> lxc.cgroup.devices.allow = b *:* m
> # /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 rwm
> # fuse
> lxc.cgroup.devices.allow = c 10:229 rwm
> # tun
> lxc.cgroup.devices.allow = c 10:200 rwm
> # full
> lxc.cgroup.devices.allow = c 1:7 rwm
> # hpet
> lxc.cgroup.devices.allow = c 10:228 rwm
> # kvm
> lxc.cgroup.devices.allow = c 10:232 rwm
> #### END ####
> 
> I tried to add:
> 
> lxc.cgroup.devices.allow = b 252:* rwm
> 
> but nothing changed!
> 
> I can't understand this behavior, I'm clearly missing something!
> 
> Giovanni
> 
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Lxc-users mailing list
> Lxc-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-users




More information about the lxc-users mailing list