update-initramfs can't handle encrypted swap-files
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/
# grep cryptswap /etc/crypttab
cryptswap /cryptswapfile /dev/urandom swap,cipher=
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.
description: | updated |
description: | updated |
affects: | cryptsetup → cryptsetup (Ubuntu) |
Changed in initramfs-tools (Ubuntu): | |
status: | Confirmed → Invalid |
Changed in cryptsetup (Ubuntu): | |
status: | New → Confirmed |
Status changed to 'Confirmed' because the bug affects multiple users.