Re: [solved] What is the correct way to set encrypted swap with systemd?

2015-03-28 Thread Sven Hartge
~Stack~  wrote:

> # causes systemd to fsck swap
> #sda3_crypt UUID=ef2496cd-ca4d-43aa-8c90-dba084029f6e /dev/urandom
> cipher=aes-xts-plain64,size=256,swap
> # systemd doesn't fsck swap
> sda3_crypt /dev/sda3 /dev/urandom cipher=aes-xts-plain64,size=256,swap

Where did you get that UUID from in the first place? I have a certain
suspicion I'd like to confirm before commenting on that.

Grüße,
Sven.

-- 
Sigmentation fault. Core dumped.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/2bg9nlsjj...@mids.svenhartge.de



Re: [solved] What is the correct way to set encrypted swap with systemd?

2015-03-28 Thread ~Stack~
On 03/28/2015 08:32 AM, Sven Hartge wrote:
> ~Stack~  wrote:
> 
>> Remember back a few months ago when systemd wouldn't stop fsck'ing my
>> swap partition?
> 
> Why would systemd fsck the swap? swap does not need fscking.

I have no idea. But, if I disable the swap partition the system boots
just fine. If I enable it, fsck tries to run and the partition is
complains about is the swap partition. I have no idea why systemd.fsck
does this. :-/

[snip]
> I have the same setup on Debian Sid with systemd, just like you:
> 
> ,[ /etc/crypttab
> | # 
> | cswap   /dev/disk/by-id/md-uuid-a805edd5:bcfd4c98:ce747c2c:77d42131 
> /dev/urandomswap,cipher=aes-cbc-essiv:sha256,size=256
> `

Thank you!! I think I just found out what my note "systemd.fsck doesn't
like UUID's" meant! I was assuming it was in the /etc/fstab or
somewhere, but when I noticed you have the /dev location of your disk
and I have a UUID in the /etc/crypttab I decided to give it a try.

$ grep swap /etc/crypttab
# causes systemd to fsck swap
#sda3_crypt UUID=ef2496cd-ca4d-43aa-8c90-dba084029f6e /dev/urandom
cipher=aes-xts-plain64,size=256,swap
# systemd doesn't fsck swap
sda3_crypt /dev/sda3 /dev/urandom cipher=aes-xts-plain64,size=256,swap

I reverted all of my changes that I took notes on and
bada-bing-bada-boom! It works now!

Out of curiosity (and because I have a sacrificial VM with various
snapshots I can easily reset to), I setup a encrypted swap on a Ubuntu
15.04 alpha (pre-systemd) with my previous method. Swap worked
perfectly. I 'apt-get update'd 15.04 and installed the systemd package
(and a lot of "dependencies" o_O). On the first boot systemd.fsck had
issues with swap and didn't mount it. I changed it to the disk instead
of UUID and rebooted. Works!! So it isn't just systemd in Debian either.

At least I now know in the future not to use UUID for swap in /etc/crypttab!

Sometimes it seems that the most painful and frustrating problems have
the most trivial solutions. :-D

Thanks!
~Stack~



signature.asc
Description: OpenPGP digital signature