Wednesday, 6 March 2013

Install grub in ubuntu linux after installing windows

If you install window  first and than install Ubuntu.

Because of some problem you install window again after Ubuntu installation.

Now you are not getting the option of Ubuntu.

TO get the Ubuntu option you have to install Ubuntu grub again on HARD DISK.

For that   Boot from the same version of  Ubuntu you installed earlier.

Select the Try Ubuntu 

open terminal

########## Find the Linux partition with ##########

sudo fdisk -l



Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000cf1c8

   Device Boot         Start            End             Blocks        Id         System
/dev/sda1   *           2048         206847          102400         7       HPFS/NTFS/exFAT
/dev/sda2            206848        184322047     92057600     7       HPFS/NTFS/exFAT
/dev/sda3         184324094     391354367    103515137     5       Extended
/dev/sda4         391354368     625137663    116891648    7       HPFS/NTFS/exFAT
/dev/sda5         184324096     360103935    87889920      83      Linux
/dev/sda6          360105984    391354367    15624192      82      Linux swap / Solaris


########## mount the linux partition on /mnt ##########

sudo mount /dev/sda5 /mnt

########## mount (bind) the live CD  Dir with installed linux Dir ##########


sudo mount --bind /proc /mnt/proc

sudo mount --bind /dev /mnt/dev

sudo mount --bind /sys /mnt/sys

########## Get the root privilege ##########

chroot /mnt

########## Install the grub  ##########

grub-install /dev/sda






No comments:

Post a Comment