9

I have a full disk encryption using ecryptfs, after upgrading to 18.10 a warning message started to appearing at boot:

cryptsetup: WARNING: Option 'size' missing in crypttab for plain dm-crypt mapping root. Please read /usr/share/doc/cryptsetup/README.initramfs and add the correct 'size' option to your crypttab(5).

From what I see at /usr/share/doc/cryptsetup-initramfs/README.initramfs.gz I should edit /etc/cryptsetup and set the correct size, but how should this size be calculated for my system?

This is the content of /etc/crypttab:

 cryptswap1 UUID=1d1XXXXXXXXXXXX /dev/urandom swap,offset=1024,cipher=aes-xts-plain64

3 Answers 3

9

Add the size like size=256 to /etc/crypttab configuration:

cryptswap1 UUID=1d1XXXXXXXXXXXX /dev/urandom swap,offset=1024,cipher=aes-xts-plain64,size=256
1
  • 1
    You ask how this size should be calculated and then post an answer that does not explain how to calculate this at all and mark it as the correct answer? So far no one has answered in this thread how to calculate this size. Please add this to your answer :) May 10 at 8:01
4

Editing the 'crypttab' file was not enough in my case (upgraded to Ubuntu 20.04).

After editing the file, I had to disable (temporary) the swap file and re-generate the initramfs image:

sudo swapoff -a
sudo update-initramfs -c -k all
sudo swapon -a

Unfortunately, that step should be repeated after every kernel update.

4
1

If you only have encrypted swap partitions, the correct way to prevent initramfs from using them for resume is to add:

RESUME=none into /etc/initramfs-tools/conf.d/resume

For example:

echo "RESUME=none" | sudo tee /etc/initramfs-tools/conf.d/resume

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.