Debian Preseed use whole device for LVM Physical Volume

debianlvmpreseed

I have the following recipe for a preseed install (truncated for readability):

d-i partman-auto/expert_recipe string \
  boot-root :: \
    1 1 1 free \
      $iflabel{ gpt } \
      $reusemethod{ } \
      method{ biosgrub } \
    . \
    512 512 1074 ext2 \
      $defaultignore{ } \
      method{ format } \
      format{ } \
      use_filesystem{ } \
      filesystem{ ext2 } \
      mountpoint{ /boot } \
    . \
    2147 800 -1 $default_filesystem \
      $lvmok{ } \
      lvm_name { root } \
      method{ format } \
      format{ } \
      use_filesystem{ } \
      $default_filesystem{ } \
      mountpoint{ / } \
    . \
    100% 512 100% linux-swap \
      $lvmok{ } \
      in_vg{ vg_01 } \
      method{ swap } \
      format{ } \
    . \
    100 10000 -1 $default_filesystem \
      $defaultignore{ } \
      method{ lvm } \
      device{ /dev/sdb } \
      vg_name{ vg_01 } \
    [...]
    .

This makes almost what I want, the only issue is that partman-auto creates the Physical Volume inside a partition of /dev/sdb (i.e pvcreate /dev/sdb1).

What I really want is partman-auto to create the PV on the whole device (i.e pvcreate /dev/sdb).

The reason why I want to do this is simple: easy online (hot) extend. (This is for a virtual environment).

I have tried multiple solutions but none of them seems to be working like removing the PV from my recipe and adding to my preseed file:

d-i partman/early_command \
  string dd if=/dev/zero of=/dev/sdb bs=512 count=1; pvcreate -ffy /dev/sdb; vgcreate -fy vg_01 /dev/sdb

But this make the installer either fail or hang asking me what partition layout I want.

Please help me if you know how to accomplish what I want or even if you know that it's impossible with preseed only at this time.

Thank you.

Best Answer

It doesn't seem that partman (Debian Installer tool for partitioning) supports that.

I've filed a wishlist in Debian bug tracker, it's currently marked as "wontfix": https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=418519

Related Topic