I have installed Solaris on my x86 machine (taking 100gb of 500gb). Now I have installed Ubuntu on the system (in another 100gb).

I want to make primary OS as Solaris. I know setting have to be done in /boot/grub/menu.lst, but what is the actual command to be updated? When I restart the system after updating the menu file it shows only Solaris menu and no Ubuntu options.

You're running Grub from Solaris, right? I think you'll have to edit the menu.lst file by hand to add entries for Ubuntu. What is the current content of the file? How are your disks partitioned (fdisk -l /dev/sda /dev/sdb under Linux or whatever the corresponding invocation of fdisk is under Solaris)?
–
GillesJul 26 '11 at 20:28

Solaris is on /dev/sda1 Ubuntu is on /dev/sda5 so what could be the proper command?
–
cyrilsebastianJul 27 '11 at 10:17

2 Answers
2

If you have normal grub (now starting to be known as grub-legacy), updating the menu file should be enough. The menu is read on each boot so no commands need to be run.

If you have grub2 (which is a complete re-write and different beast) then I think you have to run the update-grub command to make the changes take effect. You didn't state which Ubuntu you were using but I believe the latest version comes with grub2 as the default bootloader.

Thanx I updated solaris(primary OS) menu.lst with title Ubuntu 11 root (hd1,0) chainloader +1 makeactive In this command, I doubt that root (hd1,0) might be the wrong command. But how can I know the various partitions to update it?
–
cyrilsebastianJul 27 '11 at 10:27

The easiest way to boot multiple operating systems is to use one operating system's bootloader to boot this operating system directly and have it load the other operating systems' bootloaders. Often this is the only option. Here, Grub 1 (the Solaris bootloader) and Grub 2 (the Ubuntu bootloader) can load each other's kernels, so it's also an option.

To have Solaris's Grub load Ubuntu's bootloader (which is what I recommend):

Tell Ubuntu to install its bootloader on its own partition, /dev/sda5. (The installation program will probably warn you that this is a bad idea because it doesn't make your system bootable; tell it to go ahead since you're using a different operating system's bootloader to boot your system, which is unusual.)

If you want Ubuntu's bootloader to load Solaris's bootloader (also recommended, but this goes against making Solaris the “primary OS”), install Ubuntu's Grub 2 on the boot sector, and Solaris's Grub 1 on the boot sector of the Solaris partition. Run sudo update-grub on Ubuntu once if you modify Solaris's boot sector after installing Ubuntu, and it'll pick up the Solaris entry (perhaps by a generic name rather than “Solaris”). If update-grub doesn't pick up the Solaris entry, then declare it manually by creating a file called /etc/grub.d/31_local_solaris with the following contents then running sudo update-grub:

If you want Solaris's Grub to load the Ubuntu kernel directly, install it on the boot sector and add entries to menu.lst on Solaris (see above for where this file is located). Note that this is documented to work, but there are reports that it doesn't (it may be a depend on the Solaris version).

I have updated the menu.lst, but still it is not booting up. I doubt about the command 'root (hd0,4)', because it might be taking the 4th partition. But I think its the second partition so I also tried with 'root (hd0,1)'.
–
cyrilsebastianJul 29 '11 at 12:36

I believe you meant to write: what Grub 1 calls (hd0,5) is what Linux calls /dev/sda6, not sda5.
–
jlliagreJul 31 '11 at 8:24

@cyrilsebastian What Grub 1 calls (hd0,4) is what Linux calls /dev/sda5; this is unrelated to the order of partitions on the disk. [Thanks to jlliagre for pointing out the confusing typo.] At the Grub prompt, what is offered if you type (hd0, and press the Tab key?
–
GillesJul 31 '11 at 17:20