[Lxc-users] loop mount inside container
Marc Aymerich
glicerinu at gmail.com
Tue Jun 5 18:58:07 UTC 2012
Dear all,
I'm trying to mount an image file inside a container but it complains
about write permissions:
(vct: container,
bestia: hw node)
root at vct:/dev# mount -o loop /root/server_bootable.img /mnt/
mount: block device /root/server_bootable.img is write-protected,
mounting read-only
mount: cannot mount block device /dev/loop1 read-only
root at vct:/# ls -al /dev/loop*
crw------- 1 root root 10, 237 Jun 4 14:52 /dev/loop-control
brw-rw---- 1 root disk 7, 0 Apr 26 17:10 /dev/loop0
brw-rw---- 1 root disk 7, 1 Apr 26 17:10 /dev/loop1
brw-rw---- 1 root disk 7, 2 Apr 26 17:10 /dev/loop2
brw-rw---- 1 root disk 7, 3 Apr 26 17:10 /dev/loop3
brw-rw---- 1 root disk 7, 4 Apr 26 17:10 /dev/loop4
brw-rw---- 1 root disk 7, 5 Apr 26 17:10 /dev/loop5
brw-rw---- 1 root disk 7, 6 Apr 26 17:10 /dev/loop6
brw-rw---- 1 root disk 7, 7 Apr 26 17:10 /dev/loop7
Write permissions to /dev/loop1 are provided through the container config file
lxc.cgroup.devices.allow = b 7:* rwm
lxc.cgroup.devices.allow = c 10:237 rwm
but in the end, I can't write to it:
root at vct:/dev# echo '' > /dev/loop1
-bash: echo: write error: Operation not permitted
writing to other loop devices seems possible:
root at vct:/dev# echo '' > /dev/loop2
-bash: echo: write error: No space left on device
I'm using ubuntu 10.04 with:
root at vct:/# uname -r
3.2.0-23-generic
root at bestia:/# lxc-version
lxc version: 0.8.0-rc1
Any idea about what the problem could be?
Thank you very much!!
--
Marc
More information about the lxc-users
mailing list