Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

So my question is, Is it possible to install the EFI partition onto both drives when doing a seed install on Ubuntu? That way if one drive goes, the relevant efi partition/data is there on the second drive, and it can just boot off that. Or is it only possible to install it to the first drive. Here's my working seed file to install it only to the first drive, setup RAID 1 and LVM. But I'd like to know how to do both

d-i     partman-md/device_remove_md                   boolean true 
d-i     partman-lvm/device_remove_lvm                 boolean true
d-i     partman-lvm/confirm                           boolean true
d-i     partman-auto/disk                             string /dev/sda /dev/sdb
d-i     partman-auto/method                           string raid
d-i     partman-auto-lvm/new_vg_name                  string vg0
d-i     partman-auto-lvm/guided_size                  string 90%
d-i     partman-auto/expert_recipe string \
    efi-lvm ::      \
1 1 1 free            \
    $bios_boot{ }       \
    method{ biosgrub }  \
.                       \
256 10 256 fat32        \
    $primary{ }         \
    $lvmignore{ }       \
    method{ efi }       \
    format{ }           \
.\
    20000 30 1000000000 raid    \
    \$lvmignore{ }      \
    \$primary{ }        \
    method{ raid }      \
    .\
    20000 50 400000 ext4    \
    \$defaultignore{ }  \
    \$lvmok{ }      \
    lv_name{ root }     \
    method{ format }    \
    format{ }       \
    use_filesystem{ }   \
    filesystem{ ext4 }  \
    mountpoint{ / }     \
    label{ Root }       \
    .\
    2048 40 2048 swap   \
    \$defaultignore{ }  \
    \$lvmok{ }      \
    lv_name{ swap }     \
    method{ swap }      \
    format{ }       \
    .

d-i     partman-auto-raid/recipe string \
    1 2 0 lvm - /dev/sda2#/dev/sdb2 \
    .
d-i     partman-md/confirm                            boolean true

d-i     partman-partitioning/confirm_write_new_label  boolean true
d-i     partman/choose_partition                      select Finish partitioning and     write changes to disk
d-i     partman/confirm                               boolean true
d-i     partman-md/confirm_nooverwrite                boolean true
d-i     partman/confirm_nooverwrite                   boolean true
d-i     mdadm/boot_degraded             boolean true

I also have the following in ny seed file to sum up the drives and trash any lvm bits.

 d-i partman/early_command \
      string debconf-set partman-auto/disk "\$(list-devices disk | head -n1)"

d-i partman/early_command string vgs -separator=: -noheadings | cut -f1 -d: | while     read vg ; do vgchange -an \$vg ; done ; pvs -separator=: -noheadings | cut -f1 -d: |     while read pv ; do pvremove -ff -y \$pv ; done
share|improve this question

1 Answer 1

Found the winning combo for my situation. This trashes all Raid/Physical Partitions/LWM, etc so the seed install starts out with a totally clean slate. Tested and confirmed on multiple boxes with multiple partition schemes in place.

# Disk Partitioning
# Use LVM, and wipe out anything that already exists
d-i partman/early_command string vgs -separator=: -noheadings | cut -f1 -d: | while     read vg ; do vgchange -an \$vg ; done ; pvs -separator=: -noheadings | cut -f1 -d: |     while read pv ; do pvremove -ff -y \$pv ; done

d-i partman/early_command \
     string /bin/dd if=/dev/zero of=/dev/sda bs=512 count=1

d-i partman/early_command \
     string /bin/dd if=/dev/zero of=/dev/sdb bs=512 count=1

# Disk Partitioning

d-i     partman-lvm/device_remove_lvm                 boolean true
d-i     partman-md/device_remove_md                   boolean true
d-i     partman-lvm/confirm                           boolean true
d-i     partman-auto/disk                             string /dev/sda /dev/sdb
d-i     partman-auto/method                           string raid
d-i     partman-auto-lvm/new_vg_name                  string vg0
d-i     partman-auto-lvm/guided_size                  string 90%
d-i     partman-auto/expert_recipe string \
    efi-lvm ::      \
256 10 256 fat32        \
    \$primary{ }         \
    \$lvmignore{ }       \
    method{ efi }       \
    format{ }           \
.\
    20000 30 1000000000 raid    \
    \$lvmignore{ }      \
    \$primary{ }        \
    method{ raid }      \
    .\
    20000 50 400000 ext4    \
    \$defaultignore{ }  \
    \$lvmok{ }      \
    lv_name{ root }     \
    method{ format }    \
    format{ }       \
    use_filesystem{ }   \
    filesystem{ ext4 }  \
    mountpoint{ / }     \
    label{ Root }       \
    .\
    2048 40 2048 swap   \
    \$defaultignore{ }  \
    \$lvmok{ }      \
    lv_name{ swap }     \
    method{ swap }      \
    format{ }       \
    .

d-i     partman-auto-raid/recipe string \
    1 2 0 lvm - /dev/sda2#/dev/sdb2 \
    .
d-i     partman-md/confirm                            boolean true

d-i     partman-partitioning/confirm_write_new_label  boolean true
d-i     partman/choose_partition                      select Finish partitioning and     write changes to disk
d-i     partman/confirm                               boolean true
# d-i     partman-md    partman-md/confirm_nochanges    boolean false
d-i     partman-md/confirm_nooverwrite                boolean true
d-i     partman/confirm_nooverwrite                   boolean true
d-i     mdadm/boot_degraded             boolean true

And there you go. It creates VG-root and swap across a raid 1 partition across two disks, along with having a partition on each disk suitable for EFI. Ask any questions if you need to. I've got a better hang on this now, and can answer some relating to Ubuntu seed disk configuration on Trusty 14.04 LTS

Thanks

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.