TIL the hard way how to configure grub to automatically install bootcode on all drives. Bootcode needs to be present on at least one drive. During package and operating system upgrades, the process of installing/updating bootcode is crucial if you expect the next system boot to be successful.
For software RAID configurations, such as mdadm
or zfs
, the bootcode must be installed on
all 'boot' drives (i.e. drives which contain your /
or /boot
file systems) to avoid boot
failures because
Grub provides a way to install bootcode manually. This method is well known and used in most tutorials as well as during Debian system installation:
grub-install /dev/sda grub-install /dev/sdb
but there is also a way of performing the task automatically (at least on Debian):
dpkg-reconfigure grub-pc
By interactively selecting all boot disks, you lower your chances of boot failure, however, we need to make sure to run the either one of the commands after replacing a disk.