GRUB Installation After Windows Installation

From Wikibooks, open books for an open world
Jump to: navigation, search

GRUB Installation[edit]

Installation of GRUB is a two step process. The first step is to install or build GRUB in a host OS environment, and for this we will use Linux. The second step is to install and configure GRUB as the boot loader for your system.

Compile GRUB Source Code

The first step is the usual: download the source archive, untar it, configure and make install. Assuming you have found a source mirror (see the GRUB home page to find one) and downloaded the source distribution into a suitable working directory, continue with:

tar -xzvf grub-0.97.tar.gz
cd grub-0.97
./configure
make
make install

This should create the executables: grub, grub-install and mbchk; install support files in /usr/lib/grub/i386-pc/, and install the GNU information manual and man pages. For the second step of installation, we will first build and work with a GRUB bootable CD.

Preparing a GRUB Bootable CD

Follow the steps and build your GRUB Bootable CD

mkdir iso
mkdir -p iso/boot/grub
cp /usr/lib/grub/i386pc/stage2_eltorito iso/boot/grub
mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o grub.iso iso

Install GRUB on MBR

Reboot your system with “GRUB Installation CD”, after load stage1 you find a grub shell. Run the following command to find which partition of your system, Linux is installed.

grub>find /boot/grub/stage1

Suppose your Linux Distribution is installed on your first Primary partition, then the output is

(hd0,1)

then you install the GRUB on your Hard Disk Master Boot Record (MBR). The steps are as following.

grub>root (hd0,1)
grub>setup (hd0)
grub>quit

The GRUB Install process is now complete.

Reboot your system.