Skip to content

Instantly share code, notes, and snippets.

@m-radzikowski
Created February 20, 2014 14:17
Show Gist options
  • Save m-radzikowski/9114578 to your computer and use it in GitHub Desktop.
Save m-radzikowski/9114578 to your computer and use it in GitHub Desktop.
Script to restore Grub2 for openSUSE after for example Windows installation.
#!/bin/sh
# openSUSE rescue system login: root
fdisk -l
mount /dev/sda5 /mnt # assume that linux partition (/) is on /dev/sda5, you can see this after "fdisk -l" command
mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
mount --bind /proc /mnt/proc
chroot /mnt
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-install /dev/sda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment