Installing GRUB
Feb 6, 2009 by mohamed hanoosh
GRUB( GRand Unified Boot loader) can be installed in many ways
- from current linux installation
- from live cd
- Installing GRUB from current linux. Type the command
- Installing from a rescue cd
- Installing from a live cd
- Another method to install from a live cd
# grub-install /dev/sda
where sda corresponds to the harddisk where the boot loader is being installed. The boot loader is in a small portion and hence it keeps all other necessary files in another location. By default the boot loader takes the configuration for the grub from /boot/grub/menu.lstnote: If the command was executed from a live cd then the grub will look for menu.lst in /boot/grub/ which is actually in the 'cd rom'. Therefor simply executing the command from a live cd won't work.
Rescue disks gives an option to boot into an already installed OS.(For example Suse gives options to boot into installed SUSE, Fedora gives option for 'chroot'into already existing fedora)
From there type command
# grub-install /dev/sda
It will install grub.I am considering Ubuntu as an example
execute the following commands
#sudo grub
grub>find /boot/grub/stage1
grub>root (hd0,0)
grub>setup (hd0)
entries for other OS (like windows ) has to be added manually.
$ sudo mount /dev/sda1 /media/disk
$ sudo mount --bind /dev /media/disk/dev
$ sudo chroot /media/disk
# grub-install /dev/sda
# exit
thanks was useful..