Comment 29 for bug 1012629

Revision history for this message
Christofer Bernander (christoferb) wrote :

I'm also experiencing issues with grub-installer ignoring/overriding the bootdev setting on Ubuntu Server 14.04.2 w/ Software RAID (at least when set using the debconf-set command).

I had to resort to using the same type of workaround as mentioned in post #27, so I thought I'd share some details of it here for reference:

...

# Identify disks larger than 1 TiB
d-i partman/early_command string \
DISKLIST=$(for f in $(list-devices disk); \
do fdisk -l $f 2>/dev/null | sed -nr 's|^Disk (/[^:]+):.* [0-9]{13,} bytes$|\1|p'; done | sort); \
echo "${DISKLIST}" > /tmp/disklist

...

# Manual GRUB installation
d-i grub-installer/skip boolean true
d-i lilo-installer/skip boolean true
d-i preseed/late_command string \
in-target apt-get -y install grub-pc; \
for line in $(cat /tmp/disklist); do in-target grub-install --force "${line}"; done; \
in-target update-grub

...

This works for me on two separate systems where one has the (system) disks on sda+sdb and the other on sdb+sdc.

Here is an expanded version of the first part which includes the partition recipe:

# Identify disks larger than 1 TiB
d-i partman/early_command string \
DISKLIST=$(for f in $(list-devices disk); \
do fdisk -l $f 2>/dev/null | sed -nr 's|^Disk (/[^:]+):.* [0-9]{13,} bytes$|\1|p'; done | sort); \
echo "${DISKLIST}" > /tmp/disklist; \
DISKA=$(echo "${DISKLIST}" | head -n 1); \
DISKB=$(echo "${DISKLIST}" | head -n 2 | tail -n 1); \
debconf-set partman-auto/disk "${DISKA} ${DISKB}"; \
debconf-set partman-auto-raid/recipe "1 2 0 ext2 /boot ${DISKA}2#${DISKB}2 . 1 2 0 ext4 / ${DISKA}3#${DISKB}3 ."

The rest of the partitioning is just a standard 'd-i partman-auto/expert_recipe string multiraid' config that does not need to reference the disk variables.