From ac973cef4294e4678e6a7bfe3b7d0b77035dc6e1 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 4 Jul 2025 13:29:54 +0200 Subject: [PATCH] MT#62787 SW-RAID: install only to first RAID disk to not fail in non-EFI mode Noted in daily-build-carrier-runner installation (see https://jenkins.mgm.sipwise.com/job/daily-build-install-vm/148320/console): | Installing for i386-pc platform. | grub-install: error: unable to identify a filesystem in mduuid/ad9e241cd5c1093cd46de7932bc3fce1; safety check can't be performed. | Error: failed to execute 'grub-install --no-floppy --target=i386-pc /dev/md0'. One can run 'grub-install /dev/md0' without problems on EFI systems, as this doesn't really touch the disks then. But in non-EFI systems, this fails hard, because GRUB doesn't support direct installation to the SW-RAID. Instead we need to iterate over all the disks separately, being already handled within stage swraidinstallgrub: | +11:37:12 (deployment.sh:2457): set_deploy_status swraidinstallgrub | +11:37:12 (deployment.sh:102): set_deploy_status(): '[' -n swraidinstallgrub ']' | +11:37:12 (deployment.sh:103): set_deploy_status(): echo swraidinstallgrub | +11:37:12 (deployment.sh:2458): for disk in "${SWRAID_DISK1}" "${SWRAID_DISK2}" | +11:37:12 (deployment.sh:2459): grml-chroot /mnt grub-install /dev/sda | Writing /etc/debian_chroot ... | Installing for i386-pc platform. | Installation finished. No error reported. | +11:37:12 (deployment.sh:2458): for disk in "${SWRAID_DISK1}" "${SWRAID_DISK2}" | +11:37:12 (deployment.sh:2459): grml-chroot /mnt grub-install /dev/sdb | Writing /etc/debian_chroot ... | Installing for i386-pc platform. | Installation finished. No error reported. | +11:37:13 (deployment.sh:2462): grml-chroot /mnt update-grub | Writing /etc/debian_chroot ... | Generating grub configuration file ... | Found linux image: /boot/vmlinuz-6.12.33+deb13-amd64 | Found initrd image: /boot/initrd.img-6.12.33+deb13-amd64 | Adding boot menu entry for UEFI Firmware Settings ... | done So install GRUB only to the *first* SW-RAID disk. Change-Id: I436e3deca37d68ef505d44fd24620028f2ded0f4 (cherry picked from commit 75b0f9274ec7cdb8dc73920e8ee20926c0f11970) --- templates/scripts/includes/deployment.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/scripts/includes/deployment.sh b/templates/scripts/includes/deployment.sh index 2ff1586..90a7cb3 100755 --- a/templates/scripts/includes/deployment.sh +++ b/templates/scripts/includes/deployment.sh @@ -1728,7 +1728,7 @@ fi # disk information and set GRUB target if [[ "${SWRAID}" = "true" ]] ; then DISK_INFO="Software-RAID with $SWRAID_DISK1 $SWRAID_DISK2" - GRUB_DISK="${SWRAID_DEVICE}" + GRUB_DISK="/dev/${SWRAID_DISK1}" # we iterate over the disks in swraidinstallgrub else DISK_INFO="/dev/$DISK" GRUB_DISK="/dev/$DISK"