ecryptfs install does not initialize cryptswap partition

Bug #1429354 reported by Benjamin Geese on 2015-03-07
44
This bug affects 10 people
Affects Status Importance Assigned to Milestone
cryptsetup (Ubuntu)
Undecided
Unassigned

Bug Description

My system boots almost instantly with upstart. Today i tried booting with systemd via the additional grub option.
However, with systemd it takes really long to boot but – so long that i forced a reboot once because i thought i got stuck.

Looking in to boot journal, i found the following error concerning the swap:
Mär 07 09:28:00 darw1n systemd[1]: dev-sda3.swap swap process exited, code=exited status=255
Mär 07 09:28:00 darw1n systemd[1]: Failed to activate swap Swap Partition.
Mär 07 09:28:00 darw1n systemd[1]: Unit dev-sda3.swap entered failed state.

And this concerning nvidia-persistenced
Mär 07 09:28:00 darw1n nvidia-persistenced[433]: Started (433)
Mär 07 09:28:00 darw1n nvidia-persistenced[433]: Failed to query NVIDIA devices. Please ensure that the NVIDIA device files (/dev/nvidia*) exist, and that user 116 has read and write permissions for thos
Mär 07 09:28:00 darw1n nvidia-persistenced[433]: The daemon no longer has permission to remove its runtime data directory /var/run/nvidia-persistenced

I checked that /dev/sda3 exists and is a swap partition and i check for the /dev/nvidia files:
$ ls -Alst /dev/nvidia0
0 crw-rw-rw- 1 root root 195, 0 Mär 7 09:29 /dev/nvidia0

However, the interesting part is here, where nothing seems to happen for a minute: (see the timestamps):
Mär 07 09:28:01 darw1n systemd[1]: Started LSB: AppArmor initialization.
Mär 07 09:28:31 darw1n systemd-journal[234]: Forwarding to syslog missed 99 messages.
Mär 07 09:29:29 darw1n systemd[1]: Job dev-disk-by\x2duuid-0b93a0a2\x2d115c\x2d4a45\x2d9075\x2d5f31454c5a41.device/start timed out.
Mär 07 09:29:29 darw1n systemd-journal[234]: Forwarding to syslog missed 1 messages.
Mär 07 09:29:29 darw1n systemd[1]: Timed out waiting for device dev-disk-by\x2duuid-0b93a0a2\x2d115c\x2d4a45\x2d9075\x2d5f31454c5a41.device.
Mär 07 09:29:29 darw1n systemd[1]: Dependency failed for Cryptography Setup for cryptswap1.
Mär 07 09:29:29 darw1n systemd[1]: Dependency failed for dev-mapper-cryptswap1.device.
Mär 07 09:29:29 darw1n systemd[1]: Dependency failed for /dev/mapper/cryptswap1.
Mär 07 09:29:29 darw1n systemd[1]: Dependency failed for Swap.
Mär 07 09:29:29 darw1n systemd[1]: Job swap.target/start failed with result 'dependency'.
Mär 07 09:29:29 darw1n systemd[1]: Job dev-mapper-cryptswap1.swap/start failed with result 'dependency'.
Mär 07 09:29:29 darw1n systemd[1]: Job dev-mapper-cryptswap1.device/start failed with result 'dependency'.
Mär 07 09:29:29 darw1n systemd[1]: Dependency failed for Encrypted Volumes.
Mär 07 09:29:29 darw1n systemd[1]: Job cryptsetup.target/start failed with result 'dependency'.
Mär 07 09:29:29 darw1n systemd[1]: Job <email address hidden>/start failed with result 'dependency'.
Mär 07 09:29:29 darw1n systemd[1]: Job dev-disk-by\x2duuid-0b93a0a2\x2d115c\x2d4a45\x2d9075\x2d5f31454c5a41.device/start failed with result 'timeout'.
Mär 07 09:29:29 darw1n systemd[1]: Reached target System Initializatio

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: systemd 219-4ubuntu3
ProcVersionSignature: Ubuntu 3.16.0-30.40-generic 3.16.7-ckt3
Uname: Linux 3.16.0-30-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.16.2-0ubuntu1
Architecture: amd64
CurrentDesktop: Unity
Date: Sat Mar 7 09:31:09 2015
EcryptfsInUse: Yes
InstallationDate: Installed on 2015-02-05 (29 days ago)
InstallationMedia: Ubuntu 14.04.1 LTS "Trusty Tahr" - Release amd64 (20140722.2)
MachineType: To Be Filled By O.E.M. To Be Filled By O.E.M.
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.16.0-30-generic.efi.signed root=UUID=63ea7e2a-9b00-4298-b58c-7a68c2775a87 ro vt.handoff=7 init=/lib/systemd/systemd systemd.debugshell
SourcePackage: systemd
UpgradeStatus: Upgraded to vivid on 2015-02-23 (11 days ago)
dmi.bios.date: 12/17/2014
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: P1.60
dmi.board.name: H97 Performance
dmi.board.vendor: ASRock
dmi.chassis.asset.tag: To Be Filled By O.E.M.
dmi.chassis.type: 3
dmi.chassis.vendor: To Be Filled By O.E.M.
dmi.chassis.version: To Be Filled By O.E.M.
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrP1.60:bd12/17/2014:svnToBeFilledByO.E.M.:pnToBeFilledByO.E.M.:pvrToBeFilledByO.E.M.:rvnASRock:rnH97Performance:rvr:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:
dmi.product.name: To Be Filled By O.E.M.
dmi.product.version: To Be Filled By O.E.M.
dmi.sys.vendor: To Be Filled By O.E.M.

