Created
October 4, 2012 13:35
-
-
Save palday/3833559 to your computer and use it in GitHub Desktop.
Restore a damaged GRUB on Mac using rEFIt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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