Installing / Removing GRUB

GRUB stands for GRand Unified Bootloader. It is a flexible and powerful boot loader for personal computers. It can load a wide range of free operating systems, as well as proprietary OSs with chain-loading.

I need to install GRUB whenever I reinstall Windows. Windows rewrites the MBR with its own boot loader. Now, grub is required to boot into my ubuntu linux. I generally use the following method to install grub.

Install GRUB using ububtu live CD

Boot up with ubuntu live CD. Open a terminal. Run the Grub shell in superuser mode.

$ sudo grub

Now set the root device, the partition containing the '/boot' directory, like this (For me, this is the 2nd partition on my first hard disk, where also ubuntu is installed. Hard disk and partition numbers start from 0)

grub> root (hd0,1)

If you are not sure which partition actually holds this directory, use the command 'find', like this:
grub> find /boot/grub/stage1

Once you set the root device correctly, run the command 'setup'

grub> setup (hd0)

This will install GRUB boot loader to the Master Boot Record (MBR) of the first hard drive.

See the Official GNU GRUB manual for more detailed information. You will find other methods and options for installing GRUB there.

Removing GRUB

If you want to uninstall grub you have to rewrite it with another bootloader. To replace it with Windows boot loader, boot up with Windows XP CD and enter the recovery console mode. Now run 'FDISK /MBR' to reinitialize the MBR for your hard disk.

You can also use the command 'fixmbr'.

3rd party tools for MBR manipulation

MBRWizard! The MBR Management Utility - freeware for Linux and Windows
HxD - - A freeware ''Windows'' disk editor which can be used to explore and back up critical sectors, such as the MBR
rohPod - A simple block oriented disk editor, which can repair MBRs and works even over the network. Works on Linux, Mac OS X and Windows
MBRtool - a DOS program designed to backup, restore and manipulate hard disk MBR

Comments

Popular posts from this blog

Power On Your Computer by Keyboard, Mouse or Alarm

Comet Lulin Comes Closer

Into the World of Computer Gaming