如何在 partman-auto 中使用方法“keep”?

如何在 partman-auto 中使用方法“keep”?

我有一个预置配置,它对磁盘布局有特定要求,包括分区大小。partman-auto 不尊重磁盘上最后一个分区的最大分区大小。https://wikitech.wikimedia.org/wiki/PartMan/Auto解释这一点以及假定的解决方法:

5. LIMITATIONS
--------------

Due to limitation of the algorithms in partman-auto, there must be at
least one partition with high maximal size so that the whole free
space can be used.  Usually you can give the partition containing
/home a maximal size 1000000000 which is high enough for the present
storage devices. If the large /home is not an option for you, you can
also define in the recipe one additional partition with size
1000000000, method "keep" and leave it unmounted.  When the
installation completes you can remove it.

Do not use higher than 1000000000 numbers because the shell arithmetic
is limited to 31 bits (on i386).

不幸的是,文档中没有任何地方解释“在配方中定义一个大小为 1000000000 的附加分区,方法为“保留”并将其卸载”的实际含义

我尝试过添加

1 1000000000 1000000000 ext4 \
    method { keep } \
.

到我的分区配方的末尾,但这完全没有任何作用(我也尝试过“none”和“linux”而不是“ext4”,也没有任何效果)并且不知道如何继续。

答案1

以下partman方法对我有用。我尝试安装 Ubuntu 20.04

d-i partman-auto/expert_recipe string \
        efi-boot-root :: \
              256 256 256 fat32 \
                      method{ efi } \
                      format{ } \
              . \
              1024 1024 1024 ext4 \
                      $bootable{ } \
                      method{ format } \
                      format{ } \
                      use_filesystem{ } \
                      filesystem{ ext4 } \
                      mountpoint{ /boot } \
              . \
              8192 1024 8192 ext4 \
                      method{ format } \
                      format{ } \
                      use_filesystem{ } \
                      filesystem{ ext4 } \
                      mountpoint{ / } \
              . \
              8192 1024 1000000000 ext2 \
                      method{ keep } \
              .

我还必须添加此设置以避免没有为分区指定文件系统提示有关最终分区。

d-i partman-basicmethods/method_only boolean false

这是安装后的磁盘分区。“保留”分区填充了磁盘上的剩余空间。

Number  Start   End     Size    File system  Name                  Flags
 1      1049kB  256MB   255MB   fat32        EFI System Partition  boot, esp
 2      256MB   1280MB  1024MB  ext4
 3      1280MB  9473MB  8193MB  ext4
 4      9473MB  21.5GB  12.0GB

相关内容