Sample Header Ad - 728x90

install grub bootloader dynamically to multiple disks

4 votes
4 answers
2463 views
I am trying to preseed installing grub dynamically with to two disks with an early_command. I am using IPXE. Here is the relevant part: d-i partman/early_command string \ DISKA=$(realpath /dev/disk/by-id/ata-SuperMicro_SSD_* /dev/disk/by-id/ata-SATA_SSD_*|grep -o '/dev/sd[a-z]'|uniq|sort|head -n1); \ DISKB=$(realpath /dev/disk/by-id/ata-SuperMicro_SSD_* /dev/disk/by-id/ata-SATA_SSD_*|grep -o '/dev/sd[a-z]'|uniq|sort|head -n2|tail -1); \ if [ "${DISKA}" == "" ]; then DISKA="/dev/sda"; fi; \ if [ "${DISKB}" == "" ]; then DISKB="/dev/sdb"; fi; \ debconf-set partman-auto/disk "$DISKA $DISKB"; \ debconf-set partman-auto-raid/recipe "1 2 0 ext4 / ${DISKA}2#${DISKB}2 . 1 2 0 lvm - ${DISKA}4#${DISKB}4 ."; \ debconf-set grub-installer/bootdev "$DISKA $DISKB"; I tried the above with multiple variations (true, false) of the following and without them as well: d-i grub-installer/only_debian boolean false d-i grub-installer/with_other_os boolean false I even tried it within the early_command: debconf-set grub-installer/only_debian false; \ debconf-set grub-installer/with_other_os false; Unfortunately the Install the GRUB boot loader on a hard disk dialog still showing up with the correct disk as shown below, so I need to confirm and continue. Can I preseed this automatically? Install GRUB to disk
Asked by Max (335 rep)
Apr 4, 2019, 08:03 AM
Last activity: Mar 7, 2021, 11:31 PM