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