#1100602 cryptsetup: Show some hints in addition to the "cryptsetup failed, bad password or options" error.

Package:
cryptsetup
Source:
cryptsetup
Description:
disk encryption support - startup scripts
Submitter:
Dmitrii Semenov
Date:
2025-03-15 21:45:04 UTC
Severity:
normal
#1100602#5
Date:
2025-03-15 21:39:02 UTC
From:
To:
Dear Maintainer,

I installed Debian stable from the netinst USB image yesterday, making
some partitions encrypted during the installation. All was good until
today's kernel update, after which my passphrase stopped working.

It turned out that the issue was caused by incorrectly modified
/etc/default/keyboard file, which propagated into the initrd image of the new
kernel version. Apparently, some configuration tool or script made that change
soon after the initial installation of the system. (I did not edit that file
manually, and I could not figure out what package to blame for the unexpected
change, but I suspect it was a part of GNOME installation or configuration.)

Somehow the settings went from this in the initial initrd image:

XKBMODEL="pc105"
XKBLAYOUT="us,ru"
XKBVARIANT=","
XKBOPTIONS="grp:caps_toggle,grp_led:scroll"
BACKSPACE="guess"

to this on my system, and in the new initrd image:

XKBLAYOUT=ru,us
XKBVARIANT=,
BACKSPACE=guess

Apparently, the non-us keyboard layout was used at the cryptsetup password
prompt after that, and even though I suspected it, my attempt to change
the layout by pressing Caps Lock did not work, so I had to select the previous
kernel version in GRUB to successfully boot the system.


Although cryptsetup had nothing to do with the above, it would be good to
show these hints from cryptsetup FAQ to unsuspecting users if they have
troubles entering their passphrase:

  First, make sure you have a correct passphrase.  Then make sure you have
  the correct key-map and correct keyboard.  And then make sure you have
  the correct character set and encoding.

followed by the contents of /etc/default/keyboard,

preferably accompanied with a question if a user wants to see what they enter.

Thanks!