Skip to content

Instantly share code, notes, and snippets.

@loukamb
Created May 28, 2025 23:04
Show Gist options
  • Save loukamb/0a1d247a551d5f3a6bee63ab776b440d to your computer and use it in GitHub Desktop.
Save loukamb/0a1d247a551d5f3a6bee63ab776b440d to your computer and use it in GitHub Desktop.
Debian 13 (Trixie) cryptsetup at boot fix

Debian 13 (Trixie) cryptsetup at boot fix

I'm unsure when this problem started, but installing cryptsetup and cryptsetup-initramfs, adding your partitions to /etc/crypttab, then updating the initramfs with update-initramfs does not work right away. You will reboot and wait 1 minute and 30 second as systemd fails to mount the partition.

I pulled my hair trying to fix this until I extracted the initramfs contents and figured out that Debian's distribution of cryptsetup doesn't read from /etc/crypttab but rather from cryptoroot/crypttab.

You could theoretically make this folder and file, but I suggest writing this tiny script to /etc/initramfs-tools/hooks/make-crypttab, which will entirely solve this problem and for good:

#!/bin/sh
cp /etc/crypttab "${DESTDIR}/cryptroot/crypttab"
exit 0

Don't forget to sudo chmod +x /etc/initramfs-tools/hooks/make-crypttab afterwards to make it executable. Rebuild your initramfs with update-initramfs and you're good to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment