Partman 和 preseed,分区错误

Partman 和 preseed,分区错误

我正在尝试进行无人值守的 Ubuntu 安装,但我的 expert_recipe 不起作用。

关于我的预种的摘录:

### Partitioning
d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string regular
d-i partman-auto/purge_lvm_from_device boolean true
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-auto/expert_recipe                                \
      string boot-root ::                                     \
              40000 50 50000 ext4                             \
                      $primary{ } $bootable{ }                \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext4 }    \
                      mountpoint{ / }                         \
              .                                               \
              4000 500 5000 linux-swap                        \
                      method{ swap } format{ }                \
              .                                               \
              20000 1000 30000 ext4                           \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext4 }    \
                      mountpoint{ /var/lib/docker }           \
              .                                               \
              5000 1001 100% ext4                             \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext4 }    \
                      mountpoint{ /data }                     \
              .                                               \
#d-i partman-auto/choose_recipe select boot-root
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

我得到了如下分区模式:

sda1 / ext
sda5 swap

答案1

### Partitioning
# use first hard drive SCSI/SATA:
d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string regular
d-i partman-auto/purge_lvm_from_device boolean true
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-auto/choose_recipe select atomic
d-i partman-auto/expert_recipe string                         \
      boot-root ::                                            \
              42950 30720 1000000000 ext4                     \
                      $primary{ }                             \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext4 }    \
                      mountpoint{ / }                         \
              .                                               \
              50% 4096 50% linux-swap                         \
                      method{ swap } format{ }                \
              .                                               \
              21474 30720 22000 ext4                          \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext4 }    \
                      mountpoint{ /var/lib/docker }           \
              .                                               \
              5368 30720 -1 ext4                              \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext4 }    \
                      mountpoint{ /data }                     \
              .                                               \

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

这个运行良好。允许 50% 的内存大小用于交换。

相关内容