Debian 11 预装了 LUKS 和 LVM

Debian 11 预装了 LUKS 和 LVM

我一直在尝试使用预置在裸机上自动安装 Debian,但却无法正确地对文件系统进行分区。

我想要的是:

EFI Boot Swap 加密 FDE,带有根分区和 /var 分区。均在 ext4 上

我得到的是:

安装期间出现分区错误: this probably happened because there are too many (primary) partitions in the partition table

我如何努力

# The disk to partition
d-i partman-auto/disk string /dev/nvme0n1

# LVM with LUKS
d-i partman-auto/method string crypto
d-i partman-crypto/passphrase string inscure
d-i partman-crypto/passphrase-again string insecure
d-i partman-crypto/weak_passphrase boolean true
d-i partman-crypto/confirm boolean true
d-i partman-auto-crypto/erase_disks boolean false
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-auto-lvm/guided_size string max
d-i partman-auto-lvm/new_vg_name string crypt
d-i partman-auto/choose_recipe select root-crypto
d-i partman-auto/expert_recipe string \
      root-crypto :: \
              538 538 1075 free \
#                    $primary{ } \
                    $iflabel{ gpt } \
                    $reusemethod{ } \
                    method{ efi } format{ } \
              . \
              256 512 512 ext2 \
#                    $primary{ } \
                    $defaultignore{ } \
                    method{ format } format{ } \
                    use_filesystem{ } filesystem{ ext2 } \
                    mountpoint{ /boot } \
              . \
              8192 16384 16386 linux-swap \
                    $lvmok{ } \
                    in_vg { crypt } \
                    lv_name{ swap } \
                    method{ swap } format{ } \
              . \
              16384 16385 32768 ext4 \
                    $lvmok{ } lv_name{ root } \
                    in_vg { crypt } \
#                    $primary{ } \
                    method{ format } format{ } \
                    use_filesystem{ } filesystem{ ext4 } \
                    mountpoint{ /var } \
              . \
              32768 65536 131072 ext4 \
                    $lvmok{ } lv_name{ root } \
                    in_vg { crypt } \
#                    $primary{ } $bootable{ } \
                    method{ format } format{ } \
                    use_filesystem{ } filesystem{ ext4 } \
                    mountpoint{ / } \
              . \

# This makes partman automatically partition without confirmation, provided
# that you told it what to do using one of the methods above.
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true

# Force UEFI booting ('BIOS compatibility' will be lost). Default: false.
d-i partman-efi/non_efi_system boolean false
d-i partman-partitioning/choose_label select gpt
d-i partman-partitioning/default_label string gpt

我目前正在用 USB 棒进行测试。一旦我有了可运行的预置,我就会转到网络 PXE。

提前感谢您的帮助。

答案1

好吧,只需更改 var 上的映射器名称,现在一切就好了。供参考:

# The disk to partition
d-i partman-auto/disk string /dev/nvme0n1

# LVM with LUKS
d-i partman-auto/method string crypto
d-i partman-crypto/passphrase string inscure
d-i partman-crypto/passphrase-again string insecure
d-i partman-crypto/weak_passphrase boolean true
d-i partman-crypto/confirm boolean true
d-i partman-auto-crypto/erase_disks boolean false
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-auto-lvm/guided_size string max
d-i partman-auto-lvm/new_vg_name string crypt
d-i partman-auto/choose_recipe select root-crypto
d-i partman-auto/expert_recipe string \
      root-crypto :: \
              538 538 1075 free \
                    $primary{ } \
                    $iflabel{ gpt } \
                    $reusemethod{ } \
                    method{ efi } format{ } \
              . \
              256 512 512 ext2 \
                    $primary{ } \
                    $defaultignore{ } \
                    method{ format } format{ } \
                    use_filesystem{ } filesystem{ ext2 } \
                    mountpoint{ /boot } \
              . \
              8192 16384 16386 linux-swap \
                    $lvmok{ } \
                    in_vg { crypt } \
                    lv_name{ swap } \
                    method{ swap } format{ } \
              . \
              16384 16385 32768 ext4 \
                    $lvmok{ } lv_name{ var } \
                    in_vg { crypt } \
                    $primary{ } \
                    method{ format } format{ } \
                    use_filesystem{ } filesystem{ ext4 } \
                    mountpoint{ /var } \
              . \
              32768 65536 131072 ext4 \
                    $lvmok{ } lv_name{ root } \
                    in_vg { crypt } \
                    $primary{ } $bootable{ } \
                    method{ format } format{ } \
                    use_filesystem{ } filesystem{ ext4 } \
                    mountpoint{ / } \
              . \

# This makes partman automatically partition without confirmation, provided
# that you told it what to do using one of the methods above.
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true

# Force UEFI booting ('BIOS compatibility' will be lost). Default: false.
d-i partman-efi/non_efi_system boolean false
d-i partman-partitioning/choose_label select gpt
d-i partman-partitioning/default_label string gpt

具体改为

$lvmok{ } lv_name{ var }

$lvmok{ } lv_name{ root }

As / 已经有根加密映射器名称

相关内容