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_cryptIf it is normal, how do I go about making the mapping stay around? Do I need to look into udev?Thanks!Edit for clarificationWhat 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 0vg00-lv_swap: 1028160 3903762 linear /dev/sdc 0The format here is:<mapping_name>: <start_block> <segment_length> <mapping_target> <block_device> <offset> Where:mapping_name: the name of the virtual devicestart_block: starting block for virtual devicesegment_length: length in sectors (512 byte chunks)mapping_target: device mapping target such as linear, crypt, or stripedblock_device: which physical block device to use, in this case defined by major:minoroffset: 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 0and then rebooting causes the mapping table entry to disappear (i.e. doesn't show up with dmsetup table), as well as the corresponding /dev/mapper/TestEncrypted
How to make device mappings stay after reboot?
linux;udev;dm crypt;device mapper
Not 100% I understand what you mean by mapping but, Yes this seems normal.  You need to add the device to either /etc/crypttab or /etc/fstab like you would to mount any other drive.https://wiki.archlinux.org/index.php/Dm-crypt/System_configuration#crypttab^ Should have the information you're looking for.