Today I have to reinstall my Windows 2003 over my Ubuntu installation, a dual-boot Operating System on a harddrive. The partition itself /dev/hda1 for Windows’s partition, /dev/hda5 for data (a FAT32 partition), /dev/hda6 for Ubuntu and /dev/hda7 for the swap partition.
To use the dual-boot using boot loader that came from Linux, which can be GRUB or LILO, firstable you should install Windows first then continue with your Linux’s installation. By this, hopefully your hands will not be “dirtier”. By default, GRUB will be install after you have successfully installing Ubuntu.
To be short, I have to install Windows again. By this, if you have GRUB installed (like me), the GRUB will be replace by Windows boot loader. This is what I did to recover the GRUB without have to install the Ubuntu again.
1. Get any Live-CD you have, Knoppix will be great.
2. Boot to Knoppix.
3. Get to the terminal, by pressing Alt+F2 then type ‘xterm’ (without quote) in the box appeared.
4. Change the user priviledge to root.
5. Type on the terminal:
; below command is use to make a directory call disk
# mkdir /disk
; below command is used to mount your Linux’s partition to /disk, you can change the partition according to your installation respectevely.
# mount /dev/hda6 /disk
; below command is used to get in to your root directory of your Linux’s partition.
# chroot /disk
; below command is used to install the GRUB on the MBR. You can change to the boot partition you might have made previously.
# grub-install /dev/hda
6. Reboot your computer.
Trala!!! Now you have your GRUB again.
Well, now it’s time to get back to the console again.