Skip to content

Instantly share code, notes, and snippets.

@palday
Created October 4, 2012 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save palday/3833559 to your computer and use it in GitHub Desktop.
Save palday/3833559 to your computer and use it in GitHub Desktop.
Restore a damaged GRUB on Mac using rEFIt
#! /bin/bash
# prep and chroot into the existing system
sudo mkdir -p /mnt/root
sudo mount /dev/sda4 /mnt/root/
sudo mount -t proc none /mnt/root/proc/
sudo mount -o bind /dev /mnt/root/dev
sudo mount --bind /sys /mnt/root/sys
sudo chroot /mnt/root/ /bin/bash
# install grub and double check that the hybrid GPT-MBR is synced
apt-get install grub-pc os-prober gptsync
gptsync /dev/sda # Say YES
grub-install --force /dev/sda
#Tried sda4 (the linux partition) but didn't work
update-grub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment