ecryptfs-setup-swap fails when activating swap

Bug #1886723 reported by Alberto Pianon
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
eCryptfs
New
Undecided
Unassigned
ecryptfs-utils (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

ecryptfs-setup-swap fails when activating swap at the end, giving the following error message:

swapon: cannot open /dev/mapper/cryptswap1: No such file or directory

However, after a reboot, encrypted swap works.

This happens because cryptsetup service works slightly differently now, and, after modifying /etc/crypttab, it is required to call "systemctl daemon-reload" before restarting cryptsetup service at the end of ecryptfs-setup-swap script.

SOLUTION:

add "systemctl daemon-reload" before "systemctl restart cryptsetup.target"

Tags: patch
Revision history for this message
Alberto Pianon (alberto-o) wrote :

I created a patch for the ubuntu package. It must be applied after existing swapfile-support.patch

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "cryptsetup-generator.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ecryptfs-utils (Ubuntu):
status: New → Confirmed
Revision history for this message
Chris Watts (cjxd) wrote :

I had this problem on a fresh install of Ubuntu 22.04 today. I'm using LVM.

```
+ sudo ecryptfs-setup-swap

WARNING:
An encrypted swap is required to help ensure that encrypted files are not leaked to disk in an unencrypted format.

HOWEVER, THE SWAP ENCRYPTION CONFIGURATION PRODUCED BY THIS PROGRAM WILL BREAK HIBERNATE/RESUME ON THIS SYSTEM!

NOTE: Your suspend/resume capabilities will not be affected.

Do you want to proceed with encrypting your swap? [y/N]: y

INFO: Setting up swap: [/dev/dm-1]
WARNING: Commented out your unencrypted swap from /etc/fstab
swapon: cannot open /dev/mapper/cryptswap1: No such file or directory
```

fstab after:

```
/dev/mapper/vgubuntu-root / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=DD8B-183F /boot/efi vfat umask=0077 0 1
#/dev/mapper/vgubuntu-swap_1 none swap sw 0 0
/dev/mapper/cryptswap1 none swap sw 0 0
```

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.