I have tried to research this in the past but ran into trouble when trying to create separate LVM partitions. I can work just fine when you use a single "atomic" partition and I guess this is how the devs tested it...but when it comes to multiple, separate partitions, it broke for me in 16.04. I never found a workable solution with preseed and multi-partition. I have not researched it in 18.04 since I use a pre-configured server as a template and vmware just rolls them out with a simple deploy command.
But here is some of the information I gathered while chatting in the member's only area:
Appendix B. Automating the installation using preseeding
AskUbuntu.com Question that was self-answered
Preseed example 1
Preseed example 2 (look at the forks for more variations)
Article covering the 3 numbers in the partition setup
And here is the recipe I was trying to make work (however, with 18.04, we do not need the swap partition anymore since it can be file-based):
Code:
d-i partman-auto/expert_recipe string prod-server :: \
500 500 500 ext2 \
$primary{ } \
$bootable{ } \
$lvmignore{ } \
method{ format } \
format{ } \
use_filesystem{ } \
filesystem{ ext2 } \
mountpoint{ /boot } \
label{ boot } \
.\
120% 2048 120% linux-swap \
$lvmok{ } \
format{ } \
in_vg{ LVG } \
lv_name{ swap } \
method{ swap } \
.\
2000 2000 2000 ext4 \
$defaultignore{ } \
$lvmok{ } \
method{ format } \
format{ } \
use_filesystem{ } \
filesystem{ ext4 } \
in_vg{ LVG } \
lv_name{ root } \
mountpoint{ / } \
label{ root } \
.\
200 200 200 ext4 \
$defaultignore{ } \
$lvmok{ } \
method{ format } \
format{ } \
use_filesystem{ } \
filesystem{ ext4 } \
in_vg{ LVG } \
lv_name{ home } \
mountpoint{ /home } \
label{ home } \
.\
500 500 500 ext4 \
$defaultignore{ } \
$lvmok{ } \
method{ format } \
format{ } \
use_filesystem{ } \
filesystem{ ext4 } \
in_vg{ LVG } \
lv_name{ tmp } \
mountpoint{ /tmp } \
label{ tmp } \
options/relatime{ relatime } \
options/noexec{ noexec } \
options/rw{ rw } \
.\
2000 2000 2000 ext4 \
$defaultignore{ } \
$lvmok{ } \
method{ format } \
format{ } \
use_filesystem{ } \
filesystem{ ext4 } \
in_vg{ LVG } \
lv_name{ usr } \
mountpoint{ /usr } \
label{ usr } \
.\
2000 2000 2000 ext4 \
$defaultignore{ } \
$lvmok{ } \
method{ format } \
format{ } \
use_filesystem{ } \
filesystem{ ext4 } \
in_vg{ LVG } \
lv_name{ var } \
mountpoint{ /var } \
label{ var } \
.\
200 200 200 ext4 \
$defaultignore{ } \
$lvmok{ } \
method{ format } \
format{ } \
use_filesystem{ } \
filesystem{ ext4 } \
in_vg{ LVG } \
lv_name{ srv } \
mountpoint{ /srv } \
label{ srv } \
.\
200 200 200 ext4 \
$defaultignore{ } \
$lvmok{ } \
method{ format } \
format{ } \
use_filesystem{ } \
filesystem{ ext4 } \
in_vg{ LVG } \
lv_name{ opt } \
mountpoint{ /opt } \
label{ opt } \
.\
500 500 500 ext4 \
$defaultignore{ } \
$lvmok{ } \
method{ format } \
format{ } \
use_filesystem{ } \
filesystem{ ext4 } \
in_vg{ LVG } \
lv_name{ bak } \
mountpoint{ /bak } \
label{ bak } \
.\
Bookmarks