Tuesday, January 4, 2011

How to install Grub natively on your HDD ?

Installing GRUB natively :

Caution: Installing GRUB's stage1 in this manner will erase the normal boot-sector used by an OS.


GRUB can currently boot GNU Mach, Linux, FreeBSD, NetBSD, and OpenBSD directly, so using it on a boot sector should be okay. But generally, it would be a good idea to back up the first sector of the partition on which you are installing GRUB's stage1. This isn't as important if you are installing GRUB on the first sector of a hard disk, since it's easy to reinitialize it (e.g. by running `FDISK /MBR' from DOS).

If you decide to install GRUB in the native environment, which is definitely desirable, you'll need to create the GRUB boot disk, and reboot your computer with it.

Once started, GRUB will show the command-line interface. First, set the GRUB's root device, to the boot directory, like this:

grub> root (hd0,0)

If you are not sure which partition actually holds these files, use the command like this;

grub> find /boot/grub/stage1

Note : This will search for the file name `/boot/grub/stage1' and show the devices which contain the file.

Once you've set the root device correctly, run the command as below,

grub> setup (hd0)

Note : This command will install GRUB on the MBR in the first drive. If you want to install GRUB into the boot sector of a partition instead of the MBR, specify a partition into which you want to install GRUB:

grub> setup (hd0,0)

If you install GRUB into a partition or a drive other than the first one, you must chain-load GRUB from another boot loader like,

 grub> rootnoverify (hd0,0)
 grub> makeactive
grub> chainloader +1


To make it permanently;

Go to "/boot/grub/grub.conf" and edit it. Add a new section at last of the file,

#Windows XP Boot Setting
title Windows XP
rootnoverify (hd0,0)
makeactive
chainloader +1

For more info about grub.conf check out "menu.lst" file in "/usr/share/doc/grub*/" .

No comments:

Post a Comment