mevdschee / bitlocker-luks-tools

30 stars 2 forks source link

Debian 11: `mount` fails with error "device does not exist." #2

Closed mevdschee closed 2 years ago

mevdschee commented 2 years ago

@Rodgers13 I had this issue too, on Debian 11. mount was failing for the partition containing the key file, with an error message of "device does not exist."

I found this unlock-root.sh script. Instead of adding a filesystem and mounting it on boot, the keyfile is written directly to the first partition. The script just uses dd to read in the raw disk content.

Also, a big thank you to mevdschee for this repo and the very well-written blog post, I found it to be very helpful 🥇


# find your USB stick in /dev/disk/by-id/usb-*
export $KEY=/dev/disk/by-id/usb-THE-DEVICE-YOU-WANT-TO-USE-part1

# write the keyfile contents to the first partition
dd if=keyfile-you-created.lek of=$KEY bs=1 count=256

# use the script above, fill out $KEY and set $LEN=256

Originally posted by @mheppner in https://github.com/mevdschee/bitlocker-luks-tools/issues/1#issuecomment-1213190799

mevdschee commented 2 years ago

Debian 11 might NOT work out of the box..

image

mevdschee commented 2 years ago

@mheppner For Debian 11 the solution is to add to /etc/initramfs-tools/modules the lines:

vfat
nls_cp437
nls_ascii

Before running the update-initramfs -u command.

mevdschee commented 2 years ago

This is what you see when the USB key was not inserted and boot and insert the USB key (without pressing enter):

image

Pressing enter will boot the system (when the USB key is inserted). Typing the passphrase is also still allowed.

mevdschee commented 2 years ago

I've updated the blog post here: https://tqdev.com/2022-luks-with-usb-unlock