I'm trying to automate the reinstallation process of existing Ubuntu installations.
Partition layout:
- md0( raid1, /dev/sda1#/dev/sdb1 ) - swap (2G)
- md1( raid1, /dev/sda2#/dev/sdb2 ) - / (20G)
- md2( raid1, /dev/sda3#/dev/sdb3 ) - PV (remaining space)
What I want to accomplish is:
- reuse existing RAIDs if they exist
Most important is to keep the data on existing PVs. I was able to accomplish that by setting a filter in lvm.conf, which excludes all block devices, ergo lvm support is disabled.
The problem is that after the installation I have to recreate /dev/md/2, hoping that data is intact.
The preseeding part of the configuration is:
d-i partman/early_command string sed 's/filter\ =\ \[\ "a\/.*\/\"\ \]/filter\ =\ \[\ "r\/.*\/\"\ \]/g' -i /etc/lvm/lvm.conf
d-i partman-auto-raid/recipe string \
1 2 0 swap - /dev/sda1#/dev/sdb1 .\
1 2 0 ext3 / /dev/sda2#/dev/sdb2 .
d-i partman-auto/expert_recipe string \
multiraid :: \
2000 10 2000 raid $primary{ } method{ raid } format{ } .\
20000 11 20000 raid $primary{ } method{ raid } format{ } . \
20000 12 2000000 raid $primary{ } method{ keep } .
Maybe there is some other, more deterministic way to solve this problem?