Help! I reinstalled Windows and Linux disappeared!

From LQWiki
Jump to navigation Jump to search

When you install Microsoft Windows®, or any other operating-system. on your computer, it is very common that their installation process will rewrite the MBR (Master Boot Record), which is the actual program used by your computer's BIOS as the first step of starting the machine. The MBR loads the boot loader, which in the case of Linux is either LILO or GRUB, and in the case of Windows is NTLDR.EXE.

Since the Microsoft Windows installation procedure normally overwrites the MBR to point to NTLDR.EXE, it appears that Linux has "disappeared." But the problem can be quite easily corrected.

To do this you will need a Live CD, that is, a bootable CD-ROM or DVD-ROM which contains a stand-alone copy of Linux. The CD that you used to install Linux will probably do. Place this disk into the drive, shut down the machine and reboot. Then, re-execute the LILO or GRUB command necessary to rewrite the MBR on the hard-drive. For Grub, this will probably be grub-install /dev/hda. For Lilo, you just type lilo.

Notice that when you do this, you will no longer be able to boot into Windows because NTLDR.EXE will no longer be executed! You must define a boot-menu item for either LILO or GRUB (as appropriate) to start the Windows operating-system, as further described in the articles on LILO and GRUB.

Under SuSE, you can boot off the original install disks and find a section that allows you to repair a failed install. In there, you will find a menu to recreate the MBR.

Some distributions, like VectorLinux will allow you to rerun their install procedure, skipping the install and cutting straight to the bootloader installation and automatically detect Windows partitions and automatically adding them (If approved by the user) to the boot menu.