LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-16-2020, 03:22 AM   #1
denydias
Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 298

Rep: Reputation: Disabled
Question Hard time trying to setup LUKS/LVM boot with key file from MMC/SD


Hi there!

I'm having quite a hard time trying to boot into a LUKS/LVM partition using a key file stored at MMC/SD card. It looks I have everything properly setup, but all I see is the passphrase prompt. I'm obviously missing something and came here to look for some help.

This is how I've set it up for now:

Code:
$ blkid /dev/mmcblk0p1
/dev/mmcblk0p1: SEC_TYPE="msdos" LABEL_FATBOOT="KEYS" LABEL="KEYS" UUID="0A8F-315D" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="66fa5c9a-93"
$ dd bs=512 count=8 if=/dev/random of=/run/media/me/KEYS/key.bin iflag=fullblock
# cryptsetup -v luksAddKey /dev/sdb3 /run/media/me/KEYS/key.bin
# cryptsetup luksDump /dev/sdb3
...
Keyslots:
...
  1: luks2
        Key:        256 bits
...
# mkinitrd -c -k 5.4.83 -f ext4 -r /dev/cryptvg/root \
  -m mmc_core:mmc_block:sdhci:sdhci-pci:usb-storage:efivarfs:ext4:vfat \
  -C /dev/sdb3 -L -u -h /dev/cryptvg/swap -c -s /var/lib/initrd-tree/ \
  -L -T /dev/sdb3 -w 1 -o /boot/initrd-5.4.83.gz -K LABEL=KEYS:/key.bin
# cat /etc/default/grub | grep GRUB_CMDLINE_LINUX_DEFAULT
GRUB_CMDLINE_LINUX_DEFAULT="...luksdev=sda3 lukstrim=sda3 lukskey=LABEL=KEYS:/key.bin"
# grub-mkconfig -o /boot/grub/grub.cfg
# dmesg | grep -A 2 mmc
[    5.411269] mmc0: new high speed SDHC card at address b368
[    5.412654] mmcblk0: mmc0:b368 SDC   30.2 GiB
[    5.415381]  mmcblk0: p1
# cat /var/lib/initrd-tree/lukskey
LABEL=KEYS:/key.bin
dmesg lines above are printed just before LUKS passphrase prompt, which proves that MMC/SD reader is being detected by initrd phase. Nevertheless, the key file at KEYS:/key.bin is not being recognized, hence a passphrase prompt pops into my face.

Can someone point me out where I'm messing it up?

Last edited by denydias; 12-16-2020 at 03:24 AM.
 
Old 12-16-2020, 05:10 AM   #2
denydias
Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 298

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by denydias View Post
Can someone point me out where I'm messing it up?
You damn idiot! Where did you learn to type?

You've a typo in 'keys.bin'. It should be 'key.bin'.

Moron!

 
  


Reply

Tags
boot, grub 2, luks, slackware



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] LUKS - Is that key-slot a pass phrase or a key file? taylorkh Linux - Security 3 02-07-2017 07:47 AM
[SOLVED] Cannot see /dev/sda1 boot in LUKS - LVM setup hua Slackware 4 09-29-2012 08:30 AM
Ricoh Sd/mmc Card Reader Won't Read Mmc Cards it-s Linux - Hardware 4 07-02-2011 05:49 AM
What is the relationship between the linux mmc media driver and mmc host driver? archieval Linux - General 0 07-13-2009 12:36 AM
Accessing MMC card in Laptop built-in MMC Card Slot with knoppix bröggle Linux - Laptop and Netbook 0 08-18-2004 08:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration