Saturday, February 16, 2008

How To Restore Grub/Lilo (boot loader)

if you want to install windows and Linux on the same machine (this is called Dual Boot) you MUST install on this order:

Windows 3.11
Windows 95
Windows 98
Windows ME
Windows NT
Windows 2000
Windows XP
Linux

Let Linux be the last OS installed, as it can boot any other OS.
If you lost your Boot Loader and now only windows boots up (it happens if you install Windows on a system that already has Linux Installed)
take a Linux Install CD and boot with it.

press CTRL+ALT+F2. It will give you a text mode interface. then execute this commands:

mkdir /linux
mount /dev/hda1 /linux
chroot /linux


if you want to use LILO:
check your /etc/lilo.conf and run:
lilo
restart


if you want to use GRUB:
grub
find stage1
root (hdX,Y)
change X,Y with the result from above command
setup (hd0)
quit
restart


Atention:
Remember to change hda1 to whathever your Linux partition is...
/dev/hda1 => First partition on the Primary Master IDE HD
/dev/hda2 => Second partition on the Primary Master IDE HD
/dev/hdb1 => First partition on the Primary Slave IDE HD
/dev/hdb2 => Second partition on the Primary Slave IDE HD
/dev/hdc1 => First partition on the Secondary Master IDE HD
/dev/hdc2 => Second partition on the Secondary Master IDE HD
/dev/hdd1 => First partition on the Secondary Slave IDE HD
/dev/hdd2 => First partition on the Secondary Slave IDE HD
/dev/sda1 => First partition on the First SATA HD
/dev/sda2 => Second partition on the First SATA HD
/dev/sdb1 => First partition on the Second SATA HD
/dev/sdb2 => Second partition on the Second SATA HD


.

No comments: