From: Claudio Clemens <asturio-hi6Y0CQ0nG0@public.gmane.org>
To: "Amadeusz Żołnowski"
<aidecoe-2qtfh70TtYba5EbDDlwbIw@public.gmane.org>,
initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: cryptsetup + lvm order and crypt name
Date: Fri, 15 Aug 2014 13:11:25 +0200 [thread overview]
Message-ID: <53EDEADD.2070103@gmx.net> (raw)
In-Reply-To: <8761i3pi87.fsf-txNSArhcdoZACdk+e2mhCEEMvNT87kid@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2889 bytes --]
Am 08.08.2014 09:12, schrieb Amadeusz Żołnowski:
> First of all I advise to call dracut like that:
>
> dracut -H '' <kernel-version>
>
> it will generate host-specific initramfs for specified kernel version in
> default location. Later edit variable GRUB_CMDLINE_LINUX_DEFAULT in
> /etc/default/grub and put there parameters you want. After that
> regenerate grub2 config with grub2-mkconfig.
>
> I hope that helps. :-)
Ok... it was a while now. But I managed to boot my system. The -H flag
wasn't needed. I put the boot configuration Opts in grub, and not
dracut. Just for the documentation of it I have this setup:
In /etc/default/grub
GRUB_CMDLINE_LINUX="rd.auto rd.luks rd.luks.crypttab
rd.luks.uuid=83e0aaa5-a8ad-4435-afff-0d52b1071fc3 rd.lvm
rd.lvm.vg=boromir rd.md=0 rd.dm"
The only really needed option was rd.auto (maybe other options now
implies rd.auto). But the problem was a conflict between my
installation, Debian's dracut and Debian's cryptsetup.
When I installed my system and encrypted my /dev/sda5, I gave the
encrypted partition the name sda5_crypt. This value was written in
/etc/crypttab. So for accessing the partition at boot-time what is done
is: cryptsetup luksOpen /dev/sda5 sda5_crypt
When booting /etc/init.d/cryptdisks* looks for sda5_crypt, if it is
there, it won't do anything and boot will continue. If it is not there,
it asks for the passphrase and try to decrypt it.
The problem was that dracut, when calling "cryptsetup luksOpen" won't
use the name given in /etc/crypttab, but "luks-<UUID of the partition>".
When /etc/init.d/cryptdisk* comes in, there is no sda5_crypt present, so
it tried to decrypt the partition again, which is not possible, because
it is actually already in use.
My solution for the problem was to rename the decrypt volume in
/etc/crypttab from "sda5_crypt" to "luks-<UUID of /dev/sda5>". So I use
the same name dracut uses when calling cryptsetup and the
Debian-init-scripts finds the device.
I think the elegant solution would be in dracut, which could have a boot
option to the name of the decrypted device (or read it from
/etc/crypttab when creating the image), or the cryptdisks-init-scripts
which could see if the encrypted device is already decrypted, and not
only look if the name is present.
I hope this can help any one with a similar problem.
Thanks for the help,
Claudio
PS - I'll fill then a bug-report/wish for both Debian-Packages so they
are aware of the problem.
--
+- .''`. ---| Dipl.-Inf. Univ. Claudio Clemens |-------| wheezy |-----+
| : :' : asturio at gmx (.) net GNU/Linux User #79942 |
| `. `' http://asturio.gmxhome.de/begin.html |
| `- "YE GODS, I HAVE FEET??!" <- Userfriendly |
"I will take the ring, though I do not know the way" Frodo Baggins
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]
prev parent reply other threads:[~2014-08-15 11:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-05 22:26 cryptsetup + lvm order and crypt name Claudio A. T. Clemens
[not found] ` <53E15A01.9040604-hi6Y0CQ0nG0@public.gmane.org>
2014-08-06 7:11 ` Amadeusz Żołnowski
[not found] ` <871tsuks7j.fsf-txNSArhcdoZACdk+e2mhCEEMvNT87kid@public.gmane.org>
2014-08-07 20:47 ` Claudio Clemens
[not found] ` <8761i3pi87.fsf@freja.aidecoe.name>
[not found] ` <8761i3pi87.fsf-txNSArhcdoZACdk+e2mhCEEMvNT87kid@public.gmane.org>
2014-08-08 7:16 ` Amadeusz Żołnowski
2014-08-15 11:11 ` Claudio Clemens [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53EDEADD.2070103@gmx.net \
--to=asturio-hi6y0cq0ng0@public.gmane.org \
--cc=aidecoe-2qtfh70TtYba5EbDDlwbIw@public.gmane.org \
--cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox