Score:0

Different detection behavior of LUKS1 and LUKS2 encrypted external SSD

ph flag

I wrote a udev-rule and an entry in fstab to auto-unlock the SSD as soon as it is connected to the system.

The separate udev-rule file contains the following rule

ACTION=="add", ENV{ID_FS_TYPE}=="crypto_LUKS", ENV{DEVNAME}=="/dev/sd?1", RUN+="/sbin/cryptsetup --key-file /etc/keys/logdisk-key luksOpen $env{DEVNAME} crypt1"

and the entry in fstab is

/dev/mapper/crypt1 /media/usb ext4 auto,nofail 0 0

While this works for LUKS1 type encryption, when I encrypt the same drive with a LUKS2 encryption, the udev rule doesn't run as expected. Though, fstab auto-mounts it as soon as I unlock the disk manually using the luksOpen command.

While I can use LUKS1 encryption for my purpose, but any ideas on what might be causing this behavior? And how to make this method work for LUKS2?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.