You are not logged in.

#1 2013-04-09 23:16:47

Ochi
Member
Registered: 2010-04-06
Posts: 52

"systemd-cryptsetup: Failed to deactivate" after latest updates

Hello everyone,

since I updated my system this evening (amongst other updates, there was systemd 200-1), I noticed that I get an error message and hang (until timeout, as it seems) upon shutdown which I have not seen before. I guess I would have noticed because the system hangs for a minute or so with pending jobs until finally shutting down. Note that the HDD LED is lit during that hang but I can't really imagine that a sync is taking so long because it also happens when I shutdown a freshly booted (and manually sync'd) system.

My setup is fairly simple. There are three drives:

The first drive has a small, unencrypted ext4 partition for /boot and an encrypted btrfs partition for root (including /home).
The second drive has an encrypted btrfs partition for storage.
The third drive has an encrypted btrfs partition for backup.

The interesting part of the shutdown process now looks like this:

...
[  OK  ] Unmounted /boot
[  OK  ] Unmounted Temporary Directory.
[  OK  ] Stopped Journal Service.
[  OK  ] Unmounted /mnt/storage
[  OK  ] Stopped Cryptography Setup for storage.
[ 162.323402 ] systemd-cryptsetup[613]: Failed to deactivate: Invalid argument
[  OK  ] Stopped Cryptography Setup for backup.
[    **] (1 of 6) A stop job is running for /dev/disk/by-uuid/...

The last line cycles through several pending jobs, it seems like it is working on unmounting the backup partition.

My fstab looks like this:

/dev/mapper/root     /             btrfs      rw,noatime,ssd,discard,space_cache,subvol=__active   0 1
/dev/mapper/storage  /mnt/storage  btrfs      rw,noatime,space_cache  0 0
/dev/mapper/backup   /mnt/backup   btrfs      rw,noatime,space_cache  0 0
/dev/sda1            /boot         ext4       rw,relatime,data=ordered  0 2

And my crypttab:

storage        /dev/sdb1        (path to keyfile here)
backup         /dev/sdc3        (path to keyfile here)

And these are the hooks I use in mkinitcpio.conf:

HOOKS="base udev autodetect modconf block keyboard encrypt filesystems shutdown"

Is anyone else experiencing similar problems (after the latest updates)?

Last edited by Ochi (2013-04-09 23:22:36)

Offline

#2 2013-04-11 08:24:47

kotharia
Member
Registered: 2012-06-04
Posts: 8

Re: "systemd-cryptsetup: Failed to deactivate" after latest updates

I have a similar problem. For me, the job which is holding up shutdown is my user-session@ service.

Offline

#3 2013-04-13 08:00:20

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,490

Re: "systemd-cryptsetup: Failed to deactivate" after latest updates

I wonder, if this is linked to: https://bugs.archlinux.org/task/34708
but your error lead "systemd-cryptsetup[613]: Failed to deactivate: Invalid argument" then indicates it is not.

I don't think it will solve it, but maybe you want to do an fsck on "backup" and "storage", as they are not done automatically with your config.

Offline

#4 2013-04-15 22:58:37

Ochi
Member
Registered: 2010-04-06
Posts: 52

Re: "systemd-cryptsetup: Failed to deactivate" after latest updates

Hmm, I suspect that the "Failed to deactivate" message and the lag afterwards when unmounting "backup" are not related to each other.

I tried defragmenting the "backup" volume (the metadata of the root of the volume and all subvolumes – note that it's formatted with btrfs) which took a quite a long time. At first this seemed to help the lag on shutdown, but then it was there again, albeit shorter. Then I simply tried umounting the "backup" volume right after booting and it took about 30 seconds to unmount. :\ So, it seems like the btrfs volume simply is slow to unmount for whatever reason – I'll have to look into that.

I ran a btrfs scrub on "storage" and "backup" with no errors but I'll run a btrfsck on them as well and report back if any errors arise from that.

Offline

Board footer

Powered by FluxBB