I’m attempting to partition a loop-mounted image file in a container and the
dev/loop0pn device files do not appear.
fallocate -l 8G disk.img
losetup -P /dev/loop0 disk.img
fdisk /dev/loop0 # create partitions
ls /dev/loop0* # no devices representing subdevices appear
The same routine works fine on the host (
dev/loop0p2 dynamically appear - they don’t exist until fdisk write the partitions).
The container profile looks like:
config: raw.lxc: |- lxc.cgroup.devices.allow = c 10:237 rwm lxc.aa_profile = unconfined lxc.cgroup.devices.allow = b 7:* rwm security.privileged: "true" description: "" devices: loop0: path: /dev/loop0 type: unix-block loop1: path: /dev/loop1 type: unix-block loop2: path: /dev/loop2 type: unix-block loop3: path: /dev/loop3 type: unix-block loop4: path: /dev/loop4 type: unix-block loop5: path: /dev/loop5 type: unix-block loop6: path: /dev/loop6 type: unix-block loop7: path: /dev/loop7 type: unix-block root: path: / pool: default type: disk wlan0: nictype: bridged parent: br0 type: nic
I’m using LXC 2.1.1 on Gentoo amd64
Any hints on how I might progress / workarounds / references / things to try would be great.
Also if someone could explain to me what is happening on the host after fdisk writes to the loopback device that causes the new
/dev/loop0pn devices to be created that would be really excellent!