Restoring Grub Boot on a remote server with RAID1
How you can reinstall Grub on a system with RAID1 that is not booting anymore.
The assumption is that things already have gone southward and you have recovered the server with a rescue system.
Checking whether server boots via UEFI or BIOS
Check if a folder /sys/firmware/efi is present and if you can find the string "EFI v" in the Kernel ringbuffer via dmesg|grep "EFI v". The latter one only produces safe results if the bootup sequence is still contained in the ringbuffer. The first one will be a pretty safe indication that the server is using UEFI.
RAID1 layout
Find out with lsblk which blockdevices do exist and how many RAID partitions there are.
Check all /dev/mdX partitions and find out what their mountpoints are. When you locate the partition for / you can check the filesystem table in /etc/fstab to doublecheck your findings.
Let's asume partiotions and mountpoints look like this:
/dev/md0 SWAP /dev/md1 /boot /dev/md2 / /dev/md3 /extra
Reasemble your original system under /mnt
Mount / and /boot under /mnt.
mount /dev/md2 /mnt
mount /dev/md1 /mnt/boot
If your system runs with UEFI you also have an UEFI partion that you need to mount instead of the /boot partition. As I found myself on a BIOS system I will continue with this case only.
Include the rescue system's /dev, /proc, /sys, and /run folders under /mnt.
#mount --bind /dev /mnt/dev
#mount --bind /proc /mnt/proc
#mount --bind /sys /mnt/sys
#mount --bind /run /mnt/run
Change root to /mnt
#chroot /mnt
Reinstall GRUB on all physical disks
#grub-install /dev/sda
#grub-install /dev/sdb
Update GRUB
#update-grub
Exit chroot environment, unmount all devices under /mnt and reboot
#exit
#umount /mnt/dev
#umount /mnt/proc
#umount /mnt/sys
#umount /mnt/run
#umount /mnt/boot
#umount /mnt
#reboot
Reactions
How to interact with this page
Webmentions
To interact via Webmentions, send an activity that references this URL from a platform that supports Webmentions, such as Lemmy, WordPress with Webmention plugins, or any IndieWeb-compatible site.
ActivityPub
- Follow @mafeu@martin.feuersaenger.de on your ActivityPub platform (e.g. Mastodon, Misskey, Pleroma, Lemmy).
- Mention @mafeu@martin.feuersaenger.de in a post to feature on the Guestbook.
- Search for this URL on your instance to find and interact with the post.
- Like, boost, quote, or reply to the post to feature your activity here.