When I create a new container in a LVM pool a few things have to be created in /dev
. Whether this is purely done by udev
I don’t know. But I noticed something strange.
For volumes created by LXD there is one block node in /dev/<vg_name>
and a symlink in /dev/mapper' pointing to the one in
/dev/<vg_name>`. For example
$ sudo lxc init images:ubuntu/bionic/amd64 -p pool2 test04
Creating test04
$ ls -l /dev/rapper-vg2/*test04* /dev/mapper/*test04*
brw-rw---- 1 root disk 253, 6 mei 19 14:01 /dev/mapper/rapper--vg2-containers_test04
lrwxrwxrwx 1 root root 41 mei 19 14:01 /dev/rapper-vg2/containers_test04 -> /dev/mapper/rapper--vg2-containers_test04
And in this case there is also a /dev/dm6
$ ls -l /dev/dm-6
brw-rw---- 1 root disk 253, 6 mei 19 14:01 /dev/dm-6
If you create a volume with lvcreate
then you get a symlink in /dev/<vg_name>
and /dev/mapper
$ sudo lvcreate --name mytest01 --yes --wipesignatures y rapper-vg2/LXDThinPool --thin --virtualsize 10G
Logical volume "mytest01" created.
$ ls -l /dev/rapper-vg2/*test01* /dev/mapper/*test01*
lrwxrwxrwx 1 root root 7 mei 19 14:01 /dev/mapper/rapper--vg2-mytest01 -> ../dm-5
lrwxrwxrwx 1 root root 7 mei 19 14:01 /dev/rapper-vg2/mytest01 -> ../dm-5
And of course a /dev/dm-5
.
So far I see that this is consistent and I don’t understand why. Is it a timing issue with udev
maybe?
And on one LXD system I see that it doesn’t even create the files for snapshots in /dev
. Something’s fishy.