[dm-crypt] Kernel panic, cannot mount root fs on unknown block (hd0, 0)
sven at whgl.uni-frankfurt.de
Fri Sep 26 00:57:44 CEST 2014
On Thu, September 25, 2014 21:25, vaskez at airmail.cc wrote:
> Thank you for your replies. Creating an initramfs image did the trick.
> The only problems as of now are that the initramfs image fails to prompt
> for the passphrase to the root partition. It will drop me into a rescue
> shell, and from there I can use cryptsetup on the command line to
> decrypt the root partition, then I must exit and it will continue
> booting as normal. I hit OpenRC from there and the rest of my partitions
> prompt for a passphrase. I created an initramfs image with dracut with
> these options:
> dracut -a "lvm dm crypt" -H --xz --strip initrd.img
> I am still using these kernel paramters:
> cryptdevice=/dev/sda3:root crypto=sha512:serpent-xts-plain:512
> root=/dev/mapper/root net.ifnames=0 quiet
> Are there other parameters that I should be using? Perhaps something
> from dracut? I do not know of kernel parameters that can be accepted by
> the kernel or where to find them, I have only used what has been shown
> from Arch Linux wiki on dm-crypt plain.
As you use dracut, please consult the dracut documentation and/or
mailinglist, as the remaining problems depend solely on that bloatware.
The parameters you use (except for root=) are NOT kernel parameters.
If I had to guess: Dracut is not as distribution agnostic as it cliams and
thus does not even try to start your crypto target.
> Also whenever I halt my system it will print 30 some lines of ioctl
> complaining about the root fs is still in use, then quit. I do not think
> this is much a problem, because it will skip it and umount the other
> filesystems, then mount root as ro and finally shutdown. Do you think
> that this is a problem? If so, how would I be able to stop it?
The gentoo openrc init scripts are quite fatal in that they try to
'shutdown' everything, including LVMs, dmcrypt targets etc. they did not
necessarily start. Tracking what was setup during boot is quite
cumbersome, when most utils provide switches to shutdown just everything
they can find.
That being said: If there's no entry for your root device in
/etc/conf.d/dmcrypt you won't get a message during start that it is
already configured, and the script will not try to close the mapping (this
is actually dracut's job). Similiar things apply to LVMs/mounts etc.
More information about the dm-crypt