EFI 和工作 LVM partman-auto/expert_recipe?

far*_*any 5 partitioning lvm preseed uefi

我有一个基于 LVM 的配方,用于在非基于 EFI 的系统上工作。如何重新创建相同的配方,使其在 EFI/UEFI 模式下工作?

我现在有以下配方(我也尝试过其他配方),但它失败并显示以下消息:“尝试在 SCSI5 (2,0,0) 分区 #1 (sda) 中安装类型为 vfat 的文件系统) 在 /boot/efi 失败。”

d-i partman-auto/expert_recipe string                        \
  boot-root-swap ::                                      \
          200 50 200 ext2                                \
                  $primary{ }                            \
                  $bootable{ }                           \
                  method{ format } format{ }             \
                  use_filesystem{ } filesystem{ ext2 }   \
                  mountpoint{ /boot }                    \
          .                                              \
          48000 70 1000000000 ext4                       \
                  $defaultignore{ }                      \
                  $lvmok{ }                              \
                  lv_name{ base }                        \
                  method{ format }                       \
                  format{ }                              \
                  use_filesystem{ }                      \
                  filesystem{ ext4 }                     \
                  mountpoint{ / }                        \
          .                                              \
          8000 60 24000 linux-swap                       \
                  $defaultignore{ }                      \
                  $lvmok{ }                              \
                  lv_name{ swap }                        \
                  method{ swap }                         \
                  format{ }                              \
          .
Run Code Online (Sandbox Code Playgroud)

Dav*_*ave 1

您需要创建一个EFI系统分区。然后安装程序会将其挂载到/boot/efi。

添加一些东西以达到...的效果

 1 1 1 free            \
    $bios_boot{ }       \
    method{ biosgrub }  \
.                       \
256 40 256 fat32        \
    $primary{ }         \
    $lvmignore{ }       \
    method{ efi }       \
    format{ }           \
.
Run Code Online (Sandbox Code Playgroud)

...在 Expert_recipe 的开头将创建一个 256MB 的分区(例如 /dev/sda1),该分区将为 EFI 设置。第一个分区(优先级 1)之前还有 1MB 的可用空间。如果您想要在使用 GPT 分区的系统上安装 GRUB,则需要执行此操作,因为 GPT 超出了 512K MBR 的大小。