update-initramfs can't handle encrypted swap-files

Bug #1879085 reported by Tymion Larsik
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
cryptsetup (Ubuntu)
Confirmed
Undecided
Unassigned
initramfs-tools (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

OS: Ubuntu 20.04 Mate

I have an encrypted swap-file, which is working fine:

# grep cryptswap /etc/fstab
/dev/mapper/cryptswap none swap defaults 0 0
# grep cryptswap /etc/crypttab
cryptswap /cryptswapfile /dev/urandom swap,cipher=aes-xts-plain64,size=256

But everytime I update the kernel and update-initramfs is executed, an error occurs:

cryptsetup: ERROR: Couldn't resolve device /cryptswapfile
cryptsetup: WARNING: Resume target cryptswap uses a key file

And after the next reboot, the system can't load the cryptswap while booting and hangs for several minutes.

Workaround: Boot into rescue mode and wait until the loading of the cryptswapfile timeouts. Go to a shell and comment the lines in the fstab and crypttab. Execute # swapoff -a && update-initramfs -u. Now uncomment the lines in fstab and crypttab again and reboot. Your system should boot fine and you should have an encrypted swapfile.

Tags: focal
Tymion Larsik (tymion)
description: updated
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in initramfs-tools (Ubuntu):
status: New → Confirmed
Changed in cryptsetup (Ubuntu):
status: New → Confirmed
Jesse (sbjesse)
affects: cryptsetup → cryptsetup (Ubuntu)
Steve Langasek (vorlon)
Changed in initramfs-tools (Ubuntu):
status: Confirmed → Invalid
Changed in cryptsetup (Ubuntu):
status: New → Confirmed
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.