2

I'm trying to seed an installation to create the following partition scheme:

  • /dev/sda1 - /boot (Regular)
  • /dev/sda2 - SWAP (Regular)
  • /dev/sda3 - / (LVM)

For this, I'm using the preseed settings below:

...
d-i partman-auto/method string lvm
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true

d-i partman-auto/expert_recipe string                         \
    pvs ::                                                    \
        250 250 250 ext4 $primary{ } $bootable{ }             \
        mountpoint{ /boot }                                   \
        method{ format }                                      \
        format{ }                                             \
        use_filesystem{ }                                     \
        filesystem{ ext4 }                                    \
        device{ /dev/sda1 }                                   \
        .                                                     \
        100% 512 100% linux-swap $primary{ }                  \
        method{ swap }                                        \
        format{ }                                             \
        device{ /dev/sda2 }                                   \
        .                                                     \
        1 1 -1 ext4 $primary{ }                               \
        $primary{ }                                           \
        method{ lvm }                                         \
        device{ /dev/sda3 }                                   \
        vg_name{ default }                                    \
          .                                                   \  
    lvm ::                                                    \
        4096 4096 -1 ext4 $primary { } $lvmok{ }              \
        mountpoint{ / }                                       \
        lv_name{ root }                                       \
        in_vg { default }                                     \
        method{ format }                                      \
        format{ }                                             \
        use_filesystem{ }                                     \
        filesystem{ ext4 }                                    \
        .                                                   
                                                      
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
...

The installation succeeds, but the final layout is all inside LVM. It seems to ignore the device{} definitions.

Does anyone know how to mix regular and LVM partitions in a proper way?

Thanks in advance.

1

This is a recipe I've used. It creates

  • 512MB EFI System Partition
  • 1GB /boot partition
  • partition from the remaining space and LVM volume group
  • logical volume for root (/)
d-i partman-auto/expert_recipe string \
        efi-boot-lvm-root :: \
              512 512 512 fat32 \
                      $primary{ } \
                      method{ efi } \
                      format{ } \
              . \
              1024 1024 1024 ext4 \
                      $primary{ } \
                      $bootable{ } \
                      method{ format } \
                      format{ } \
                      use_filesystem{ } \
                      filesystem{ ext4 } \
                      mountpoint{ /boot } \
              . \
              100 1000 1000000000 $default_filesystem \
                      $defaultignore{ } \
                      $primary{ } \
                      method{ lvm } \
                      device{ /dev/sda } \
                      vg_name{ vg-0 } \
              . \
              1024 3072 -1 $default_filesystem \
                      $lvmok{} \
                      lv_name{ lv-root } \
                      in_vg{ vg-0 } \
                      method{ format } \
                      format{ } \
                      use_filesystem{ } \
                      filesystem{ ext4 } \
                      mountpoint{ / } \
              .

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.