Hello.
I use LXD 2.0.10 and I have one container named instance-00000012
(created by Openstack) with following profile:
config:
environment.product_name: OpenStack Nova
limits.cpu: "2"
limits.memory: 2048MB
raw.apparmor: mount fstype=ext4,
raw.lxc: |
lxc.console.logfile=/var/log/lxd/instance-00000012/console.log
description: ""
devices:
root:
path: /
type: disk
tap36aa7a42-39:
hwaddr: fa:16:3e:d8:e4:a3
nictype: physical
parent: tin36aa7a42-39
type: nic
name: instance-00000012
lsblk
shows this information inside container:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
fd0 2:0 1 4K 0 disk
loop9 7:9 0 1G 0 loop
sda 8:0 0 25G 0 disk
└─sda1 8:1 0 25G 0 part /
As you can see I have fake block device /dev/loop9
and I want to add it as block device to my container. I used this command:
lxc profile device add instance-00000012 volume unix-block path=/dev/loop9
Device volume was added successfully and now profile looks like this:
config:
environment.product_name: OpenStack Nova
limits.cpu: "2"
limits.memory: 2048MB
raw.apparmor: mount fstype=ext4,
raw.lxc: |
lxc.console.logfile=/var/log/lxd/instance-00000012/console.log
description: ""
devices:
root:
path: /
type: disk
tap36aa7a42-39:
hwaddr: fa:16:3e:d8:e4:a3
nictype: physical
parent: tin36aa7a42-39
type: nic
volume:
path: /dev/loop9
type: unix-block
name: instance-00000012
But lsblk
shows something weird:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
fd0 2:0 1 4K 0 disk
loop9 7:9 0 1G 0 loop
sda 8:0 0 25G 0 disk
└─sda1 8:1 0 25G 0 part /dev/loop9
I expected something like this:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
fd0 2:0 1 4K 0 disk
loop9 7:9 0 1G 0 loop /dev/loop9
sda 8:0 0 25G 0 disk
└─sda1 8:1 0 25G 0 part /
Is it normal situation or I just don’t understand specific container mounting?
But main problem is that I can’t mount /dev/loop9 to /mnt inside container, because I see
mount: permission denied
Can you help me to understand these two problems?