Closed mirko closed 4 years ago
That's really not something we can fix since this is how mounts are exposed by the kernel, i.e. if you were to setup any mount across mount namespaces, even if the origin mount is neither accessible nor visible inside your mount namespace, you can still see it as part of the mount you setup:
└─/dev/ttyS0 /dev/mapper/sda3_crypt[/var/lib/lxd/devices/f1/unix.ddd.dev-ttyS0] ext4 rw,relatime,errors=remount-ro
findmnt
has the same behavior. Really nothing we can do about it short of changing how mountinfo
works which is a nogo given that it would be a regression.
Ok, thanks for the heads up. All I can say is, that it's really confusing to see the block device your root file system of the physical host is on, incl. all its metadata (df -h shows all the familiar details about it), being mounted to a character device being passed-through.
Yeah, unfortunately that's really the only way we can make device nodes appear in containers.
Required information
Issue description
When adding a unix-char device to a container, it's listed as mounted block device. To be more precise: the block device the hypervisor's root file system is on.
Steps to reproduce
$ mount | grep root /dev/mapper/HV-root on / type ext4 [..] $ lxc config device add VM ttyUSB0 unix-char path=/dev/ttyUSB0 $ ssh VM.lxc "df -h | grep ttyUSB" /dev/mapper/HV-root 733G 694G 1.7G 100% /dev/ttyUSB0