Benjamin Geese (ben-8409) wrote :
Martin Pitt (pitti) wrote :

You'll get the 90 second timeout with waiting for dev-disk-by\x2duuid-0b93a0a2\x2d115c\x2d4a45\x2d9075\x2d5f31454c5a41.device (which presumably is the one containing swap), then your system should boot without swap.

> Mär 07 09:28:00 darw1n swapon[418]: swapon: /dev/sda3: Swap-Header konnte nicht gelesen werden

This indicates that your /etc/fstab contains an invalid "swap" partition entry, as you now use an encrypted swap. Your udev database has no device with the above UUID, and /dev/sda3 has no file system on it at all, so it'll indeed wait for that in vain. It might be the UUID of the /dev/mapper/cryptswap1 device.

Can you please attach your /etc/fstab and /etc/crypttab files? (They shouldn't contain keys, just the names of the key files; but please do have a look at them, and feel free to obfuscate anything which looks like a password/key with XXXXX or so).

Thanks!

Changed in systemd (Ubuntu):
status: New → Incomplete
Martin Pitt (pitti) wrote :

Can you please file a bug against nvidia-graphics-drivers-346 for the persistenced issue?

summary: - Systemd takes very long to boot with error in swap mounting and nvidia
- persistenced
+ Systemd takes very long to boot with error in swap mounting
Martin Pitt (pitti) on 2015-03-08
tags: added: systemd-boot

I have the same issue. Attaching my fstab and crypttab.

Lars Karlitski (larsu) wrote :
Lars Karlitski (larsu) wrote :
Martin Pitt (pitti) wrote :

How did you install this system? I selected the default "encrypted on LVM" option in ubiquity, but this creates a single encrypted PV with a single VG "ubuntu" that has two LVs, one for root and one for swap:

fstab:
/dev/mapper/ubuntu--vg-swap_1 none swap sw 0 0

crypttab:
vda5_crypt UUID=66e69938-a18e-4ad3-8a43-93f6a53d68c8 none luks,discard

That has been Ubuntu's standard LVM+cryptsetup layout forever, so apparently you did something else to get the randomized cryptswap partitions?

Martin Pitt (pitti) on 2015-03-09
summary: - Systemd takes very long to boot with error in swap mounting
+ cryptswap (with ecryptfs) configures invalid crypttag
summary: - cryptswap (with ecryptfs) configures invalid crypttag
+ cryptswap (with ecryptfs) configures invalid crypttab
Martin Pitt (pitti) wrote :

This is reproducible with a default "use full disk" and "encrypt my home dir" installation. This produces that kind of crypttab which apparently never initializes the cryptswap partition. blkid -p on that partition is empty, there is no LUKS file system on it. I'm not sure about the role of UUID for a cryptswap device that gets initialized from /dev/urandom, but I figure there's supposed to be an outer LUKS wrapper around the "inner" swap partition?

This is broken under upstart as well, it's just that booting silently ignores the missing cryptswap partition and you have a system without any swap.

summary: - cryptswap (with ecryptfs) configures invalid crypttab
+ ecryptfs install does not initialize cryptswap partition
Changed in systemd (Ubuntu):
status: Incomplete → Triaged
affects: systemd (Ubuntu) → ubiquity (Ubuntu)
Changed in ubiquity (Ubuntu):
importance: Undecided → High
Changed in systemd (Ubuntu):
status: New → Triaged
Martin Pitt (pitti) wrote :

Leaving a cryptsetup task, as somehow we need to clean up after that for existing installations. (This might end up in a different package too)

affects: systemd (Ubuntu) → cryptsetup (Ubuntu)
Martin Pitt (pitti) on 2015-03-09
no longer affects: ubiquity (Ubuntu)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers