Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
    
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)? –  Gilles Jul 26 '11 at 20:28
    
Solaris is on /dev/sda1 Ubuntu is on /dev/sda5 so what could be the proper command? –  cyrilsebastian Jul 27 '11 at 10:17
add comment

2 Answers

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.

share|improve this answer
    
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? –  cyrilsebastian Jul 27 '11 at 10:27
add comment

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.)
  • In Solaris, add a menu entry for Ubuntu in the menu.lst file (typically located in /boot/grub/menu.lst, but use the command bootadm list-menu to see where it is on your system):

    title Ubuntu
    root (hd0,4)
    chainloader +1
    

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:

#!/bin/sh
set -e
prefix=/usr
libdir=${prefix}/lib
. ${libdir}/grub/grub-mkconfig_lib

cat <<'EOF'
menuentry 'Solaris' {
EOF
save_default_entry
prepare_grub_to_access_device /dev/sda1
cat <<'EOF'
  chainloader +1
}
EOF

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).

title Ubuntu
root (hd0,4)
kernel /vmlinuz root=/dev/sda5 ro
initrd /initrd.img

title Ubuntu (single-user mode)
root (hd0,4)
kernel /vmlinuz root=/dev/sda5 ro single
initrd /initrd.img

I don't think Grub 2 currently supports loading a Solaris kernel directly.

share|improve this answer
    
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)'. –  cyrilsebastian Jul 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. –  jlliagre Jul 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? –  Gilles Jul 31 '11 at 17:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.