1、lxc config device add ins-10dbb56d0fd54a0a8dfd1511e9c4b94a ss unix-block source=/dev/sdd1
2、lxc exec ins-10dbb56d0fd54a0a8dfd1511e9c4b94a bash
4、Why is it mounted to /dev/mapper/klas-root directory after loading, and other directories cannot be mounted in the container?
Is this a VM or container?
Oh its a container, I see from the
/ mount source.
You are not able to mount filesystems on block devices inside an unprivileged container (the kernel doesn’t allow it because its unsafe).
Are you trying to share a filesystem on the block device with the container?
Yeah, I have added privilege mode. How to share the file system?
Probably the easiest way is to mount the filesystem on the host and then share it into the container using a
disk device, e.g.
lxc config device add <instance> mydisk disk source=/source/mount/point path=/target/mount/point
Thanks. The current file system is zfs. can I add unix-block devices directly?