It is a sure phenomenon that if at any point of time we had installed Linux on your system, the bootloader was changed to GRUB, LILO and likewise.
The problem arises here when we mess up with the installation and want to reinstall the OS itself. Most of us do this by formatting the Ubuntu partition from within Windows. In the course, we also lose our boot directory which contains the boot files and the bootloader. This renders our system unable to boot.
This problem can be easily avoided by placing the boot directory in a separate partition though in case you did not do so, there is an easy way out.
You will require the live CD(from which you installed Linux or any Linux live CD) for this to work.
- Insert the live CD and boot from it.
- After complete bootup, open the default terminal.
- Type key in
sudo grub, this will take you to a grub editing menu. - Now at grub prompt, type
root (hd0,n)
[ This sets the partition(n) on your first hard disk(hd0) as the install location. Replace n with a partition number. Generally I put my Grub on the first hard partition. So my command looks likeroot (hd0,0).] Press return. To see all partitions on you system and their information, type ingeometry(hd0). That way you can make sure your Grub is being installed correctly. - Next type in
setup (hd0)[ This installs the bootloader at the selected partition on hd0. ] Press return. - Type
exitto exit from grub editor. - Reboot.
That is all. You will have your grub boot menu with all your present operating systems listed in it.
Chinmoy Kanjilal is the geek behind Techarraz. This is where he rants about his adventures with technology. Get to know him better, and connect with him on social networks.
This might not work on some laptops like Dell inspiron 1525..