1

I want to write a partman recipe in my Ubuntu 12.04 server installer preseed file to partiton my disk. I want it to make the following partitions:

  1. BIOS boot area for supporting GPT type partition tables, 32MB
  2. root file system, ext4, 30 GB
  3. /data, ext4, remaining space
  4. swap, 24 GB (3*RAM)

The first three partitions are created, the last one is not and the swap space is wrong too. I get the following on a 4TB drive:

  1. BIOS boot area for supporting GPT type partition tables, 32MB
  2. root file system, ext4, 30 GB
  3. one 100 GB partition of type 0700, "Microsoft basic data"
  4. swap, 23GB

So my questions are:

  1. Why is the type of partition 3 wrong?
  2. Why does partition 3 not fill the rest of the drive?

Here is my recipe as it looks now:

d-i partman-auto/expert_recipe string                         \
  boot-root ::                                            \
          32 32 32 free                                  \
                  $gptonly{ }                            \
                  $primary{ }                            \
                  $bios_boot{ }                          \
                  method{ biosgrub }                     \
          .                                              \
          500 10000 30720 ext4                            \
                  $primary{ } $bootable{ }                \
                  method{ format } format{ }              \
                  use_filesystem{ } filesystem{ ext4 }    \
                  mountpoint{ / }                         \
          .                                               \
          500 10000 -1 ext4                               \
                  $primary{ }                             \
                  method{ format } format{ }              \
                  use_filesystem{ } filesystem{ ext4 }    \
                  mountpoint{ /data }                     \
          .                                               \
          64 10000 24576 linux-swap                       \
                  method{ swap } format{ }                \
          .                                               \

I've tried reordering the partitions in the recipe, but no luck.

1 Answer 1

4

the problem is, that the partitions are created in the order you have them. your data partition uses the entire space left.

as a solution move up the swap part above the data partition. i also added the primary tag to the swap section. you can have up to 4 primary partitions.

d-i partman-auto/expert_recipe string                         \
 boot-root ::                                            \
      32 32 32 free                                  \
              $gptonly{ }                            \
              $primary{ }                            \
              $bios_boot{ }                          \
              method{ biosgrub }                     \
      .                                              \
      500 10000 30720 ext4                            \
              $primary{ } $bootable{ }                \
              method{ format } format{ }              \
              use_filesystem{ } filesystem{ ext4 }    \
              mountpoint{ / }                         \
      .                                               \
      64 10000 24576 linux-swap                       \
              $primary{ }                             \
              method{ swap } format{ }                \
      .                                               \
      500 10000 -1 ext4                               \
              $primary{ }                             \
              method{ format } format{ }              \
              use_filesystem{ } filesystem{ ext4 }    \
              mountpoint{ /data }                     \
      .                                               \

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .