Score:0

LUKS decrypted partition mapped name

es flag

I've successfully configured LUKS encryption on various partitions (root, home, extra) on ubuntu 22.04. I've to insert a password for decrypting the root part and after other partitions are decrypted using a file that is inside the root partition.

Everything works but there's an annoying thing:

the home partition /dev/nvme0n1p7, this is the crypttab file:

nvme0n1p6_crypt UUID=6566c7ae-f3f7-464f-8eb7-bec2a5499d82 none luks,discard
nvme0n1p7_crypt UUID=d50b5303-b96a-4a69-9512-a7e276e66be7 /etc/luks/boot_os.keyfile luks,discard,noearly
nvme0n1p8_crypt UUID=7790ba4d-aff2-4305-83cf-a259cbbb721f /etc/luks/boot_os.keyfile luks,discard,noearly
nvme0n1p4_crypt UUID=ac79140b-5c17-4c4b-8d33-c30241ad63ee /etc/luks/boot_os.keyfile luks,discard

here the fstab:

/dev/mapper/nvme0n1p6_crypt /               ext4    errors=remount-ro 0       1
/dev/nvme0n1p1              /boot           ext4    defaults          0       2
UUID=B960-650F              /boot/efi       vfat    umask=0077        0       1
/dev/mapper/home            /home           ext4    defaults          0       2
/dev/mapper/nvme0n1p8_crypt /works          ext4    defaults          0       2
/dev/mapper/nvme0n1p4_crypt none            swap    sw                0       0

I had to change mapped device that is mounted as home to /dev/mapper/home instead of /dev/mapper/nvme0n1p7_crypt because otherwise the system doesn't boot properly.

Other partitions mapper devices are following the crypttab file.

I really don't understand why. Where can this "home" alias be configured? This partition has a /home label, can this the reason why this name is used? Strange that it's not used with other partitions tho.

EDIT: Removed noearly because it seems it's not used:

May 24 10:35:39 think systemd-cryptsetup[1567]: Encountered unknown /etc/crypttab option 'noearly', ignoring.

EDIT AGAIN: This morning during a boot the encrypted partition has been decrypted with the correct name /dev/mapper/nvme0n1p7_crypt but after changing the fstab on the next reboot the mapped device was again /dev/mapper/home. I think it depends on when this operation is done but I cannot find any documentation around this

Sebastian avatar
in flag
Is that the content of your `/etc/crypttab`? Can you post the entire content of `/etc/crypttab` and `/etc/fstab`?
Francesco avatar
es flag
@Sebastian added the full content of the two files you asked for in the question
Sebastian avatar
in flag
Thanks. What do you mean by "the system doesn't boot properly"? Maybe you can try removing the `noearly` option from the entry in question, not sure that is the reason but it's worth a shot.
Francesco avatar
es flag
@Sebastian the home partition isn't mounted and GDM doesn't start but only a shell is dropped. This morning it happened that the partition has been mounted with the `nvme0n1p7_crypt` name once and after changing `fstab` accordingly again on the next reboot it was again back to `home`. I think it's something related to when the part is mounted. I've removed the `noearly` already also because it seems it's not used: `May 24 10:35:39 think systemd-cryptsetup[1567]: Encountered unknown /etc/crypttab option 'noearly', ignoring.`
Sebastian avatar
in flag
I'm afraid I am at a loss as to what happens. The only thing I can imagine is that something goes wrong during the boot/decryption process. The fact that it seems to occur randomly suggests there might be some timing problem. I would maybe try to decrypt the home partition with a password instead of a keyfile (you can add it as a second keyslot) and see if that works.
I sit in a Tesla and translated this thread with Ai:

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.