When Computers Don’t Boot

November 2, 2007 | By Naman Bagga | Filed in: Linux, Tech Talk.

How often has it happened with you that all of a sudden your computer fails to boot?I’ve had this problem countless times and have solved it each time successfully.Today I’ll give you some advice for such situations both for Windows and Linux.

If you are using Windows XP and no other OS and your computer refuses to boot,it is perhaps because of some problem with your main partition called the C drive.Follow these steps to solve the problem(note that you need to have a Windows XP CD)-

  • Boot from the CD.If you can’t boot from it,check your BIOS settings.
  • When prompted,press ‘R’ to get to the recovery console.
  • In the recovery console,type ‘chkdsk’ and hit the return key to check your windows partition
  • CHKDSK will remove errors from the partition and now your computer should boot normally
  • If your problem is still not solved,try ‘fixboot’ or in extreme cases ‘fixmbr’.Note that this step is recommended only if Windows is the only OS in use.

Suppose you are using Linux(I’ll take Ubuntu as example but you can do it with almost all distros having live CDs) in dual booting with Windows and you want to correct your windows installation using the above procedure you will face some problems.When you insert the Windows CD into your drive and boot from it,your MBR(Master Boot Record) will be re-written as windows can’t tolerate the existence of another OS with it.

Most Linux distros like Ubuntu use GRUB boot loader which is an intelligent boot-loader and can manage different Operating Systems simultaneously.The windows CD removes GRUB from the MBR.Now you need to reinstall GRUB in order to detect the installed Linux OS.You can do this by following these steps-

  • Boot form the Ubuntu live CD(other live CDs can also be used).
  • Go to System->Administration->Users and Groups.
  • Change the root password to anything of your choice.
  • Open the terminal or the console or in KDE language, Konsole
  • Type ‘su’,hit the return key and enter the password you just set.
  • Now type ‘grub’ and hit the return key.You will get a grub> prompt.
  • Type ‘find /boot/grub/stage1’ to find the partition which has grub installed.You will get back the address like (hd0,0) or as (hd0,1) it depends on the partition.If you get multiple results,don’t worry you need just one as GRUB is really intelligent.If you have GRUB installed on ‘hda3’ or on ‘sda3’ on the first hard disk,the address returned will be (hd0,2)
  • Now type ‘root (hd0,2)’ or whatever applicable and hit the return key as usual.
  • Now you have reached the final step in which you have to install GRUB to your MBR.Type ‘setup (hd0)’ or whatever applicable in your case to install GRUB to the MBR of your hard drive.Note that ‘hd0’ represents your 1st hard drive and ‘hd1’ your second one and so on.In this step GRUB will be setup and it will also detect other operating systems.

You computer should boot without any problems now.Note that if you are using dual booting and have lost grub due to other reasons,I would suggest you to follow the same procedure.You should be thorough with the procedure for installing GRUB as you will need to do that every time the silly Windows fails to boot.

After reading this post I’m sure you would agree that Linux is far more superior to Windows as far as the boot-loader is concerned.If you have any other questions regarding reinstalling GRUB,you may leave a comment.


2 comments on “When Computers Don’t Boot

Leave a Reply

Your email address will not be published. Required fields are marked *