You are not logged in.
I've notice a few other people complaining about crypttab problems when crypttab wasn't the issue, but I'm nearly certain crypttab IS part of the problem in my case.
I have a home partition inside a logical volume inside a plain dm-crypt'ed hard drive. I already had success with setting up an encrypted root parition with encrypted key, but for some reason, the home partition is the only thing giving me trouble.
Late into the boot, after the root partition is correctly mounted and crypttab has been read, the boot stops because it can't find the logical volume for my home partition in /etc/fstab. I dropped into the repair shell and checked to see if the LV did not, in fact exist, and it didn't. I ran
vgchange -a yand the VG on the encrypted home disk was not even recognized.
I went on to run
cryptsetup remove homeand then
cryptsetup create ...with identical parameters (see below) to those given in crypttab options, followed by another
vgchange -a yat which point the VG was recognized. This, at least to me, seems to indicate that the cryptsetup operation at boot is the problem, not anything in fstab nor the LVM configuration/metadata. I did some digging and found that the specific program called to set up the crypttab entry was not cryptsetup, but /usr/lib/systemd/systemd-cryptsetup. Is there a bug here?
Here is my crypttab:
home /dev/sdb /etc/keys/home.key cipher=aes-cbc-essiv:sha256,size=256,hash=ripemd160,plainThis fails to properly decrypt the disk, so something is going wrong, and I'm left assuming it's an issue with my syntax above. Using the same parameters in a normal cryptsetup line, like so:
cryptsetup create --key-file=/etc/keys/home.key -s 256 --cipher=aes-cbc-essiv:sha256 --hash=ripemd160 home /dev/sdbcorrectly decrypts the disk and allows the logical volumes to be recognized. So what am I missing? Help is much appreciated.
Last edited by Phalanx (2012-10-30 04:18:50)
Offline
This seems like it would be relevant:
Offline
Indeed it is. I realized that the --hash parameter in my cryptsetup line is unecessary. The man page clarifies that if the keyfile is specified using --key-file=/my/keyfile.key, a hash is not applied to the key, unlike if it were read from stdin (such as with "cat mykey | cryptsetup ..." or "cryptsetup --key-file=-"
Thus the cryptsetup line I gave above with --hash=ripemd160 is equivalent to:
cryptsetup create --key-file=/etc/keys/home.key -s 256 --cipher=aes-cbc-essiv:sha256 --hash=plain home /dev/sdbUnfortunately, systemd-cryptsetup complains that "plain" is an "invalid argument" for hash, even though crypttab's man page says: "see cryptsetup(8) for possible values" for hash, and the cryptsetup man page says "If 'plain' is used as argument to --hash, ...", implying it is a valid argument.
If I try to use systemd-cryptsetup just leaving the hash parameter empty, it appears that it just uses the default of ripemd160.
So, it looks like I have no way, with my current systemd-cryptsetup, to actually correctly decrypt this drive. I suppose I could just modify rc.sysinit for the time being. I mean, thank god I'm still using initscripts, because it looks like I'd be screwed if I was using pure systemd.
Offline
So what is the reason behind systemd reimplementing cryptsetup's functionality using libcryptsetup? Why not just call cryptsetup directly?
Offline