A couple of weeks ago I asked about configuring Ubuntu preseed to configure LVM partitions. I got no response to that one.
I was able to figure out how to get logical volumes defined for UEFI within a preseed file for Ubuntu 16.04 desktop. Now I'm trying to set up the physical volume on which the root logical volume (/) resides. I don't expect an answer, but I have to try. :)
The following d-i directives in my preseed file work for configuring LVM and all of my filesystems on an UEFI based virtual machine.
# Partitioning
d-i partman-auto/disk string /dev/sda
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-lvm/confirm boolean true
d-i partman/confirm_write_new_label boolean true
d-i partman-basicfilesystems/choose_label string gpt
d-i partman-basicfilesystems/default_label string gpt
d-i partman-partitioning/choose_label string gpt
d-i partman-partitioning/default_label string gpt
d-i partman/choose_label string gpt
d-i partman/default_label string gpt
d-i partman-auto-lvm/guided_size string max
d-i partman-auto/method string lvm
d-i partman-auto-lvm/new_vg_name string vg00
d-i partman-auto/choose_recipe select gpt-boot-root-swap
d-i partman-auto/expert_recipe string \
gpt-boot-root-swap :: \
512 512 512 fat32 \
$primary{ } \
method{ efi } format{ } . \
1024 1024 1024 ext2 \
$primary{ } $bootable{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext2 } \
mountpoint{ /boot } . \
1000 1000 1000000000 ext4 \
$defaultignore{ } \
$primary{ } \
method{ lvm } \
device{ /dev/sda } \
vg_name{ vg00 } \
. \
1024 3072 10240 ext4 \
$lvmok{ } \
in_vg{ vg00 } lv_name{ lv_root } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ / } . \
1024 1024 1000000000 ext4 \
$lvmok{ } \
$defaultignore{ } \
in_vg{ vg00 } lv_name{ lv_delete } \
.
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
I've been trying to add encryption to /dev/sda3, which is the physical volume associated with the vg00 volume group on which lv_root is created. I have added the following directives into the preseed file
d-i partman-auto/method string crypto
d-i partman-crypto/create/partitions select /dev/sda3
d-i partman-crypto/keytype select passphrase
d-i partman-crypto/keyhash select sha512
d-i partman-crypto/keysize select 512
d-i partman-crypto/cipher select aes-xts-plain64
d-i partman-crypto/passphrase string ThisIsATest
d-i partman-crypto/passphrase-again string ThisIsATest
I found the above by piecing together bits and pieces I able to put together by doing web searches.
As an aside, Canonical, if Ubuntu is really your bread and butter, why don't you have better documentation? Everything I have found has been from places other than any Ubuntu website.
I know there are things missing, but I do not know what those d-i directives would be. For example, what is the d-i partman-crypto directive to name the encrypted volume? I'm sure that's needed here. I'm sure that is why when I try to boot off of my custom ISO I eventually get the error message
No physical volume defined in volume group
The automatic partitioning recipe contains the definition of a
volume group that does not contain any physical volume.
Please check the automatic partitioning recipe
Like I said at the beginning, I do not expect anyone to answer this question since it's even more niche than my automatic partitioning LVM preseeding question, but I have to try.
Thank you in advance for any help you can provide.