You are not logged in.
I am following this guide to load dvorak as my keyboard layout at early boot, so I can use my dvorak to enter the password to decrypt my drive. My early-grub.cfg looks like this:
set root=(memdisk)
set prefix=($root)/
terminal_input at_keyboard
keymap /dvorak.gkb
cryptomount -u 74a667d5-8d13-4ef9-bf54-c1541d137946
set root='lvmid/udGQS-Ls5p-544Q-afig-v5GO-h3fk-X88YYd/pdzUUH-Y24U-JZ9k-rNGp-T94z-xE2e-J4eHK9'
set prefix=($root)/grub
configfile grub.cfgMy command for compiling my core image looks like this:
grub-mkimage -c early-grub.cfg -o grubx64.efi -O x86_64-efi -m memdisk.tar part_gpt cryptodisk luks gcry_rijndael gcry_sha256 lvm ext2 memdisk tar at_keyboard keylayouts configfilememdisk.tar contains dvorak.gkb which was converted from the X11 format by grub-kbdcomp.
On boot I'm given the normal decryption prompt, and the keymap is loaded correctly, I input my password, it successfully decrypts my drive, and then I get put into a grub shell. According to this that probably means early-grub.cfg isn't calling grub.cfg correctly, but I've tried reformatting it and editing it to work properly, with no luck.
Last edited by PurpleAce (2026-03-28 17:40:46)
"The worst argument is an argument of authority, according to Aristotle"-St. Thomas Aquinas
Offline
cryptomount -u 74a667d5-8d13-4ef9-bf54-c1541d137946 set root='lvmid/udGQS-Ls5p-544Q-afig-v5GO-h3fk-X88YYd/pdzUUH-Y24U-JZ9k-rNGp-T94z-xE2e-J4eHK9'
Is this a "LUKS on LVM" or "LVM on LUKS" scenario? And if yes - do those command match those in your grub.cfg?
Offline
In the Grub shell, what does 'ls' show? Do you see your drives and files? Can you load your grub.cfg manually?
You could also try debugging... it's a ton of output but sometimes it helps understand what Grub is doing and where things go wrong.
set debug=all
set pager=1A completely different approach would be to add the same passphrase twice... change your keyboard layout while you cryptsetup luksAddKey, so LUKS accepts the same key sequence in both Dvorak and US layouts. Then you don't even need a custom config. It would take longer to unlock if it tries the wrong keyslot first, though.
That or find a passphrase that works for either layout anyway. Of course it's harder than just avoiding Y/Z for qwerty/qwertz layouts. Digits, A, M, what else is there?
Last edited by frostschutz (2026-03-26 10:23:10)
Offline
Is this a "LUKS on LVM" or "LVM on LUKS" scenario? And if yes - do those command match those in your grub.cfg?
LVM on LUKS, I have root and swap on the same encrypted /dev/sda2. They do match, I copied them directly from my grub.cfg.
"The worst argument is an argument of authority, according to Aristotle"-St. Thomas Aquinas
Offline
In the Grub shell, what does 'ls' show? Do you see your drives and files?
Yes, I have memdisk, both my logical volumes, both my partitions, crypto0 and proc.
Can you load your grub.cfg manually?
Yes, but nothing happens? When I run boot it still tells me I need to load the kernel first, but the kernel should be loaded in grub.cfg, correct?
Trying to load the kernel manually it always fails to find the linux command. Granted I don't know a lot about kernel loading so I may be doing it wrong. My guess is then that both grub.cfg and early-grub.cfg must be setting root at the wrong location?
A completely different approach would be to add the same passphrase twice...
I mean yeah, I could just change the password, but having a properly loaded layout is handy when things like this happen and I have to work in a grub terminal.
"The worst argument is an argument of authority, according to Aristotle"-St. Thomas Aquinas
Offline
Do you have menuentries in grub.cfg? If you add echo blah blah blah in your grub.cfg (and another string in early cfg), does it get echoed?
Does anything change if you use 'normal' instead of 'configfile grub.cfg'? (Normal mode should load it automagically)
Otherwise try the debugging if you see anything obviously wrong. Not sure what it could be; maybe someone else can chip in.
Offline
Yes, I haven't tampered with my grub.cfg at all, it has the menuentries, and it was working fine before I started all this. The echo in early-grub.cfg was called(I actually forgot to load echo so it returned "can't find command 'echo'), but the one in grub.cfg wasn't.
Normal instead of configfile still fails to boot. I get a lot of messages saying:
Read out of range: sector 0x0 (attempt to read or write outside of disk 'proc'I don't know if that has anything to do with it. Otherwise it appears to be running something at least? It's accessing my root partition properly, and I don't see any errors, it just doesn't boot or load the kernel.
Is it possible to decompile grubx64.efi? I think looking at the early-grub.cfg generated by grub-install might help.
"The worst argument is an argument of authority, according to Aristotle"-St. Thomas Aquinas
Offline
grub-install puts a copy of its early as "load.cfg" in /boot/grub/........
perhaps something about setting root and prefix is wrong, what happens if you set prefix only?
but, it shouldn't be wrong
as for decompiling, no idea but if you just want to look at the config embedded, its in there as plain text, just use 'strings file.efi | grep -C 20 cryptomount' or something like that
Offline
grub-install's load.cfc just has "cryptomount -u 74a667d5-8d13-4ef9-bf54-c1541d137946" I tried removing everything after that from mine, still didn't boot.
Setting my prefix only would set it as memdisk/grub. I don't think I even need to try it to assume that it won't work, considering memdisk only contains dvorak.gkb.
"The worst argument is an argument of authority, according to Aristotle"-St. Thomas Aquinas
Offline
You could try a more analytical approach.
Dropped to the GRUB shell, try
lsThis should list all available devices/partitions. Then do
ls (hd0,msdos2)with every found partition ("(hd0,msdos2)" just as an example). GRUB should say if it's able to determine the file system. And finally do
ls (hd0,msdos2)/to test the file system contents.
Offline
The device with the filesystem I want is (lvm/strongbox-root) strongbox being the name of my LUKS container.
ls (lvm/strongbox-root)/ shows me my root filesystem as expected. Running
ls (lvm/strongbox-root)/boot/grub/confirms that my grub.cfg is in the right place.
Otherwise, (hd0,gpt1) and (hd0,gpt2) are unknown filesystems.
"The worst argument is an argument of authority, according to Aristotle"-St. Thomas Aquinas
Offline
And that's my solution! Using
set root='(lvm/strongbox-root)'
set prefix=($root)/boot/grub
normalboots successfully.
Marking as solved
Last edited by PurpleAce (2026-03-28 17:40:21)
"The worst argument is an argument of authority, according to Aristotle"-St. Thomas Aquinas
Offline