Bug 1306891 - systemd does not activate crypo swap without an fstab entry
Summary: systemd does not activate crypo swap without an fstab entry
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-12 02:53 UTC by Chris Murphy
Modified: 2016-12-20 18:39 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-20 18:39:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
crypttab (191 bytes, text/plain)
2016-02-12 02:54 UTC, Chris Murphy
no flags Details
fstab (321 bytes, text/plain)
2016-02-12 02:54 UTC, Chris Murphy
no flags Details
journal (1.85 MB, text/plain)
2016-02-12 02:54 UTC, Chris Murphy
no flags Details

Description Chris Murphy 2016-02-12 02:53:38 UTC
Description of problem: Systemd is correctly creating a crypto device, does mkswap on it, but then fails to actually swapon unless there's an fstab entry.


Version-Release number of selected component (if applicable):
4.4.0-1.fc24.x86_64
systemd-222-13.fc23.x86_64

How reproducible:
Always


Steps to Reproduce:
1. Setup /etc/crypttab  (attached)
2. No entry in fstab
3. GPT partition type GUID for the partition in crypttab is set to the generic Linux partition type (gdisk code 8300); although I did also try setting it to gdisk code 8200, but that also doesn't work.

Actual results:

Fails to activate swap.

[root@f23s ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:           3872         131        3467           0         273        3681
Swap:             0           0           0


[   36.968788] f23s.localdomain systemd[661]: systemd-cryptsetup: Executing: /usr/lib/systemd/systemd-cryptsetup attach swap /dev/disk/by-id/wwn-0xbc4941c003965000-part5 /dev/urandom swap,cipher=aes-xts-plain64,size=256

[   37.160196] f23s.localdomain systemd-cryptsetup[661]: Set cipher aes, mode xts-plain64, key size 256 bits for device /dev/disk/by-id/wwn-0xbc4941c003965000-part5.

[   38.244942] f23s.localdomain systemd[1]: systemd-cryptsetup: Child 661 belongs to systemd-cryptsetup
[   38.245439] f23s.localdomain systemd[1]: systemd-cryptsetup: Main process exited, code=exited, status=0/SUCCESS
[   38.245972] f23s.localdomain systemd[1]: systemd-cryptsetup: About to execute: /sbin/mkswap /dev/mapper/swap


[   38.248467] f23s.localdomain systemd[713]: systemd-cryptsetup: Executing: /sbin/mkswap /dev/mapper/swap
[   38.254243] f23s.localdomain systemd[1]: systemd-cryptsetup: Changed start -> start-post

[   38.467540] f23s.localdomain mkswap[713]: Setting up swapspace version 1, size = 8 GiB (8589930496 bytes)
[   38.468340] f23s.localdomain mkswap[713]: no label, UUID=7b7e89fb-cd8f-43cd-b2c7-0872cba617b1

[   38.471875] f23s.localdomain systemd[1]: systemd-cryptsetup: Child 713 belongs to systemd-cryptsetup
[   38.472424] f23s.localdomain systemd[1]: systemd-cryptsetup: Control process exited, code=exited status=0
[   38.473230] f23s.localdomain systemd[1]: systemd-cryptsetup: Got final SIGCHLD for state start-post.
[   38.474030] f23s.localdomain systemd[1]: systemd-cryptsetup: Changed start-post -> exited
[   38.474521] f23s.localdomain systemd[1]: systemd-cryptsetup: Job systemd-cryptsetup/start finished, result=done
[   38.474996] f23s.localdomain systemd[1]: Started Cryptography Setup for swap.

[   39.513912] f23s.localdomain systemd[1]: dev-mapper-swap.device: Changed dead -> plugged
[   39.514325] f23s.localdomain systemd[1]: dev-mapper-swap.device: Job dev-mapper-swap.device/start finished, result=done
[   39.514721] f23s.localdomain systemd[1]: Found device /dev/mapper/swap.
[   39.515150] f23s.localdomain systemd[1]: dev-disk-by\x2duuid-7b7e89fb\x2dcd8f\x2d43cd\x2db2c7\x2d0872cba617b1.device: Changed dead -> plugged
[   39.515628] f23s.localdomain systemd[1]: dev-disk-by\x2did-dm\x2duuid\x2dCRYPT\x2dPLAIN\x2dswap.device: Changed dead -> plugged
[   39.516147] f23s.localdomain systemd[1]: dev-disk-by\x2did-dm\x2dname\x2dswap.device: Changed dead -> plugged

[  148.929779] f23s.localdomain systemd[1442]: dev-mapper-swap.device: Changed dead -> plugged

Expected results:

swapon should happen after mswap.

The logic has inferred /dev/mapper/swap should have mkswap run on it, and yet doesn't know to swapon the same device? Kinda weird.


Additional Info:


# swapon /dev/mapper/swap
# free -m
              total        used        free      shared  buff/cache   available
Mem:           3872         136        3422           0         313        3675
Swap:          8191           0        8191

So yeah that's really the only thing missing.

If I create an fstab entry for /dev/mapper/swap, it also works. But it seems like this should work without an fstab entry.

Comment 1 Chris Murphy 2016-02-12 02:54:12 UTC
Created attachment 1123332 [details]
crypttab

Comment 2 Chris Murphy 2016-02-12 02:54:30 UTC
Created attachment 1123333 [details]
fstab

Comment 3 Chris Murphy 2016-02-12 02:54:58 UTC
Created attachment 1123334 [details]
journal


systemd.log_level=debug

Comment 4 Fedora End Of Life 2016-11-24 15:31:08 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Fedora End Of Life 2016-12-20 18:39:02 UTC
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.