How do I preseed a disk to 50% / and /tmp?

6,408

Solution 1

It seems that I solve that problem. I should use digital values instead of percentage.

# 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

Solution 2

It looks like your definitions are wrong, so partman might be misinterpreting it. If you look at the spec (e.g. here) then the order of the limits is:

<minimal size> <priority> <maximal size> <parted fs>

So your initial version had a "50%" priority. Your swap was correct (according to the spec) but gave a swap partition that was 50% of the size of your memory (so 1GB if you had 2GB RAM) with a priority of 4096.

Share:
6,408

Related videos on Youtube

Erick Jimenez
Author by

Erick Jimenez

Updated on September 18, 2022

Comments

  • Erick Jimenez
    Erick Jimenez over 1 year

    I need to install ubuntu server 10.04 by preseed file and part disk into 50% for / and rest for /tmp. I tried this:

        # 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
    

    Can anyone tell me, why it doesn't works? It creates only 1.9 Gb to / and /tmp.

    Thanks!

    • psusi
      psusi over 12 years
      Why on earth do you want a dedicated and very large /tmp partition? Normally /tmp is mounted as a tmpfs so its contents are kept in ram/swap for fast access. Putting it on a hard disk will slow things down, and using such a large and dedicated partition for it makes it more likely that one or the other partition will fill up while there is plenty of space on the other.
  • MaXi32
    MaXi32 about 3 years
    I'm getting more confuse about the priority when you talking about the size of memory (RAM).
  • MaXi32
    MaXi32 about 3 years
    How can the system determine RAM size with priority..