Tuesday, March 19, 2019

windows - How to reinstall or recover GRUB/MBR on an Intel Mac?

I'm on a triple boot MacBook (OSX, Ubuntu, Windows). Windows started misbehaving and needed to be re-installed (as it often does). After reinstalling windows, the MBR now points to Windows directly and not GRUB.




GRUB recovery which works on most MRB Partition Table, did not on this GPT Partition table:



$ sudo grub-install --root-directory /media/ubuntu /dev/sda



Ubiquity knows how to do this correctly. Which command can I run to recover GRUB/MBR on an Intel Mac?



SOLUTION:
This was not simple but I found out how to do it. Thanks to Colin Watson and to the Debian IntelMac[1] Documentation for each giving me parts of the solution.



Here is what I did:




1) Boot From LiveCD



2) Go to places and mount partition with Ubuntu



3) Press CTRL-L in nautilus or use the mount command to find out where that partition is mounted (example: /media/123)



4) Open a Terminal (Application > Accessories > Terminal)



5) Run the following commands:




$ for x in dev proc sys; do sudo mount --bind /$x /media/123/$x; done



$ sudo chroot /media/123

# dhclient

# apt-get install grub-pc os-prober gptsync

# gptsync /dev/sda # Say YES


# grub-install --force /dev/sda #Tried sda4 (the ubuntu partition) but resulted w/blink _ at boot

# update-grub

# exit

$ sudo reboot



[1] http://wiki.debian.org/IntelMac/BootLoader#Upgrading

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...