Skip to content

Instantly share code, notes, and snippets.

@Kline-
Created March 14, 2026 20:54
Show Gist options
  • Select an option

  • Save Kline-/9ed024eea5db0440880f91dab1ddede0 to your computer and use it in GitHub Desktop.

Select an option

Save Kline-/9ed024eea5db0440880f91dab1ddede0 to your computer and use it in GitHub Desktop.
A wrapper for grub-install to install grub on all drives, so that any drive can boot the system in the event of a failure.
#!/bin/bash
for i in $(ls -1 /dev/sd* | cut -c8 | uniq); do
echo "[$(tput setaf 2)/dev/sd$i$(tput setaf 7)]"
grub-install /dev/sd$i
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment