0

I need some help with partman-auto custom recipe in preseed.... it's doing unexpected things, the docs aren't so clear.

This is in my preseed file:

d-i partman-auto/expert_recipe string                     \
  boot-root-var ::                                        \
          1024 100 1024 ext4                               \
                  $primary{ } $bootable{ }                \
                  method{ format } format{ }              \
                  use_filesystem{ } filesystem{ ext4 }    \
                  mountpoint{ /boot }                     \
          .                                               \
          2048  50 4096 ext4                              \
                  method{ format } format{ }              \
                  use_filesystem{ } filesystem{ ext4 }    \
                  mountpoint{ / }                         \
          .                                               \
          4096  25 100000 ext4                            \
                  method{ format } format{ }              \
                  use_filesystem{ } filesystem{ ext4 }    \
                  mountpoint{ /var }                      \
          .                                               \
           256  75 100% linux-swap                        \
                  method{ swap } format{ }                \
          .

Given an 80GB drive. I ended up with these partitions:

/     2GB
/boot 1GB
/var  4GB
swap  72GB

What went wrong? What I want is:

/     2GB
/boot 1GB
/var  72GB
swap  4GB
Mark Renouf
  • 1,353
  • 1
  • 16
  • 22

2 Answers2

1

Try this recipe:

d-i partman-auto/expert_recipe string                     \
  boot-root-var ::                                        \
          1024 1024 1024 ext3                             \
                  $primary{ } $bootable{ }                \
                  method{ format } format{ }              \
                  use_filesystem{ } filesystem{ ext4 }    \
                  mountpoint{ /boot }                     \
          .                                               \
          2048  2048 4096 ext3                            \
                  method{ format } format{ }              \
                  use_filesystem{ } filesystem{ ext4 }    \
                  mountpoint{ / }                         \
          .                                               \
          4096  4096 -1 ext3                              \
                  method{ format } format{ }              \
                  use_filesystem{ } filesystem{ ext4 }    \
                  mountpoint{ /var }                      \
          .                                               \
           256  4096 4096 linux-swap                      \
                  method{ swap } format{ }                \
          .

You can find the documentation for these recipes in devel/partman-auto-recipe.txt, but honestly: these partitioning recipes in preseed files are a real pain compared to Kickstart files or setup-storage from FAI.

joschi
  • 20,747
  • 3
  • 46
  • 50
0

I'm having a very similar issue and as of yet have not been able to resolve it. All I want is for my swap partition to end up as the size I've defined.

d-i partman-auto/expert_recipe string \ boot-root :: \ 200 3000 300 ext2 \ $primary{ } $bootable{ } \ method{ format } format{ } \ use_filesystem{ } filesystem{ ext2 } \ mountpoint{ /boot } \ . \ -l 100 -1 ext3 \ $lvmok{ } \ method{ format } format{ } \ use_filesystem{ } filesystem{ ext3 } \ mountpoint{ / } \ . \ 2048 200 2048 linux-swap \ $lvmok{ } \ method{ swap } format{ } \ .

This should result in a swap of 2GB, but instead ends up at nearly 6GB. Before I got to using this current recipe (a few tweaks prior) I once had a 227GB swap partition! My recipe should be creating the swap second to boot, with a size of 2048MB (to the nearest cylinder).