[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Preseed: Expert recipe with LVM in partman-auto fails to format disk



Still stuck on this one... I would really appreciate some insight... Is what I'm trying to do possible with preseed and partman?

Le 23/01/2021 à 19:15, Antoine Mazeas a écrit :

As a follow-up, the following recipe (a truncated version of the original in OP) results in a wrong partitioning:

d-i partman-auto/expert_recipe string \
  large-varlibdocker :: \
    512 512 512 ext4 $primary{ } label{ boot } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /boot } . \
    2048 2048 2048 linux-swap $lvm_ok{ } method{ swap } format{ } in_vg{ vg } . \
    1024 1024 1024 ext4 $lvm_ok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } in_vg{ vg } lv_name{ root } mountpoint{ / } . \
    512 512 512 ext4 $lvm_ok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } in_vg{ vg } lv_name{ tmp } mountpoint{ /tmp } .

Result (maybe looking like a default recipe or something):

root@debian:~# lvs
  LV     VG Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root   vg -wi-ao----   6.56g
  swap_1 vg -wi-ao---- 980.00m

If I add one more line, I have the original error (Failed to partition the selected disk).

Le 23/01/2021 à 16:20, Antoine Mazeas a écrit :

Hi Nicholas,

(i'm pasting in your queries as I'm not a subscriber and you didn't cc my address in your replies)

What is the meaning of the $lvmignore keyword on this entry right below? It's the only time it appears here.
And it's not present in your 2nd example that does work.

According to https://salsa.debian.org/installer-team/debian-installer/-/blob/master/doc/devel/partman-auto-recipe.txt

$lvmignore{_}
	Used to void a partition definition so that it is ignored in the
	LVM case. That is to say it will be valid in the default case.

Removing it did not affect the outcome...

This may not be related, but notice also that the primary /boot which fails is an ext4 filesystem. But the example which succeeds, that one filesystem only is ext2, the rest are ext4 like yours.

Thanks for pointing it out; however the "working" recipe also succeeds with ext4 for /boot...

Antoine

Le 22/01/2021 à 23:13, Antoine Mazeas a écrit :
Dear Debian Users,

For quite some time, I am failing to make partman process a custom expert recipe during an unattended (preseeded) installation.

I am setting up a VM with an 8000 MB disk space (single disk) that I want to partition using LVM. However, every time the recipe runs, I end up getting an error from partman which I don't understand:

> Failed to partition the selected disk

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

Here's my full recipe and other partman options

# partitions
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
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/new_vg_name string vg
d-i partman-md/device_remove_md boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/default_filesystem string ext4
d-i partman-auto/expert_recipe string \
  large-varlibdocker :: \
    512 512 512 ext4 $primary{ } $lvmignore{ } label{ boot } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /boot } . \
    2048 2048 2048 linux-swap $lvm_ok{ } method{ swap } format{ } in_vg{ vg } . \
    1024 1024 1024 ext4 $lvm_ok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } in_vg{ vg } lv_name{ root } mountpoint{ / } . \
    512 512 512 ext4 $lvm_ok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } in_vg{ vg } lv_name{ tmp } mountpoint{ /tmp } . \
    512 512 512 ext4 $lvm_ok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } in_vg{ vg } lv_name{ varlog } mountpoint{ /var/log } . \
    512 512 512 ext4 $lvm_ok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } in_vg{ vg } lv_name{ backup } mountpoint{ /backup } . \
    512 513 -1 ext4 $lvm_ok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } in_vg{ vg } lv_name{ varlibdocker } mountpoint{ /var/lib/docker } .


For sanity's sake, I could get this recipe to work... (inspired from lists.debian.org/debian-user/2014/12/msg00651.html):

d-i partman-auto/expert_recipe string \
  lvm-multi :: \
    512 512 512 ext2 $primary{ } label{ boot } method{ format } format{ } use_filesystem{ } filesystem{ ext2 } mountpoint{ /boot } . \
    2048 4096 4096 linux-swap $lvmok{ } method{ swap } format{ } . \
    1024 20480 20480 ext4  $lvmok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ / } . \
    1024 20480 20480 ext4  $lvmok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /var } . \
    64 64 64 ext4  $lvmok{ } method{ format } format{ } use_filesystem{ } filesystem{ ext4 } mountpoint{ /home } .


But I seem to be unable to modify it any further (like adding a partition) without triggering the error mentioned above.

Any help or pointer appreciated...

Antoine



Reply to: