The 'Configuration with dmsetup tool' at https://gitlab.com/cryptsetup/cryptsetup/-/wikis/DMCrypt , shows how to use the devicemapper library and how to format the table etc. However, the created device ends up coming up under /dev/dm-{0, 1, 2...} instead of /dev/mapper/{DmName used in device creation}. Is this an issue?
Alternatively, is there a way to open a file to /dev/dm-{0,1...}? I see the major number and minor number of the device, but am not sure how to get the path from this. I see CacheDev, LinearDev, and ThinDev implement a devnode trait which returns the path, but I don't see how to do so for a dm-crypt device. Thanks