Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm trying to automate reinstall process of existing ubuntu installation.

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 acomplish is :

  • reuse existing raids if they exists

Most important is to keep data on existing PV. I was able to accomplish that by setting filter in lvm.conf, which exludes all block devices, ergo lvm support is disabled.

Problem is, after installation I have to recreate /dev/md/2, hoping that data is intact.

preseed part config 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 slove this problem?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.