[Bug 1879085] [NEW] update-initramfs can't handle encrypted swap-files

Tymion Larsik 1879085 at bugs.launchpad.net
Sat May 16 18:18:44 UTC 2020


Public bug reported:

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.

** Affects: initramfs-tools (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: focal

** Description changed:

+ OS: Ubuntu 20.04 Mate
+ 
  I have an encrypted swap-file, which is working fine:
  
- # grep cryptswap /etc/fstab 
+ # grep cryptswap /etc/fstab
  /dev/mapper/cryptswap none swap  defaults 0 0
- # grep cryptswap /etc/crypttab 
+ # 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 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.
+ 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 changed:

  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 reboot, the system can't load the cryptswap while booting and
- hangs for several minutes.
+ 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.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to initramfs-tools in Ubuntu.
https://bugs.launchpad.net/bugs/1879085

Title:
  update-initramfs can't handle encrypted swap-files

Status in initramfs-tools package in Ubuntu:
  New

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1879085/+subscriptions



More information about the foundations-bugs mailing list