如何生成 crypttab?

如何生成 crypttab?

我在一台新机器上安装了 Debian 11。根文件系统位于 nvme 上。为了复制数据,我在安装时还在计算机上安装了一块旧 ssd。两个磁盘都已加密。Debian 安装以某种方式将 ssd 焊接到系统中,移除它后,update-initramfs 工具返回错误,未找到 ssd,并警告 nvme 不在 crypttab 中。

cryptsetup: WARNING: target 'nvme0n1p3_crypt' not found in /etc/crypttab
cryptsetup: ERROR: Couldn't resolve device /dev/mapper/debianLT--vg-swap_1

交换分区已存在,/etc/initramfs-tools/conf.d/resume所以我将其从那里移除,错误消失了。我还尝试将 nvme0n1np3_crypt 的 UUID 和设备名称添加到 crypttab 中,但现在我收到“源不匹配”

cryptsetup: ERROR: nvme0n1p3_crypt: Source mismatch

我的 crypttab 看起来像这样

nvme0n1p3_crypt UUID="Preipx-FT3v-3WDs-ZMF6-5W4A-3hOa-zXNt2r" none luks,discard

还有我的 fstab

/dev/mapper/debian--vg-root /               ext4    errors=remount-ro 0       1
# /boot was on /dev/nvme0n1p2 during installation
UUID=884b30b1-4235-4acd-9f06-1ff832e97970 /boot           ext2    defaults        0       2
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=C778-5F11  /boot/efi       vfat    umask=0077      0       1
/dev/mapper/debian--vg-swap_1 none            swap    sw              0       0

blkid 返回:

/dev/nvme0n1p1: UUID="C778-5F11" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="b94b4299-d595-4f59-90eb-0848982907ee"
/dev/nvme0n1p2: UUID="884b30b1-4235-4acd-9f06-1ff832e97970" BLOCK_SIZE="1024" TYPE="ext2" PARTUUID="603666ed-d0e7-487f-9601-9ca8a99fe4c5"
/dev/nvme0n1p3: UUID="fc1cba48-eafe-4be7-a29b-e089d044e9c2" TYPE="crypto_LUKS" PARTUUID="c14adbc7-34fc-45f2-a554-9a1e8746357f"
/dev/mapper/nvme0n1p3_crypt: UUID="Preipx-FT3v-3WDs-ZMF6-5W4A-3hOa-zXNt2r" TYPE="LVM2_member"
/dev/mapper/debian--vg-root: UUID="f781f73f-5da1-4a57-a9b9-f5f5b87cdf5d" BLOCK_SIZE="4096" TYPE="ext4"
/dev/mapper/debian--vg-swap_1: UUID="989b506d-0b87-4802-bc1e-d9be466f122f" TYPE="swap"

UUIDfc1cba48-eafe-4be7-a29b-e089d044e9c2也不起作用:

update-initramfs: Generating /boot/initrd.img-5.10.0-16-amd64
E: /usr/share/initramfs-tools/hooks/fuse failed with return 1.
update-initramfs: failed for /boot/initrd.img-5.10.0-16-amd64 with 1.

那么我怎样才能生成一个包含正确设备的新 crypttab 呢?

相关内容