wwws
(shuai)
1
1、lxc config device add ins-10dbb56d0fd54a0a8dfd1511e9c4b94a ss unix-block source=/dev/sdd1
2、lxc exec ins-10dbb56d0fd54a0a8dfd1511e9c4b94a bash
3、
4、Why is it mounted to /dev/mapper/klas-root directory after loading, and other directories cannot be mounted in the container?
tomp
(Thomas Parrott)
2
Is this a VM or container?
tomp
(Thomas Parrott)
3
Oh its a container, I see from the /
mount source.
tomp
(Thomas Parrott)
4
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?
wwws
(shuai)
5
Yeah, I have added privilege mode. How to share the file system?
tomp
(Thomas Parrott)
6
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
wwws
(shuai)
7
Thanks. The current file system is zfs. can I add unix-block devices directly?