[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

What is the correct way to set encrypted swap with systemd?



Greetings,

TL;DR - See Subject. :-)

I have been testing Debian Jessie on my spare test laptop and with it
being a test box and all, I tested something that didn't go the way I
wanted it to and broke a lot of stuff. :-) I wiped my test laptop and
reinstalled. Now I have the exact same problem as before and to make
matters worse, I have gone through _all_ my notes and I can't replicate
the fix now.

Remember back a few months ago when systemd wouldn't stop fsck'ing my
swap partition?
https://www.mail-archive.com/debian-user@lists.debian.org/msg680287.html

Yup. Systemd is ignoring me again and fscks on every boot. I have done
everything I can think of and I am back to not being able to stop
systemd from fsck'ing *every* time. I have done everything in that
thread plus all of the notes I took and didn't post. I can't get it to stop.

If I have to go through this pain on every new install going forward, it
is going to really suck. So, maybe I am approaching this wrong? Maybe
there is a new systemd-encrypt-swap service I am supposed to use? Is
there a systemd-luks or something?


I know it has to do with encrypted swap partitions. I proved that last
time and I can prove it this time too. The method I have been using for
a _very_ long time and has _always_ worked pre-systemd is this:
$ grep swap /etc/crypttab
sda3_crypt UUID=ef2496cd-ca4d-43aa-8c90-dba084029f6e /dev/urandom
cipher=aes-xts-plain64,size=256,swap

$ grep swap /etc/fstab
/dev/mapper/sda3_crypt none            swap sw             0       0

Although, I did ensure I was using the path and not UUID as systemd had
issues with that last time.

So what happens? Well systemd has at least improved to the point of
actually putting something in journalctl! Hooray! I am very pleased to
see there has been good forward progress on this front.

$ journalctl
[snip]
Mar 27 17:05:41 Senta kernel: Kernel command line:
BOOT_IMAGE=/vmlinuz-3.19.0-10-generic
root=UUID=1fc1e143-2347-4d86-928e-f29d154891fb ro quiet splash
fsck.mode=skip vt.handoff=7
[snip]
Mar 27 17:07:10 Senta systemd[1]: Job
dev-disk-by\x2duuid-ef2496cd\x2dca4d\x2d43aa\x2d8c90\x2ddba084029f6e.device/start
timed out.
Mar 27 17:07:10 Senta systemd[1]: Timed out waiting for device
dev-disk-by\x2duuid-ef2496cd\x2dca4d\x2d43aa\x2d8c90\x2ddba084029f6e.device.
Mar 27 17:07:10 Senta systemd[1]: Dependency failed for Cryptography
Setup for sda3_crypt.
Mar 27 17:07:10 Senta systemd[1]: Dependency failed for Encrypted Volumes.
Mar 27 17:07:10 Senta systemd[1]: Job cryptsetup.target/start failed
with result 'dependency'.
Mar 27 17:07:10 Senta systemd[1]: Dependency failed for
dev-mapper-sda3_crypt.device.
Mar 27 17:07:10 Senta systemd[1]: Job dev-mapper-sda3_crypt.device/start
failed with result 'dependency'.
Mar 27 17:07:10 Senta systemd[1]: Job
systemd-cryptsetup@sda3_crypt.service/start failed with result 'dependency'.
Mar 27 17:07:10 Senta systemd[1]: Job
dev-disk-by\x2duuid-ef2496cd\x2dca4d\x2d43aa\x2d8c90\x2ddba084029f6e.device/start
failed with result 'timeout'.


How nice of it to record and ignore my fsck.mode=skip (and every other
place I told it to stop doing a fsck)...Also, swap is not enabled at
this time. I have to manually start it.

It clearly doesn't like my encrypted swap and it is clearly ignoring me
telling it to not fsck. Thus, how should I change my encryption to work
with systemd?

I have searched for this topic and I have not found anything that
directly relates. I found an article from early last year saying to do
what I already did but I haven't found anything in the last 6 months
that has helped.

Any thoughts or suggestions on this problem?

Thanks!
~Stack~

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: