Ubuntu预先安装。 /和/ tmp的50%

时间:2012-01-10 08:13:30

标签: ubuntu install partitioning

我需要将preseed文件和部分磁盘的ubuntu服务器10.04安装到50%/ /和/ tmp。我试过这个:

    # 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

# Actualy use 50% for / and rest 50% for /LOGS
d-i partman-auto/expert_recipe string                         \
      boot-root ::                                            \
              2048 50% 1000000000 ext4                        \
                      $primary{ }                             \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext4 }    \
                      mountpoint{ / }                         \
              .                                               \
              2048 50% -1 ext4                                \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext4 }    \
                      mountpoint{ /TMP}                       \
              .                                               \
              50% 4096 50% linux-swap                         \
                      method{ swap } format{ }                \
              .

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

谁能告诉我,为什么它不起作用?它只能创建1.9 Gb到/和/ tmp。

谢谢!

1 个答案:

答案 0 :(得分:0)

似乎我解决了这个问题。我应该使用数字值代替百分比。

# 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

# Actualy use 50% for / and rest 50% for /TMP
d-i partman-auto/expert_recipe string                         \
      boot-root ::                                            \
              2048 30720 1000000000 ext4                      \
                      $primary{ }                             \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext4 }    \
                      mountpoint{ / }                         \
              .                                               \
              50% 4096 50% linux-swap                         \
                      method{ swap } format{ }                \
              .                                               \
              2048 30720 -1 ext4                              \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext4 }    \
                      mountpoint{ /TMP }                      \
              .                                               \

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