With a LUKS encrypted system, when a new kernel is installed "update-initramfs -u -k $KERNEL_VERSION" is executed.
As part of that cryptsetup hooks scripts are called. They examine /etc/fstab and /etc/crypttabto determine if the root file-system, or swap (which may be used for hibernation) are encrypted.
If so cryptsetup and its supporting libraries and scripts are copied into the initrd.img-$KERNEL_VERSION file that is being built.
Additionally, the /etc/crypttab entry for the root file-system device is added to the initialramfs's /conf/conf.d/cryptroot.
At boot-time the initialramfs cryptsetup scripts read this file and should unlock the LUKS container.
As that is not happening you should, when dropped at the initialramfs shell, check for the existence of the config and the tooling:
# ls -l /conf/conf.d/cryptroot /bin/cryptroot-unlock /sbin/cryptsetup /lib/cryptsetup/askpass
If they are present you can manually unlock using:
# cryptsetup open /dev/sdXY sdXY_crypt
Note: identify the LUKS container using:
# blkid | grep crypt_LUKS
and replace my example 'sdXY' with your device name.
After a successful unlock scan for LVM volumes:
# vgchange -ay
Then let the init system resume operations by pressing Ctrl+D or typing:
# exit
If you're not in the initramfs but are looking at the broken system's file system from a LiveISO or similar you can check whether the cryptsetup tools are included in the initrd.img file using this command:
Mark:
With a LUKS encrypted system, when a new kernel is installed "update-initramfs -u -k $KERNEL_VERSION" is executed.
As part of that cryptsetup hooks scripts are called. They examine /etc/fstab and /etc/crypttabto determine if the root file-system, or swap (which may be used for hibernation) are encrypted.
If so cryptsetup and its supporting libraries and scripts are copied into the initrd. img-$KERNEL_ VERSION file that is being built.
Additionally, the /etc/crypttab entry for the root file-system device is added to the initialramfs's /conf/conf. d/cryptroot.
At boot-time the initialramfs cryptsetup scripts read this file and should unlock the LUKS container.
As that is not happening you should, when dropped at the initialramfs shell, check for the existence of the config and the tooling:
# ls -l /conf/conf. d/cryptroot /bin/cryptroot- unlock /sbin/cryptsetup /lib/cryptsetup /askpass
If they are present you can manually unlock using:
# cryptsetup open /dev/sdXY sdXY_crypt
Note: identify the LUKS container using:
# blkid | grep crypt_LUKS
and replace my example 'sdXY' with your device name.
After a successful unlock scan for LVM volumes:
# vgchange -ay
Then let the init system resume operations by pressing Ctrl+D or typing:
# exit
If you're not in the initramfs but are looking at the broken system's file system from a LiveISO or similar you can check whether the cryptsetup tools are included in the initrd.img file using this command:
# sudo ls -l /boot/initrd.img*
# sudo lsinitramfs /boot/initrd. img-$KERNEL_ VERSION | grep crypt
cryptroot-keyfiles keyfiles/ cryptswap1. key keyfiles/ LUKS_VG02. key x86_64- linux-gnu/ libcrypto. so.1.1 d/cryptroot unlock askpass 64-linux- gnu/libgcrypt. so.20.2. 1 64-linux- gnu/libcryptset up.so.12 64-linux- gnu/libgcrypt. so.20 64-linux- gnu/libcryptset up.so.12. 2.0 5.1.0-050100- lowlatency/ kernel/ crypto 5.1.0-050100- lowlatency/ kernel/ crypto/ crypto_ simd.ko 5.1.0-050100- lowlatency/ kernel/ crypto/ xor.ko 5.1.0-050100- lowlatency/ kernel/ crypto/ cryptd. ko 5.1.0-050100- lowlatency/ kernel/ crypto/ ecdh_generic. ko 5.1.0-050100- lowlatency/ kernel/ crypto/ async_tx 5.1.0-050100- lowlatency/ kernel/ crypto/ async_tx/ async_tx. ko 5.1.0-050100- lowlatency/ kernel/ crypto/ async_tx/ async_memcpy. ko 5.1.0-050100- lowlatency/ kernel/ crypto/ async_tx/ async_raid6_ recov.ko 5.1.0-050100- lowlatency/ kernel/ crypto/ async_tx/ async_pq. ko 5.1.0-050100- lowlatency/ kernel/ crypto/ async_tx/ async_xor. ko 5.1.0-050100- lowlatency/ kernel/ drivers/ md/dm-crypt. ko 5.1.0-050100- lowlatency/ kernel/ arch/x86/ crypto 5.1.0-050100- lowlatency/ kernel/ arch/x86/ crypto/ glue_helper. ko 5.1.0-050100- lowlatency/ kernel/ arch/x86/ crypto/ aes-x86_ 64.ko 5.1.0-050100- lowlatency/ kernel/ arch/x86/ crypto/ aesni-intel. ko local-bottom/ cryptopensc local-block/ cryptroot local-top/ cryptroot local-top/ cryptopensc
cryptroot-
cryptroot-
sbin/cryptsetup
usr/lib/
conf/conf.
bin/cryptroot-
lib/cryptsetup
lib/cryptsetup/
lib/x86_
lib/x86_
lib/x86_
lib/x86_
lib/modules/
lib/modules/
lib/modules/
lib/modules/
lib/modules/
lib/modules/
lib/modules/
lib/modules/
lib/modules/
lib/modules/
lib/modules/
lib/modules/
lib/modules/
lib/modules/
lib/modules/
lib/modules/
scripts/
scripts/
scripts/
scripts/