2

tldr: My /etc/crypttab went missing and I do not know how to rebuild it.

I tried to upgrade from 20.04 to 22.04 and something wrong. When booting I just landed in initramfs. Never heard of that. After a few hours of googling and trying things out I learned that my encrypted / partition was not decrypted and therefore the boot process was stuck. Finally I could decrypt the partition with cryptsetup luksOpen /dev/nvme... vgubuntu-root and vgchange -ay, then exit. Then the system startet again in the end. But now I am afraid that this will happen everytime when I reboot. So I looked for the /etc/crypttab in my encrypted partition (because I guess this will be written to the initram img with an update command, but I do not have that file at all. So, what should I do about it?

Best regards Martin

Update: Here comes a screenshot from lsblk as I read in other posts that this is needed.

enter image description here

But I do not know how to read this.

2nd update: According to muru's wish I also post the output of lsblk as code:

    lsblk -fs
NAME                       FSTYPE      FSVER    LABEL UUID                                   FSAVAIL FSUSE% MOUNTPOINTS
loop0                      squashfs    4.0                                                         0   100% /snap/bare/5
loop1                      squashfs    4.0                                                         0   100% /snap/core20/1587
loop2                      squashfs    4.0                                                         0   100% /snap/firefox/1635
loop3                      squashfs    4.0                                                         0   100% /snap/gnome-3-38-2004/112
loop4                      squashfs    4.0                                                         0   100% /snap/gtk-common-themes/1535
loop5                      squashfs    4.0                                                         0   100% /snap/snap-store/582
loop6                      squashfs    4.0                                                         0   100% /snap/snapd/16292
loop7                      squashfs    4.0                                                         0   100% /snap/snapd-desktop-integration/14
loop8                      squashfs    4.0                                                         0   100% /snap/firefox/1794
loop9                      squashfs    4.0                                                         0   100% /snap/core20/1611
loop10                     squashfs    4.0                                                         0   100% /snap/gnome-3-38-2004/115
vgubuntu-root              ext4        1.0            23f3470f-32eb-4b80-96b3-7e496645d6dd    303,2G    62% /
└─[somethingsecret] LVM2_member LVM2 001       dsiUpt-V1Cr-zeFL-1Wr5-c3M3-sQFe-1m4qc4                
  └─nvme0n1p3              crypto_LUKS 2              442a6034-4d06-4677-a20b-5ac60c6351e0                  
    └─nvme0n1                                                                                               
vgubuntu-swap_1            swap        1              9b0a8f42-1497-4090-bf66-7894c8ac3d55                  [SWAP]
└─[somethingsecret] LVM2_member LVM2 001       dsiUpt-V1Cr-zeFL-1Wr5-c3M3-sQFe-1m4qc4                
  └─nvme0n1p3              crypto_LUKS 2              442a6034-4d06-4677-a20b-5ac60c6351e0                  
    └─nvme0n1                                                                                               
nvme0n1p1                  vfat        FAT32          B1F9-75B1                               488,5M     4% /boot/efi
└─nvme0n1                                                                                                   
nvme0n1p2                  ext4        1.0            4e4b5e86-b8f8-4d51-9e04-99d5d538bea1    345,8M    44% /boot
└─nvme0n1                                  
MDoe
  • 115
  • @Tejas Lotlikar: Thanks for the improvements. – MDoe Sep 05 '22 at 17:50
  • Please post the output of lsblk as text instead of as an image, and use code formatting: https://askubuntu.com/editing-help#code – muru Sep 06 '22 at 06:57
  • Hi @muru. I will do that. Update: Done. – MDoe Sep 06 '22 at 07:04
  • I also saw this (https://askubuntu.com/questions/1256247/ubuntu-20-04-kernel-upgrade-encrypted-volume-group-cannot-be-found-crypttab), but I do not know how to use this in my case. – MDoe Sep 06 '22 at 13:04
  • @muru Could you be so kind and give me some further advice? – MDoe Sep 07 '22 at 10:51

1 Answers1

3

A friend could help me. What was important was the name that I assigned to the encrypted partition during the bootup in initramfs.

There I wrote

cryptsetup luksOpen /dev/nvme0n1p3 test_crypt

This last word (test_crypt) was arbitrary, but important later. Well, then I entered

vgchange -ay
exit

and the system booted. But I already mentioned that in the first place. Now, my friend told me that I could not give a new or actually the old name to my encrypted partition in /etc/crypttab, but instead I had to use the name I gave the partition during the boot process. So now the file reads like this:

test_crypt UUID=[the UUID] none luks

I left the fstab that way that I previously had and then I updated initramfs again. And this time it worked and I was prompted for a password at the next boot process again.

@muru: Thanks for your support and good luck to everyone who encounters this or a similar problem. :)

MDoe
  • 115