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.


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


Even before trying preseed configuration, in manual installation partman is not able to use an existing PV created first by pvcreate /dev/sda and go on with LV defitions.

For partman lack of partition table on main boot disk is a no-go situation.

Recent Linux kernel have fixed reboot requirement after partition table edition. So delete PV partition and create it again larger to match virtual disk size, and run partprobe to inform kernel about its new size to then invoke pvresize /dev/sda1: How to extend a Linux PV partition online after virtual disk growth

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.