I have an encrypted swap and encrypted volume stored in a container file. Things were fine in 11.4 (64-bit), but after upgrading to 12.1 only the encrypted swap works.
This is my /etc/crypttab:
cswap /dev/disk/by-id/ata-WDC_WD3000HLFS-01G6U0_WD-WXLX08104386-part1 /dev/urandom swap
#csvn /srv/svn.cr none luks
and the relevant portion of /etc/fstab:
/dev/mapper/cswap swap swap defaults 0 0
#/dev/mapper/csvn /srv/svn ext3 acl,user_xattr,nofail 0 0
With the 2nd lines commented out, things are fine, and the swap seems to be working as evidenced by typing free -m.
svn.cr did not get corrupted either as it was working fine before the upgrade, and also now I can still mount it manually:
losetup /dev/loop0 /srv/svn.cr
cryptsetup luksOpen /dev/loop0 csvn [asks for password here]
mount /dev/mapper/csvn /srv/svn
However, the automatic mount with crypttab and fstab for this volume doesn’t work. If I uncomment the commented lines in fstab/crypttab, after the boot reaches the point where it should be asking me to type in the password for the volume, there is a horrible 60 second wait, and afterwards /var/log/messages contains the following:
Nov 17 18:52:40 fatt kernel: 95.164493] systemd[1]: Job srv-svn.cr.device/start timed out.
Nov 17 18:52:40 fatt kernel: 95.189630] systemd[1]: Job cryptsetup.target/start failed with result ‘dependency’.
Nov 17 18:52:40 fatt kernel: 95.215291] systemd[1]: Job srv-svn.mount/start failed with result ‘dependency’.
Nov 17 18:52:40 fatt kernel: 95.228349] systemd[1]: Job dev-mapper-csvn.device/start failed with result ‘dependency’.
Nov 17 18:52:40 fatt kernel: 95.241511] systemd[1]: Job cryptsetup@csvn.service/start failed with result ‘dependency’.
Nov 17 18:52:40 fatt kernel: 95.254792] systemd[1]: Job srv-svn.cr.device/start failed with result ‘timeout’.
Nov 17 18:52:40 fatt kernel: 95.596147] systemd[1]: Job dev-mapper-cswap.device/start timed out.
Nov 17 18:52:40 fatt kernel: 95.623273] systemd[1]: Job cryptsetup@cswap.service/start failed with result ‘dependency’.
Nov 17 18:52:40 fatt kernel: 95.650315] systemd[1]: Job dev-mapper-cswap.swap/start failed with result ‘dependency’.
Nov 17 18:52:40 fatt kernel: 95.663900] systemd[1]: Job dev-mapper-cswap.device/start failed with result ‘timeout’.
Strangely enough it’s showing errors for both the file-cointained volume and the swap file, even though the encrypted swap gets mounted fine when it’s the only one of the two being mounted.
Afterwards, the swap does succeed anyway:
Nov 17 18:52:40 fatt kernel: 98.787861] systemd-cryptsetup[902]: Set cipher aes, mode cbc-essiv:sha256, key size 256 bits for device /dev/disk/by-id/ata-WDC_WD3000HLFS-01G6U0_WD-WXLX08104386-part1.
I would guess systemd is either having some problem with the interactive password prompt or with using a file container. Those are the only apparent differences from the encrypted swap which works.
How do I fix this?
Additionally, I see some other errors in the startup messages, but I don’t know if they matter (the first one is near the beginning of the log, and the other one after the encrypted swap gets mounted successfully):
modprobe: FATAL: Error inserting padlock_sha (/lib/modules/3.1.0-1.2-default/kernel/drivers/crypto/padlock-sha.ko): No such device
…
Nov 17 18:52:40 fatt kernel: 98.867181] padlock_sha: VIA PadLock Hash Engine not detected.
By the way, in order to avoid another thread: the other thing that the upgrade broke is that apache2 stopped working. I found the most unusual cause: in /etc/sysconfig/apache2 the line APACHE_MODULES=" … " had a newline in the middle of the list of modules, and so modules weren’t loading. How the hell did the upgrade do that?