Score:0

Kubuntu update-initramfs results in: ERROR: Couldn't resolve device /swapfile

in flag

Lately, I did a fresh install of kubuntu (coming from linux mint) where I also encypted the drive and swapfile. During booting I got the error:

Cryptsetup waiting for encrytped source device /swapfile.

After some searching I found that a command called sudo update-initramfs -u -k all should solve it. However, I get some errors I cannot resolve:

update-initramfs: Generating /boot/initrd.img-5.19.0-38-generic
cryptsetup: WARNING: cryptswap1: couldn't determine device type, assuming
default (plain).
cryptsetup: ERROR: Couldn't resolve device /swapfile
cryptsetup: WARNING: cryptswap1: key file /dev/loop0 has insecure ownership,
see /usr/share/doc/cryptsetup/README.Debian.gz.
cryptsetup: WARNING: Resume target cryptswap1 uses a key file
I: The initramfs will attempt to resume from /dev/dm-0
I: (/dev/mapper/cryptswap1)
I: Set the RESUME variable to override this.
update-initramfs: Generating /boot/initrd.img-5.19.0-35-generic
cryptsetup: WARNING: cryptswap1: couldn't determine device type, assuming
default (plain).
cryptsetup: ERROR: Couldn't resolve device /swapfile
cryptsetup: WARNING: cryptswap1: key file /dev/loop0 has insecure ownership,
see /usr/share/doc/cryptsetup/README.Debian.gz.
cryptsetup: WARNING: Resume target cryptswap1 uses a key file
I: The initramfs will attempt to resume from /dev/dm-0
I: (/dev/mapper/cryptswap1)
I: Set the RESUME variable to override this.

The content of the /etc/crypttab file is cryptswap1 /swapfile /dev/loop0 swap,offset=1024,cipher=aes-xts-plain64,size=256

The command lsblk -f gives the following:

NAME         FSTYPE   FSVER LABEL      UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0        swap     1                7ab8406f-ea13-4984-8211-b9dd27a0677c                 
└─cryptswap1 swap     1     cryptswap1 4cd157f7-3d8d-4893-aea8-be54200244e1                [SWAP]

Is somebody able to help me here? I probably has something to do with the crypttab file but I don't know what to change.

Vincentvd avatar
in flag
Okay, during the installation of kubuntu I used the default settings (not using lvm). Later I followed the instuctions below. During the encryption of the swapfile, it complained there was no swapfile, hence the situation I am in now: https://www.howtogeek.com/116032/how-to-encrypt-your-home-folder-after-installing-ubuntu/
nobody avatar
gh flag
This isn't an error only an info.
Vincentvd avatar
in flag
@Nmath I indeed went for lvm encryption with an new ubuntu installation this time. Now the entire drive is encrypted which is also fine (maybe even better then the home drive alone). Thanks for the help
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.