0

I'm trying to create this scheme with preseed partitioning:

/dev/sda:
   /dev/sda1
     - ext4, /boot, 500MB
   /dev/sda2
     - PV for LVM, 130GB, VG vg00
     - containing LVs root, swap ...
   /dev/sda3
     - PV for LVM, the rest of disk
     - not created VG, just empty physical partition for ocasional vg02

Here is my partitioning template (for Foreman):

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/disk string /dev/sda
d-i partman-auto-lvm/guided_size string max

d-i partman-auto-lvm/new_vg_name string vg00

d-i partman-auto/expert_recipe string \ 
      mypartitioning :: \
              512 512 512 ext2                                \
                      $primary{ }                             \
                      $bootable{ }                            \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext2 }    \
                      mountpoint{ /boot }                     \
              . \
              133120 133120 133120 ext3                       \
                      $defaultignore{ } \
                      $primary{ }                             \
                      method{ lvm }                           \
                      vg_name{ vg00 }                          \
              . \
              1024 1000000000 1000000000 keep               \
                      $primary{ }                             \
                      $defaultignore{ } \
                      method{ lvm }                           \
              . \
              4048 4048 4048 linux-swap                       \
                      $lvmok{ } in_vg{ vg00 }                  \
                      lv_name{ swap }                         \
                      method{ swap } format{ }                \
              . \
              10240 10240 10240 ext4                          \
                      $lvmok{ } in_vg{ vg00 }                  \
                      lv_name{ root }                         \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext4 }    \
                      mountpoint{ / }                         \
              . \
              1 2048 1000000000 ext4 method{ lvm } \
                      $lvmok{ } lv_name{ to_delete } \
                      in_vg{ vg00 } \
              .

d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-lvm/confirm boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select Finish
d-i partman/confirm_nooverwrite boolean true
d-i partman/confirm boolean true

I'm still getting this error:

Failed to partition the selected disc.
This happened because the selected recipe does not contain any partition that can be created on LVM volumes.

Could someone please tell me what is wrong in the recipe? Thanks

  • did you ever solve this ? – Onitlikesonic Apr 26 '18 at 4:15
0

The final recipe we are using is the following:

d-i partman-auto/disk string /dev/sda
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-lvm/guided_size string max

d-i partman-auto/expert_recipe string \
  mypartitioning :: \
          1024 1024 1024 ext2                                \
                  $primary{ }                             \
                  $bootable{ }                            \
                  method{ format } format{ }              \
                  use_filesystem{ } filesystem{ ext2 }    \
                  label{ boot }                           \
                  mountpoint{ /boot }                     \
          . \
          136594 136594 136594 ext4                       \
                  $primary{ }                             \
                  method{ lvm }                           \
                  device{ /dev/sda2 }                     \
                  vg_name{ vg00 }                          \
          . \
          1 1 -1 ext4               \
                  $primary{ }                             \
                  method{ lvm }                           \
                  device{ /dev/sda3 }                     \
                  vg_name{ vg02 }                          \
          . \
          16384 16384 16384 linux-swap                       \
                  $lvmok{ } in_vg{ vg00 }                  \
                  lv_name{ swap }                         \
                  method{ swap } format{ }                \
          . \
          14336 14336 14336 ext4                          \
                  $lvmok{ } in_vg{ vg00 }                  \
                  lv_name{ root }                         \
                  method{ format } format{ }              \
                  use_filesystem{ } filesystem{ ext4 }    \
                  label{ root }                           \
                  mountpoint{ / }                         \
          . \
          1024 1024 1024 ext4                             \
                  $lvmok{ } in_vg{ vg00 }                  \
                  lv_name{ home }                          \
                  method{ format } format{ }              \
                  use_filesystem{ } filesystem{ ext4 }    \
                  label{ home }                            \
                  mountpoint{ /home }                      \
          . \
          2048 2048 2048 ext4                             \
                  $lvmok{ } in_vg{ vg00 }                  \
                  lv_name{ var }                          \
                  method{ format } format{ }              \
                  use_filesystem{ } filesystem{ ext4 }    \
                  label{ var }                            \
                  mountpoint{ /var }                      \
          . \
          6144 6144 6144 ext4                             \
                  $lvmok{ } in_vg{ vg00 }                  \
                  lv_name{ log }                          \
                  method{ format } format{ }              \
                  use_filesystem{ } filesystem{ ext4 }    \
                  label{ log }                            \
                  mountpoint{ /var/log }                      \
          . \
          2048 2048 2048 ext4                             \
                  $lvmok{ } in_vg{ vg00 }                  \
                  lv_name{ audit }                          \
                  method{ format } format{ }              \
                  use_filesystem{ } filesystem{ ext4 }    \
                  label{ audit }                            \
                  mountpoint{ /var/log/audit }                      \
          . \
          1024 1024 1024 ext4                             \
                  $lvmok{ } in_vg{ vg00 }                  \
                  lv_name{ openview }                          \
                  method{ format } format{ }              \
                  use_filesystem{ } filesystem{ ext4 }    \
                  label{ openview }                            \
                  mountpoint{ /var/opt/OV }                      \
          . \
          1024 1024 1024 ext4                             \
                  $lvmok{ } in_vg{ vg00 }                  \
                  lv_name{ appl }                          \
                  method{ format } format{ }              \
                  use_filesystem{ } filesystem{ ext4 }    \
                  label{ appl }                            \
                  mountpoint{ /appl }                      \
          . \
          1 1 -1 ext4                             \
                  $lvmok{ } in_vg{ vg00 }                  \
                  lv_name{ hack }                          \
                  method{ lvm }              \
          .

d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-lvm/confirm boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select Finish
d-i partman/confirm_nooverwrite boolean true
d-i partman/confirm boolean true

The resulting partitioning is the following:

root@xxxxxxxx:~ # lsblk
NAME                MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                   8:0    1 279.4G  0 disk 
├─sda1                8:1    1   976M  0 part /boot
├─sda2                8:2    1 127.2G  0 part 
│ ├─vg00-root       252:0    0  13.4G  0 lvm  /
│ ├─vg00-swap       252:1    0  15.3G  0 lvm  
│ ├─vg00-home       252:2    0   976M  0 lvm  /home
│ ├─vg00-var        252:3    0   1.9G  0 lvm  /var
│ ├─vg00-log        252:4    0   5.7G  0 lvm  /var/log
│ ├─vg00-audit      252:5    0   1.9G  0 lvm  /var/log/audit
│ ├─vg00-openview   252:6    0   976M  0 lvm  /var/opt/OV
│ └─vg00-appl       252:7    0   976M  0 lvm  /appl
└─sda3                8:3    1 151.2G  0 part 

root@xxxxxxxx:~ # pvs
  PV         VG   Fmt  Attr PSize   PFree 
  /dev/sda2  vg00 lvm2 a--  127.21g 86.21g
  /dev/sda3  vg02 lvm2 a--  151.20g 71.20g

The LV hack is deleted in the installation postscript.

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.