Trying to create two LVM groups using Preseed

0

Here's the trick of what I'm trying to do. I have VMs that I'm going to use to test a product feature. Testing that product feature requires that I configure the disks in different ways. My plan is to setup Preseed Files on a webserver that can be manipulated to cause the server to reboot and install w/ the disk configuration I specify.

Here's what I want the disks to be configured:

1) Disk 1 = OS disk. This configuration really won't change, though it needs to be LVM (root & swap)

2) Disk 2 = Whatever I want disk. This needs to be LVM and I need to be able to setup the Partition with different sizes so I can make LVs inside the LVG of different sizes, and multiple LVGs.

What I'm having problems with: This was mostly working in the Preseed file. Then, all of a suddenly, the install started failing with "The automatic partitioning recipe contains the definition of a volume group that does not contain any physical volume."

Can someone tell me what all I'm doing wrong? This has been through several iterations and was mostly working at one point. But, of course, I didn't save that working one off before I started editing it. Also, I'm a newb, so it's pretty possible (and highly likely) that I'm just flat doing something wrong.

Current recipe:

d-i partman-auto/disk string /dev/sda /dev/sdb
d-i partman-auto/method string lvm
d-i partman-auto/purge_lvm_from_device boolean true
d-i partman-auto/choose_recipe select boot-root
d-i partman-auto-lvm/new_vg_name string vg1 vg2


d-i partman-auto/expert_recipe string \
boot-root ::\
128 50 128 ext2\
$primary{ } $bootable{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext2 }\
device{ /dev/sda } \
mountpoint{ /boot }\
. \
6000 50 10000 ext4 \
$defaultignore{ } \
$lvmok{ } \
in_vg{ vg1 } \
device{ /dev/sda } \
lv_name{ root } \
method{ format }\
format{ } \
use_filesystem{ } \
filesystem{ ext4 }\
mountpoint{ / } \
.\
2048 90 2048 linux-swap \
in_vg{ vg1 } \
device{ /dev/sdb } \
method{ swap } format{ } \
. \
1000 50 10000 ext4 \
$primary{ } \
method{ format } format { } \
device{ /dev/sdb } \
vg_name{ vg2 } \
. \
1000 50 10000 ext4 \
$lvmok{ } \
in_vg{ vg2 } \
lv_name{ test } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
label{ testLV } \
mountpoint{ /mnt/testLV } \
.

d-i partman-lvm/confirm boolean true
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/confirm_nooverwrite boolean true
d-i partman/choose_partition select finish
d-i partman/confirm_nooverwrite boolean true
d-i partman/confirm boolean true
d-i partman/confirm_write_new_label boolean true
d-i partman/confirm_write_changes_to_disks_and_configure_lvm boolean true
d-i partman/choose_partition \
select Finish partitioning and write changes to disk

Dan Gentry

Posted 2015-01-23T17:34:31.780

Reputation: 1

in_vg{ vg1 } \

This is the line that seems to be breaking the things... – Dan Gentry – 2015-01-23T19:51:03.527

Answers

0

Wonderful, fussy syntax requirements of preseed partman expert recipes....

1000 50 10000 ext4 \
$primary{ } \
method{ format } format { } \

That space after format { } is breaking it. format{ } will fix it.

Brett

Posted 2015-01-23T17:34:31.780

Reputation: 199

1That's probably correct. I gave up on it.

I figured out a workaround by creating them in the Late commands. – Dan Gentry – 2015-10-02T14:41:14.540

Don't blame you for giving up. The debugging messages aren't very informative and it's trial and error to get a working recipe. – Brett – 2015-10-06T07:21:19.717