Bug 773089 - Encrypted swap device not enabled when booting
Summary: Encrypted swap device not enabled when booting
Keywords:
Status: CLOSED DUPLICATE of bug 711394
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 16
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-10 22:04 UTC by Stefan Krüger
Modified: 2012-02-01 09:17 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-01 09:17:39 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Stefan Krüger 2012-01-10 22:04:57 UTC
Description of problem:
An encrypted swap device is not enabled after reboot

Version-Release number of selected component (if applicable):
kernel-3.1.0-7.fc16.x86_64
cryptsetup-luks-1.3.1-2.fc16.x86_64

How reproducible:
happens always

Steps to Reproduce:
1. swapoff -a
2. cryptsetup -d /dev/urandom create swap /dev/mapper/VolGroup-lv_swap
3. mkswap -f /dev/mapper/swap
4. echo "swap /dev/mapper/VolGroup-lv_swap /dev/urandom swap" > /etc/crypttab
5. vi /etc/fstab (change entry for swap to point it to /dev/mapper/swap)
6. swapon -a (verify it works)
7. reboot

  
Actual results (after reboot!):
# free -m
             total       used       free     shared    buffers     cached
Mem:           744        219        525          0          6        136
-/+ buffers/cache:         76        668
Swap:            0          0          0


Expected results:
# free -m
             total       used       free     shared    buffers     cached
Mem:           744        219        525          0          6        136
-/+ buffers/cache:         76        668
Swap:         1023          0       1023



Additional info:
systemctl list-units --all | grep swap
dev-disk...x2dswap.device loaded active   plugged       /dev/disk/by-id/dm-name-swap
dev-disk...lv_swap.device loaded active   plugged       /dev/disk/by-id/dm-name-VolGroup-lv_swap
dev-disk...x2dswap.device loaded active   plugged       /dev/disk/by-id/dm-uuid-CRYPT-PLAIN-swap
dev-mapper-swap.device    loaded active   plugged       /dev/mapper/swap
dev-mapp...lv_swap.device loaded active   plugged       /dev/mapper/VolGroup-lv_swap
dev-VolG...lv_swap.device loaded active   plugged       /dev/VolGroup/lv_swap
cryptsetup   loaded active   exited        Cryptography Setup for swap
dev-disk...e\x2dswap.swap loaded active   active        /dev/disk/by-id/dm-name-swap
dev-disk...N\x2dswap.swap loaded active   active        /dev/disk/by-id/dm-uuid-CRYPT-PLAIN-swap
dev-dm\x2d3.swap          loaded inactive dead          /dev/dm-3
dev-mapper-swap.swap      loaded active   active        /dev/mapper/swap
swap.target               loaded active   active        Swap

Comment 1 Milan Broz 2012-01-10 22:49:41 UTC
crypttab is processed by systemd, reassigning

Comment 2 Michal Schmidt 2012-01-11 15:20:05 UTC
Probably a duplicate of bug 711150. Please try systemd-37-6.fc16 (currently pending for updates-testing).

Comment 3 Stefan Krüger 2012-01-11 17:02:36 UTC
Still not working

# free -m
             total       used       free     shared    buffers     cached
Mem:           743        208        535          0          6        120
-/+ buffers/cache:         81        662
Swap:            0          0          0
# systemctl list-units --all | grep swap
dev-disk...lv_swap.device loaded active   plugged       /dev/disk/by-id/dm-name-VolGroup-lv_swap
dev-mapper-swap.device    loaded inactive dead          dev-mapper-swap.device
dev-mapp...lv_swap.device loaded active   plugged       /dev/mapper/VolGroup-lvswap
dev-VolG...lv_swap.device loaded active   plugged       /dev/VolGroup/lv_swap
cryptsetup   loaded active   exited        Cryptography Setup for swap
dev-mapper-swap.swap      loaded inactive dead          /dev/mapper/swap
swap.target               loaded active   active        Swap
# rpm -qa | grep systemd
systemd-37-6.fc16.x86_64
systemd-units-37-6.fc16.x86_64
systemd-sysv-37-6.fc16.x86_64

Comment 4 Michal Schmidt 2012-01-12 00:01:21 UTC
Does "udevadm info -q all --name=/dev/mapper/swap" show "E: SYSTEMD_READY=0"?
That would point to bug 711394.

Comment 5 Michal Schmidt 2012-01-12 01:14:18 UTC
Do you have any messages about an "ordering cycle" in dmesg and/or /var/log/messages?

Comment 6 Stefan Krüger 2012-01-12 08:10:30 UTC
# udevadm info -q all --name=/dev/mapper/swap | grep SYSTEMD_READY
E: SYSTEMD_READY=0

# dmesg | grep "ordering cycle"
[    2.666598] systemd[1]: Found ordering cycle on local-fs.target/start
[    2.666652] systemd[1]: Breaking ordering cycle by deleting job fedora-storage-init-late.service/start

and on another system without systemd-37-6.fc16 multiple times:

# dmesg | grep "ordering cycle"
[    5.811655] systemd[1]: Found ordering cycle on local-fs.target/start
[    5.811707] systemd[1]: Breaking ordering cycle by deleting job cryptsetup/start
[    9.909999] systemd[1]: Found ordering cycle on cryptsetup/start
[    9.978347] systemd[1]: Found ordering cycle on cryptsetup/start
[    9.978400] systemd[1]: Breaking ordering cycle by deleting job cryptsetup/start
[    9.981370] systemd[1]: Found ordering cycle on cryptsetup/start
[    9.981421] systemd[1]: Breaking ordering cycle by deleting job cryptsetup/start
[    9.982226] systemd[1]: Found ordering cycle on cryptsetup/start
[    9.982276] systemd[1]: Breaking ordering cycle by deleting job cryptsetup/start
[    9.982772] systemd[1]: Found ordering cycle on cryptsetup/start
[    9.982820] systemd[1]: Breaking ordering cycle by deleting job cryptsetup/start

PS: with systemd-37-6.fc16 the system takes longer to boot...

Comment 7 Stefan Krüger 2012-02-01 09:02:23 UTC
JFYI

systemd-37-11.fc16 does not fix this problem, even though it says:

[ 13 ] Bug #759402 - systemd does not activate encrypted swap anymore
        https://bugzilla.redhat.com/show_bug.cgi?id=759402

The command swapon -a is still needed after every reboot.

Comment 8 Michal Schmidt 2012-02-01 09:17:39 UTC
(In reply to comment #6)
> # udevadm info -q all --name=/dev/mapper/swap | grep SYSTEMD_READY
> E: SYSTEMD_READY=0

A symptom of bug 711394.
Installing the udisks package may help as a workaround.

*** This bug has been marked as a duplicate of bug 711394 ***


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