[Bug 1012629] Re: grub-installer ignores "bootdev" setting in preseed file
Christofer Bernander
nospam at bernander.net
Thu Jun 25 11:13:57 UTC 2015
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.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub-installer in Ubuntu.
https://bugs.launchpad.net/bugs/1012629
Title:
grub-installer ignores "bootdev" setting in preseed file
Status in grub-installer package in Ubuntu:
Fix Released
Status in grub-installer source package in Precise:
Confirmed
Status in grub-installer source package in Trusty:
Fix Released
Status in grub-installer package in Debian:
Fix Released
Bug description:
I am installing an Ubuntu system with two disks attached; I want the
OS to be installed on the second disk /dev/sdb; the first disk
/dev/sda is currently completely empty (not even partitioned). The
install process works fine, but then GRUB ignores the line:
d-i grub-installer/bootdev string /dev/sdb
and complains that it cannot write to /dev/sda (because it does not
even have a partition table).
Same happens if I use GRUB's own notation "(hd1)" instead of /dev/sdb
in the preseed file.
If I omit the "grub-installer/bootdev" line in the preseed, then D-I
stops to ask me if I want to install GRUB on sda or sdb.
The issue can be replicated with virtual machines: add two disks (one
of the empty / zeroed out), and instruct the preseed to install on the
second one.
I think this is the same as Debian bug #666974, but I'm filing it
separately as I'm not sure what/how much is changed in Ubuntu's
version of D-I. See: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=666974
Preseed options used for partitioning / target selection:
### Partitioning
d-i partman-auto/method string lvm
d-i partman-auto/choose_recipe select atomic
# do not ask for confirmation, ever
d-i partman-basicfilesystem/no_swap boolean false
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/confirm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/exception_handler select Retry
GRUB-related preseed options:
### Boot loader installation
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i grub-installer/bootdev string /dev/sdb
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub-installer/+bug/1012629/+subscriptions
More information about the foundations-bugs
mailing list