Making OpenSolaris and Ubuntu Coexist: Grub Config

I have been wanting to write this post for a long time. But could not find much time for the same. Anyways Once you install Ubuntu and OpenSolaris together (on the metal installation i.e., dual boot) you will face some grub issues.

There are two ways in which you can install the two operating systems:

1. Install Ubuntu first and then install OpenSolaris
2. Install OpenSolairs first and then install Ubuntu

I have divided this tutuoral into two parts - Part I and Part II. For the second case (install OpenSolairs first and then install Ubuntu), you can start from Part II of this tutorial

My partiton table (How I have formatted my hard disk and installed Ubuntu and OpenSolaris)
My partiton table (How I have formatted my hard disk and installed Ubuntu and OpenSolaris)

My hard disk has been partitioned like this (The command used to get this detail is - [sudo fdisk -l]:

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 \* 512 = 8225280 bytes
Disk identifier: 0x000d41cc

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   \*           1        6576    52821688+  bf  Solaris
/dev/sda2            6577       19174   101193435   83  Linux
/dev/sda3           19175       19457     2273197+  82  Linux swap / Solaris

Here, /dev/sda1 i.e., OpenSolairs is hd0,0 for grub (where hd0 is the hardisk number and 0 is the partition number)
          /dev/sda3 i.e., Ubuntu is hd0,1 for grub

Part I

[This part will tell you about Installing Ubuntu first and then install OpenSolaris]

So You have successfully installed Ubuntu on you machine and now you are going to install OpenSolairs.
I say, go ahead, do not hesitate thinking that you will loose ubuntu (You must have partitioned your disk properly and install OpenSolaris in the right partition so that you will not loose ubuntu)

Now you have Finished installing OpenSolairs too. Your partition table will look similar to mine. May be you will have ubuntu partition over OpenSolaris i.e., /dev/sda1 = Ubuntu and /dev/sda2 = OpenSolaris

Say, your partion table looks like this:Disk /dev/sda: 160.0 GB, 160041885696 bytes

255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 \* 512 = 8225280 bytes
Disk identifier: 0x000d41cc

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   \*           1        6576    52821688+  bf  Solaris
/dev/sda2            6577       19174   101193435   83  Linux
/dev/sda3           19175       19457     2273197+  82  Linux swap / Solaris

PS: I am taking my partition layout as an example as it will be easire for me to explain the steps

Now(after installing OpenSolairs), when you start your system, you will find that your Ubuntu entry in the grub had vanished! Do not panic

You just need to insert the ubuntu live cd and open the terminal (In the top left corner, Applications>Accessories>Terminal) and type:

$ sudo grub

Once you type this command, you will get into the grub

       [ Minimal BASH-like line editing is supported.   For
         the   first   word,  TAB  lists  possible  command
         completions.  Anywhere else TAB lists the possible
         completions of a device/filename. ]

grub>

once inside, type the following command:

grub> find /boot/grub/menu.lst
 (hd0,1)

grub> root (hd0,1)

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)"...  16 sectors are embedded.
succeeded
 Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,1)/boot/grub/stage2 /boot/grub/menu
.lst"... succeeded
Done.

This successfully installs ubuntu grub back to your system or machine :)

Reboot your system. You will see that now you have ubuntu's entry in the grub and you lost OpenSolaris entry! No problems. Just read on the the Part II of this tutorial...

Part II - Continuation of part I

[This part will tell you about Installing OpenSolaris first and then install ubuntu i.e., you have the ubuntu's grub on your machine now]

Start you computer and boot to ubuntu. Once you log into your ubuntu operating system, open terminal (In the top left corner, Applications>Accessories>Terminal) and type the following command:

avinash@avinashj:~$ sudo gedit /boot/grub/menu.lst

This will start the gnome's text editor. Go to the end of the file and you will find Ubuntu's entry just above that, you must type:

title    OpenSolaris
rootnoverify (hd0,0)
makeactive
chainloader +1
boot

Now, reboot your machine and you will have both OpenSolaris and Ubuntu

Comments:

Thanks for posting this! Well done!

Posted by Chris Melissinos on April 18, 2009 at 10:43 PM IST #

Thank you Chris.

Posted by Avinash Joshi on April 19, 2009 at 02:52 AM IST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

I am a Campus Ambassador, Amrita Vishwa Vidyapeetham. This is my technical-cum-non technical blog. You can also view my personal site: http://avinashjoshi.co.in

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today