Skip to main content

multi boot - How to fix GRUB after Windows breaks it, and how to edit the GRUB menu


I had Windows XP and Ubuntu both installed. I could easily boot into either until Windows "fixed" the bootloader so that it now only boots into Windows.


I guess there is no way to prevent Windows from doing this. So instead when it happens how do I quickly restore the GRUB bootloader?


Also while I'm here: How do I edit the GRUB menu, to hide options I don't want and to change the default boot OS?



Answer



Boot off a live CD (gparted is quick), then in a terminal window enter, (substituting your (drive,partition) pair):


sudo grub
find /boot/grub/stage1
root (hd0,0)
setup (hd0)
quit

Then reboot the system


As root edit /boot/grub/menu.lst, it's fairly self explanatory.


Comments