Recovering your grub boot

If you use GRUB as your Linux boot loader (it happens the same with LILO) you may notice that your boot menu is gone after installing most flavors of Windows, including Windows XP SP2. One way to avoid this problem is to install Windows first and, later, to install Linux or BSD.

Another possible solution, more general, is to fix the boot that is gone. My favourite way is to use a Knoppix CD to boot your system in Linux. Then, as the root user I mount the hard disk partition that holds / and /boot and then to chroot to the first one (/). Now you can issue the install-grub command to get your partition table boot code fixed.

Example: Boot hard drive is /dev/hda and Linux / and /boot are in /dev/hda3 partition. Open a Knoppix terminal and type:


sudo bash
mount /dev/hda3 /mnt/hda3
cd /mnt/hda3
chroot ./ /bin/bash
grub-install /dev/hda
exit
reboot

That should be it. Do not forget to remove Knoppix CD before the next system boot.

Comments

Popular posts from this blog

VFD control with Arduino using RS485 link

How to get sinusoidal s-curve for a stepper motor

Stepper motor step signal timing calculation