Kubuntu update-initramfs 导致:错误:无法解析设备/swapfile

Kubuntu update-initramfs 导致:错误:无法解析设备/swapfile

最近,我重新安装了 kubuntu(来自 linux mint),还加密了驱动器和交换文件。启动时我收到错误:

Cryptsetup 等待加密的源设备 /swapfile。

经过一番搜索,我发现一个名为的命令sudo update-initramfs -u -k all应该可以解决这个问题。但是,我得到了一些无法解决的错误:

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.

/etc/crypttab 文件的内容是cryptswap1 /swapfile /dev/loop0 swap,offset=1024,cipher=aes-xts-plain64,size=256

该命令lsblk -f给出以下内容:

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]

有人能帮我吗?我可能与 crypttab 文件有关,但我不知道该更改什么。

相关内容