-
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 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@adashofme If you're interested in programming dm-crypt in Rust you might want to look at the libcryptsetup bindings here[1]. These are bindings for the libcryptsetup library. We chose to use these bindings in stratisd, instead of directly creating the dm-crypt device, because cryptsetup incorporates a signficant layer of encryption management that we did not want to duplicate in stratisd. For this reason, we were never motivated to add a DmCrypt layer to the devicemapper library. The additional links that might be created for a dm-crypt device are dependent on the specifics of your machine, so it is hard for me to say whether you should be concerned or not. |
Beta Was this translation helpful? Give feedback.
@adashofme If you're interested in programming dm-crypt in Rust you might want to look at the libcryptsetup bindings here[1]. These are bindings for the libcryptsetup library. We chose to use these bindings in stratisd, instead of directly creating the dm-crypt device, because cryptsetup incorporates a signficant layer of encryption management that we did not want to duplicate in stratisd. For this reason, we were never motivated to add a DmCrypt layer to the devicemapper library.
The additional links that might be created for a dm-crypt device are dependent on the specifics of your machine, so it is hard for me to say whether you should be concerned or not.
[1] https://github.com/stratis…