我想完全分离我的工作和个人操作系统,所以我在我的 PC 上安装了两个磁盘,因为我的工作需要全盘加密。
我已经在一个驱动器上成功安装了 Windows 和 Kubuntu,但似乎无法在另一个驱动器上安装加密的 Ubuntu(无论如何)。
我尝试了两种方法。一是告诉安装程序使用带有加密 LVM 的整个磁盘,二是手动设置分区并安装到该磁盘。
当我告诉它使用整个磁盘进行加密的 LVM 引导安装时,它告诉我An error occurred while configuring encrypted volumes.
系统日志包含整个混乱情况,我不确定问题出在哪里。驱动器 0 是 Windows 和我个人安装的未加密驱动器,驱动器 1 是我在这里安装的驱动器。
Oct 30 08:32:19 kubuntu ubiquity: /var/lib/partman/devices/=dev=nvme1n1
Oct 30 08:32:20 kubuntu systemd-udevd[142246]: nvme1n1p3: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme1n1p3' failed with exit code 1.
Oct 30 08:32:20 kubuntu systemd-udevd[142243]: nvme1n1p1: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme1n1p1' failed with exit code 1.
Oct 30 08:32:20 kubuntu systemd-udevd[142245]: nvme1n1p2: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme1n1p2' failed with exit code 1.
Oct 30 08:32:20 kubuntu kernel: [ 3067.145760] nvme1n1: p1 p2 p3
Oct 30 08:32:20 kubuntu systemd-udevd[142275]: nvme1n1p1: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme1n1p1' failed with exit code 1.
Oct 30 08:32:20 kubuntu systemd-udevd[142278]: nvme1n1p3: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme1n1p3' failed with exit code 1.
Oct 30 08:32:20 kubuntu systemd-udevd[142277]: nvme1n1p2: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme1n1p2' failed with exit code 1.
Oct 30 08:32:20 kubuntu kernel: [ 3067.998718] nvme1n1: p1 p2 p3
Oct 30 08:32:21 kubuntu systemd-udevd[142275]: nvme1n1p3: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme1n1p3' failed with exit code 1.
Oct 30 08:32:21 kubuntu systemd-udevd[142277]: nvme1n1p2: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme1n1p2' failed with exit code 1.
Oct 30 08:32:21 kubuntu systemd-udevd[142278]: nvme1n1p1: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme1n1p1' failed with exit code 1.
Oct 30 08:32:21 kubuntu partman: mke2fs 1.46.5 (30-Dec-2021)
Oct 30 08:32:21 kubuntu partman-crypto: kernel entropy_avail: 256 bits
Oct 30 08:32:30 kubuntu partman-crypto: WARNING: Device /dev/nvme1n1p3 already contains a 'crypto_LUKS' superblock signature.
Oct 30 08:32:32 kubuntu partman-crypto: No key available with this passphrase.
Oct 30 08:32:40 kubuntu kwin_x11[12890]: kwin_core: XCB error: 152 (BadDamage), sequence: 59632, resource id: 14716285, major code: 143 (DAMAGE), minor code: 3 (Subtract)
Oct 30 08:32:40 kubuntu kernel: [ 3087.751753] nvme0n1: p1 p2 p3 p4 p5
Oct 30 08:32:40 kubuntu ubiquity: NTFS signature is missing.
Oct 30 08:32:40 kubuntu ubiquity: Failed to mount '/dev/nvme0n1p2'
Oct 30 08:32:40 kubuntu ubiquity: : Invalid argument
Oct 30 08:32:40 kubuntu ubiquity: The device '/dev/nvme0n1p2' doesn't seem to have a valid NTFS.
Oct 30 08:32:40 kubuntu ubiquity: Maybe the wrong device is used? Or the whole disk instead of a
Oct 30 08:32:40 kubuntu ubiquity: partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
Oct 30 08:32:40 kubuntu systemd-udevd[144979]: nvme0n1p2: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme0n1p2' failed with exit code 1.
Oct 30 08:32:40 kubuntu systemd-udevd[144980]: nvme0n1p4: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme0n1p4' failed with exit code 1.
Oct 30 08:32:40 kubuntu systemd-udevd[144978]: nvme0n1p5: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme0n1p5' failed with exit code 1.
Oct 30 08:32:40 kubuntu systemd[1]: tmp-tmp.xhYzjKQpjU.mount: Deactivated successfully.
Oct 30 08:32:40 kubuntu systemd-udevd[144977]: nvme0n1p1: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme0n1p1' failed with exit code 1.
Oct 30 08:32:40 kubuntu systemd-udevd[144981]: nvme0n1p3: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme0n1p3' failed with exit code 1.
Oct 30 08:32:40 kubuntu systemd[1]: tmp-tmp.xhYzjKQpjU.mount: Deactivated successfully.
Oct 30 08:32:40 kubuntu ubiquity: mount: /tmp/tmp.xhYzjKQpjU: unknown filesystem type 'crypto_LUKS'.
Oct 30 08:32:40 kubuntu ubiquity: dmesg(1) may have more information after failed mount system call.
Oct 30 08:32:40 kubuntu ubiquity: NTFS signature is missing.
Oct 30 08:32:40 kubuntu ubiquity: Failed to mount '/dev/nvme0n1p2'
Oct 30 08:32:40 kubuntu ubiquity: : Invalid argument
Oct 30 08:32:40 kubuntu ubiquity: The device '/dev/nvme0n1p2' doesn't seem to have a valid NTFS.
Oct 30 08:32:40 kubuntu ubiquity: Maybe the wrong device is used? Or the whole disk instead of a
Oct 30 08:32:40 kubuntu ubiquity: partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
Oct 30 08:32:40 kubuntu ubiquity: mount: /tmp/tmp.lZXCXAPqpp: unknown filesystem type 'crypto_LUKS'.
Oct 30 08:32:40 kubuntu ubiquity: dmesg(1) may have more information after failed mount system call.
Oct 30 08:32:40 kubuntu kernel: [ 3088.011850] nvme0n1: p1 p2 p3 p4 p5
Oct 30 08:32:40 kubuntu kernel: [ 3088.034833] nvme1n1: p1 p2 p3
Oct 30 08:32:41 kubuntu ubiquity: NTFS signature is missing.
Oct 30 08:32:41 kubuntu ubiquity: Failed to mount '/dev/nvme0n1p2'
Oct 30 08:32:41 kubuntu ubiquity: : Invalid argument
Oct 30 08:32:41 kubuntu ubiquity: The device '/dev/nvme0n1p2' doesn't seem to have a valid NTFS.
Oct 30 08:32:41 kubuntu ubiquity: Maybe the wrong device is used? Or the whole disk instead of a
Oct 30 08:32:41 kubuntu ubiquity: partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
Oct 30 08:32:41 kubuntu systemd-udevd[144979]: nvme0n1p2: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme0n1p2' failed with exit code 1.
Oct 30 08:32:41 kubuntu systemd-udevd[144980]: nvme0n1p4: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme0n1p4' failed with exit code 1.
Oct 30 08:32:41 kubuntu systemd-udevd[145030]: nvme0n1p5: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme0n1p5' failed with exit code 1.
Oct 30 08:32:41 kubuntu systemd-udevd[144981]: nvme0n1p3: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme0n1p3' failed with exit code 1.
Oct 30 08:32:41 kubuntu systemd-udevd[144977]: nvme0n1p1: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme0n1p1' failed with exit code 1.
Oct 30 08:32:41 kubuntu ubiquity: mount: /tmp/tmp.G7NB4dtY8C: unknown filesystem type 'crypto_LUKS'.
Oct 30 08:32:41 kubuntu ubiquity: dmesg(1) may have more information after failed mount system call.
Oct 30 08:32:41 kubuntu systemd-udevd[144978]: nvme1n1p3: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme1n1p3' failed with exit code 1.
Oct 30 08:32:41 kubuntu systemd-udevd[145029]: nvme1n1p2: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme1n1p2' failed with exit code 1.
Oct 30 08:32:41 kubuntu systemd-udevd[145031]: nvme1n1p1: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme1n1p1' failed with exit code 1.
Oct 30 08:32:41 kubuntu ubiquity: NTFS signature is missing.
Oct 30 08:32:41 kubuntu ubiquity: Failed to mount '/dev/nvme0n1p2'
Oct 30 08:32:41 kubuntu ubiquity: : Invalid argument
Oct 30 08:32:41 kubuntu ubiquity: The device '/dev/nvme0n1p2' doesn't seem to have a valid NTFS.
Oct 30 08:32:41 kubuntu ubiquity: Maybe the wrong device is used? Or the whole disk instead of a
Oct 30 08:32:41 kubuntu ubiquity: partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
Oct 30 08:32:41 kubuntu ubiquity: mount: /tmp/tmp.pNOkIfiSWm: unknown filesystem type 'crypto_LUKS'.
Oct 30 08:32:41 kubuntu ubiquity: dmesg(1) may have more information after failed mount system call.
Oct 30 08:32:41 kubuntu kernel: [ 3088.208138] nvme0n1: p1 p2 p3 p4 p5
Oct 30 08:32:41 kubuntu ubiquity: NTFS signature is missing.
Oct 30 08:32:41 kubuntu ubiquity: Failed to mount '/dev/nvme0n1p2'
Oct 30 08:32:41 kubuntu ubiquity: : Invalid argument
Oct 30 08:32:41 kubuntu ubiquity: The device '/dev/nvme0n1p2' doesn't seem to have a valid NTFS.
Oct 30 08:32:41 kubuntu ubiquity: Maybe the wrong device is used? Or the whole disk instead of a
Oct 30 08:32:41 kubuntu ubiquity: partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
Oct 30 08:32:41 kubuntu systemd-udevd[144979]: nvme0n1p2: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme0n1p2' failed with exit code 1.
Oct 30 08:32:41 kubuntu systemd-udevd[145796]: nvme0n1p5: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme0n1p5' failed with exit code 1.
Oct 30 08:32:41 kubuntu systemd-udevd[144980]: nvme0n1p4: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme0n1p4' failed with exit code 1.
Oct 30 08:32:41 kubuntu ubiquity: mount: /tmp/tmp.tTk52jqdMM: unknown filesystem type 'crypto_LUKS'.
Oct 30 08:32:41 kubuntu ubiquity: dmesg(1) may have more information after failed mount system call.
Oct 30 08:32:41 kubuntu systemd-udevd[144981]: nvme0n1p3: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme0n1p3' failed with exit code 1.
Oct 30 08:32:41 kubuntu systemd-udevd[144977]: nvme0n1p1: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/nvme0n1p1' failed with exit code 1.
Oct 30 08:32:41 kubuntu ubiquity: NTFS signature is missing.
Oct 30 08:32:41 kubuntu ubiquity: Failed to mount '/dev/nvme0n1p2'
Oct 30 08:32:41 kubuntu ubiquity: : Invalid argument
Oct 30 08:32:41 kubuntu ubiquity: The device '/dev/nvme0n1p2' doesn't seem to have a valid NTFS.
Oct 30 08:32:41 kubuntu ubiquity: Maybe the wrong device is used? Or the whole disk instead of a
Oct 30 08:32:41 kubuntu ubiquity: partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
Oct 30 08:32:41 kubuntu ubiquity: mount: /tmp/tmp.7U9XGuZFRp: unknown filesystem type 'crypto_LUKS'.
Oct 30 08:32:41 kubuntu ubiquity: dmesg(1) may have more information after failed mount system call.
然后我尝试先手动创建分区,然后安装到它们。
首先,我打开分区编辑器,使用 LUKS 创建了一个 LVM 卷,添加了一个卷组,并向其中添加了一个 ext4 分区。这几乎成功了,只是 grub 安装失败,系统日志中出现了以下消息
grub-install: error: attempt to install to encrypted disk without cryptodisk enabled. Set `GRUB_ENABLE_CRYPTODISK=y' in file `/etc/default/grub'.
我尝试在谷歌上搜索了一下这个错误,但无法真正理解结果。我认为棘手的部分是在这种情况下你把 grub 放在哪里。显然,个人 Ubuntu 安装已经将它安装到驱动器 0 的 UEFI 系统分区,但告诉加密安装这样做会失败。请注意,我不想解密工作分区来启动我的个人操作系统。
答案1
我有一个 ventoy 驱动器,里面恰好包含一个适用于 Chromebook 的 Lubuntu iso,我想,为什么不呢。结果发现,无论出于什么原因,Lubuntu 安装程序都没有这个错误,并且会很乐意安装加密的 Lubuntu。我必须采取两个步骤才能让一切按照我喜欢的方式运行。
首先,我不想要 Lubuntu。这个问题可以通过安装ubuntu-desktop
或kubuntu-desktop
删除lubuntu-desktop
其他剩余内容轻松解决。我选择了 Kubuntu,它已经使用 SDDM。您需要在系统设置中将主题切换为 KDE 主题,否则会发生奇怪的事情。
然后,还有 grub 的问题。我现在有一个加密的 grub,它可以启动所有操作系统,但无论如何都需要密码。我有一个未加密的 grub,它看不到加密的安装。我最终添加了一个自定义菜单项到/etc/grub.d/40-custom
:
menuentry "Work Linux" {
insmod part_gpt
insmod search_fs_uuid
insmod chain
search --fs-uuid --no-floppy --set=root 6CB2-14E8
chainloader ($root)/efi/ubuntu/grubx64.efi
}
然后运行sudo update-grub
。现在未加密的 grub 会检测到自己的安装,即 Windows,并且可以链式加载到加密磁盘中,然后会提示输入密码。
注意:UUID 来自ls -l /dev/disk/by-uuid
如果不是因为 Lubuntu 运气不好,我可能会移除另一个驱动器。但这仍然会留下链式加载问题。无论如何,现在一切似乎都正常了。