I notice that if a device mapping is created with the low-level dmsetup or through ioctls, the device mapping will no longer be there after reboot.
- Is this normal? I am using a USB to test out dm_crypt
- If it is normal, how do I go about making the mapping stay around? Do I need to look into udev?
Edit for clarification
What I mean by device mapping is the table entry that specifies how to map each range of physical block sectors to a virtual block device. You can see what I mean, if using LVM, with the dmsetup table command. This will dump all current device table mappings. Here's an example for the device mapping linear target, tying two disks together into a LVM swap (physical block abstraction):
vg00-lv_swap: 0 1028160 linear /dev/sdb 0 vg00-lv_swap: 1028160 3903762 linear /dev/sdc 0
The format here is:
<mapping_name>: <start_block> <segment_length> <mapping_target> <block_device> <offset>
- mapping_name: the name of the virtual device
- start_block: starting block for virtual device
- segment_length: length in sectors (512 byte chunks)
- mapping_target: device mapping target such as linear, crypt, or striped
- block_device: which physical block device to use, in this case defined by major:minor
- offset: offset on physical block device
My problem is that, after creating a new entry in the device mapping table, it disappears after boot. That is, running something like:
dmsetup create TestEncrypted --table "0 $(blockdev --getsz /dev/sdb) crypt serpent-cbc-essiv:sha256 a7f67ad...ee 0 /dev/sdb 0"
and then rebooting causes the mapping table entry to disappear (i.e. doesn't show up with dmsetup table), as well as the corresponding