Last week I reinstalled Windows XP which was running on my laptop along with Fedora. It’s quite obvious that Microsoft uses own bootloader which is not compatible with Linux, therefore installing Windows overwrites GRUB. Luckily, it is easy to restore.
As I use and like
- From main menu select “Rescue Installed System”. Select language, keyboard layout, wheather to start network interfaces or not.
- In “Rescue” dialog hit “Continue”.
- Message will say “System has been mounted”, click Ok. Hit Return to go to shell.
- Another message will say “System mounted on /mnt/sysimage directory”, hit Ok.
- In next window select “shell – start shell”, Ok.
- Execute following commands in terminal window:
chroot /mnt/sysimage /sbin/grub-install /dev/sda
NOTE: /dev/sda is boot partition. This is typical value, but if your PC has more than one HDD, you might have to check for correct value.
It also can be useful to review GRUB configuration located at /boot/grub/grub.conf (just in case). Although you can skip if you had your favourite Linux flavour multi-booting successfully before Windows reinstallation.
This guide is step-by-step tutorial for Fedora, but is similar on other Linux distributions like