You are not logged in.

#1 2013-05-29 15:39:59

martinc2
Member
Registered: 2011-09-23
Posts: 60

[SOLVED] LVM2 on LUKS (3.9.4): USB stick keyfile not accessed

Hi,

EDIT: This is highly unlikely to affect you unless you do silly things with mkinitcpio: If you do, read on.

I waited a long time to upgrade from kernel 3.5.6 (because of power issues with later kernels). 3.9.4 is working fine for me in a LVM2 on LUKS setup, except that it doesn't want to access my USB keyfile before timeout (in other words the machine waits for 10 seconds and then asks for my passphrase, even when the USB key is inserted).  With 3.5.6 the USB keyfile was accessed fine.  After reading the LUKS wiki pages I changed my mkinitcpio.conf to have

MODULES="ata_generic ata_piix nls_cp437 vfat i915"
# worked with 3.5.6: MODULES="nls_cp437 vfat i915"

and

HOOKS="base udev oldsata encrypt lvm2 resume autodetect filesystems fsck shutdown"

("oldsata" is the old "sata", pre-"block" hook, which works fine and which I use because I have a stupidly small boot partition sad )

my kernel boot line (GRUB-legacy) includes

... cryptdevice=/dev/sda4:lvm cryptkey=/dev/disk/by-label/MARTINC:vfat:/<filename> resume=/dev/mapper/LVM-SWAP ... root=/dev/mapper/LVM-ROOT64 ro ...

Any ideas why the USB stick isn't being accessed?  (I assume it's most likely to be a missing module, but I don't know how to debug this.)

Thanks,

--MC

Last edited by martinc2 (2013-05-31 13:25:51)

Offline

#2 2013-05-30 17:47:45

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: [SOLVED] LVM2 on LUKS (3.9.4): USB stick keyfile not accessed

In https://bbs.archlinux.org/viewtopic.php?id=164267
there is a similar issue of today, but with a UUID naming instead of a label. Maybe you want to try the workaround described there with an udev-rule. If you re-typed the kernel line, please double-check it (asking that because you have lvm and LVM in there).

What's the problem with the "block" hook for you regarding the partition size?
The initramfs does not fit with the block hook? I'm asking that too, because the "block" hook includes the old "usb" one.

Is the usb-stick there at "/dev/disk/by-label/MARTINC" after boot?

Offline

#3 2013-05-30 18:35:50

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [SOLVED] LVM2 on LUKS (3.9.4): USB stick keyfile not accessed

Strike0 wrote:

Is the usb-stick there at "/dev/disk/by-label/MARTINC" after boot?

After boot isn't at all interesting. What the rescue shell see is much more so.

edit: and as I suspected, I can't reproduce any of this.

Last edited by falconindy (2013-05-30 18:38:49)

Offline

#4 2013-05-31 13:30:12

martinc2
Member
Registered: 2011-09-23
Posts: 60

Re: [SOLVED] LVM2 on LUKS (3.9.4): USB stick keyfile not accessed

@Strike0, thanks for pointing me in the right direction: The solution turned out to be to add an "oldusb" hook alongside "oldsata". (Yes, the problem is that my /boot partition isn't big enough to hold the initramfs images if I use the "block" hook. My stupid, but hard to fix!)

@falconindy, thanks for checking this out.  I guess if I retrofit obsolete hooks I can expect to be on my own smile

Offline

#5 2013-05-31 18:56:47

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: [SOLVED] LVM2 on LUKS (3.9.4): USB stick keyfile not accessed

Unfortunate with the partition size and a hazzle to fix, yes. I can't remember how much space grub-legacy needs, but the subdirs in the grub2 default install (which have locales and .mods that you don't need all) add up to roughly the initramfs size here (~4MB). But somehow I'm sure you have tried to squeeze those bits already. Or check out syslinuxm, perhaps installing it to that usb-stick to try .. always good to have a fallback.

Anyway, great you managed to fix it to roll on.

Offline

#6 2013-05-31 21:40:46

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] LVM2 on LUKS (3.9.4): USB stick keyfile not accessed

Speaking of "fallback", are you building both the regular initramfs and the fallback?  If so, do you ever actuall use the fallback initramfs?  The fallback initramfs on my system currently takes up some 19MB of space.... so if you don't need it, then you could probably stop making it to avoid having to shift things around right away.

Offline

Board footer

Powered by FluxBB