You are not logged in.

#1 2017-07-03 08:56:58

daankata
Member
Registered: 2017-05-21
Posts: 47

Failed to start Cryptography Setup for cryptswap

Hello!
I have created 4 LVM's, including a LVM swap volume. After installation I added the swap volume in the "/etc/crypttab". But when I restart, it asks me for a password to unlock the whole disk, and then it says "Please enter passphrase for disk volgroup0-lv_swap (cryptswap)!" I enter the "/dev/urandom" password but then it says:

[FAILED] Failed to start Cryptography Setup for cryptswap.
See 'systemctl status systemd-cryptsetup@cryptswap.service' for details.
[DEPEND] Dependency failed for dev-mapper-cryptswap.device
[DEPEND] Dependency failed fir Encrypted Volumes.
[   OK   ] Reached target System Initialization
# More "OK" stuff

My "/etc/fstab"

/etc/fstab

<file system>                                          <dir>           <type>      <options>       <dump> <pass>
UUID=b0eebbe30-329b-4cad-a4a0-1f75aedeecda              none           swap          defaults           0 0

And my "/etc/crypttab"

/etc/crypttab

<name>              <device>                                         <password>              <options>
cryptswap           UUID=b0eebbe30-329b-4cad-a4a0-1f75aedeecda       /dev/urandom            swap,offset=2048,cipher=aes-xts-plain64,size=512,hash=sha512 

After the failed stuff, warnings and errors and do get to login. I login in the root account and type "'systemctl status systemd-cryptsetup@cryptswap.service" to see for details as it says but it says

# systemctl status systemd-cryptsetup@cryptswap.service
Unit systemctl status systemd-cryptsetup@cryptswap.service.service could not be found.

Also afte I type "free -m" I do have available swap space. Why are the "failed" and "depend" errors and warnings are showing?

Thank you very much! smile

Offline

#2 2017-07-28 13:51:18

jwhendy
Member
Registered: 2010-04-01
Posts: 621

Re: Failed to start Cryptography Setup for cryptswap

I thought this was related to a problem I had. I don't think it is anymore, and I don't use crypt swap, but upon taking a look I think something is awry. /etc/crypttab would point to the raw device UUID, but /etc/fstab would point to the unlocked /dev/mapper/cryptswap device that will get created upon unlocking with your passphrase. Again, this isn't swap, but check out how I'm doing this with my root device:

$ sudo blkid

### here's the hardware device:
/dev/sda2: UUID="0712af67-3f01-4dde-9d45-194df9d29d14" TYPE="crypto_LUKS" PARTUUID="f77fbe65-02"

### and here it is unlocked in /dev/mapper:
/dev/mapper/luks-0712af67-3f01-4dde-9d45-194df9d29d14: UUID="80262d8f-fc26-45a7-ad8d-1a5bad414250" UUID_SUB="fbd1fe45-760b-4c6e-a17f-74b8cd60edb6" TYPE="btrfs"

Also, look at how things are laid out for syslinux (my bootloader):

$ cat /boot/syslinux/syslinux.cfgs

### bunch of stuff removed
APPEND luks.uuid=0712af67-3f01-4dde-9d45-194df9d29d14 root=UUID=80262d8f-fc26-45a7-ad8d-1a5bad414250

So I'm telling syslinux that the luks device is 0712xxx (matches the raw hardware device above) but that root will be 8026 (which is what will show up in /dev/mapper/xxxx after the password input).

Does that help a little? I'd try commenting out the entry in both crypptab and fstab. Then try:
- manually unlock your swap partition with 'cryptsetup luksOpen' (search the wiki if you don't know how)
- use the blkid command to get the UUID for the /dev/mapper/cryptswap device
- replace that UUID in /etc/fstab
- uncomment both crypttab and fstab and try rebooting

Offline

Board footer

Powered by FluxBB