When you install Windows after the installation of Linux, Windows would install its own boot loader on MBR and it would ignore other system in your computer. If you previously install your boot loader of Linux on MBR, your boot loader of Linux would be replaced and you can't boot your Linux system. The following are some solutions.
(Method 2, 3 seem to fail in Windows 7, the alternative way is use other grub substitute for Windows 7, then edit manually to retrieve Linux system. For my computer, when entering the grub menu of grub windows-substitute, press e or c, then edit
root (hd0,2)
kernel (hd0,2)/boot/vmlinuz-... root=/dev/hda3 ro
initrd (hd0,2)/boot/initrd-...img
boot
then press b to boot. It will boot Linux system. Use root privilege to reinstall grub boot loader on MBR.
$ grub
grub > root (hd0,2)
grub > setup (hd0)
I didn't test Method 1 because my Debian CD failed to be loaded by my computer. Ubuntu DVD failed by that Ubuntu installation DVD recognize HD partition as SCSI partition. I don't know how to do it for GRUB.
Method 1:
- Use a debian installation CD to boot computer
- Select install option
- After entering the installation menu, use Ctrl+F2 to access the shell
- chroot your Linux environment
- Use grub-install /dev/hda (or grub-install --root-directory=prefix '(hd0)' )
- Restart computer
Method 2
- Download GRUB for DOS
- Uncompress and copy grldr and grub.exe in C root drive
- Edit C:boot.ini (in CMD, msconfig -> choose boot.ini)
- Add C:grldr="grub" in the last line
Method 3
- Download wingrub
- After finishing installation, install grub -> boot.ini, drive: C: -> install
- Restart computer
- There are two options in the boot menu: windows, mygrub
- Entering mygrub, choose YourLinuxSystemLabel, press c
- Edit GRUB: grub>root (hdX,Y); grub>setup (hd0)