You are not logged in.

#1 2010-04-03 13:00:13

chpln
Member
From: Australia
Registered: 2009-09-17
Posts: 361

[SOLVED] Kernel panic immediately after resume due to USB storage

I've spent the last day or so configuring lvm over luks on my notebook and in general it seems to be going OK.  However, one issue remains.

I've found that if I use password authentication for LUKS when I first boot, and then use keyfile to authenticate (via USB flash drive) after hibernating (or vise-versa), a kernel panic will always be triggered as soon as the image has finished being read from disk.  As far as I can tell the key slot used to decrypt the partition is not relevant as I can define a new password and alternate between the two passwords without issue.  The kernel panic seems to be triggered only when I alternate between using a password and keyfile for authentication.

Now, for my setup:
The keyfile is located between the MBR and first partition on the USB device (as per http://wiki.archlinux.org/index.php/LUK … _partition)

grub.cfg

...
linux /vmlinuz26 root=/dev/mapper/vgroup-root resume=/dev/mapper/vgroup-swap cryptdevice=/dev/sda2:vgroup cryptkey=/dev/usbkey:2048:2048 ro
...

mkinitcpio.conf

MODULES=""
BINARIES=""
FILES="/etc/udev/rules.d/08-usbkey.rules"
HOOKS="base udev pata scsi sata usbinput keymap usb encrypt lvm2 filesystems resume"

08-usbkey.rules

KERNEL=="sd?", ATTRS{idVendor}=="<vendor id>", ATTRS{idProduct}=="<product id>", SYMLINK+="usbkey"
$ uname -r
2.6.33-ARCH

I have no idea why this is causing a kernel panic.  How should I go about solving this?

Last edited by chpln (2010-04-06 14:25:57)

Offline

#2 2010-04-04 01:15:30

chpln
Member
From: Australia
Registered: 2009-09-17
Posts: 361

Re: [SOLVED] Kernel panic immediately after resume due to USB storage

I've played around with this some more and found LUKS is quiet possibly not involved and that I've just not noticed the problem before.

The kernel panic arises when the system initially booted with a USB storage device and it is then removed before trying to resume or vise-versa.  It doesn't seem to matter the type or quantity of USB storage devices present, as long as at least one is.  Interestingly, adding / removing other types of USB devices doesn't seem to cause any problems; only storage devices.

I'm now thinking it be caused by a different set modules being loaded when resuming.  However, I've tried adding usb-storage, scsi-mod, etc. to the MODULES list in mkinitcpio.conf without luck.  Are there any other modules loaded when a USB device is present that I should be aware of?

So, I'm once again stuck.  Is anyone able to reproduce this problem?  Could the issue be related to loaded modules, or should I be looking elsewhere?

Offline

#3 2010-04-06 14:33:00

chpln
Member
From: Australia
Registered: 2009-09-17
Posts: 361

Re: [SOLVED] Kernel panic immediately after resume due to USB storage

After a whole lot of trial and error adding the following to the kernel boot options resolves the issue for me.

acpi_sleep=s4_nohwsig

Offline

Board footer

Powered by FluxBB