For some reason if the Master Boot Record (MBR) is overwritten or corrupted, here is a simple HOW-To to install GRUB (GRand Unified Boot loader) as the boot loader with Ubuntu being the host operating system.
- Boot up Linux using Ubuntu Live CD
grub with system user privileges
% sudo grub
Probing devices to guess BIOS drives. This may take a long time.
- Locate the grub files on the connected devices.
grub> find /boot/grub/stage1
- Even though the above example shows only one location, it is not uncommon for grub to find multiple locations when multiple operating systems are installed on a system. In that case, choose the one that corresponds to the partition where Linux is installed.
grub> root (hd0,0)
- Finally install the grub boot loader on the primary HDD by running 'setup'.
grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 17 sectors are embedded.
Running "install /boot/grub/stage1 (hd0) (hd0)1+17 p (hd0,0)/boot/grub/stage2
After restarting the system, GRUB menu should appear during the system startup.