Wednesday June 15, 2005 We have to use the Solaris installation to boot Linux because, at this time, only this version of GRUB understands Solaris UFS. Luckily, we pack in more drivers for other file systems so you can boot a multitude of operating systems:
Ext2fs FAT and VFAT Fast File System ISO9660 JFS MINIX ReiserFS UFS and UFS2 VSTA file system and XFSIn order for this blog to be of any use for the common case, you need to understand how GRUB interprets disks and their partitions (GRUB Manual) and you need to have at least one of your favorite Linux distributions installed and booting with GRUB. Since, the boot options vary with each distribution, I am going to focus on the Ubuntu Linux distribution, which if you haven't tried yet, you should definitely look into. Log in to the Linux system and with your favorite editor open up /boot/grub/grub.conf (or in some systems /boot/grub/menu.lst). Locate your boot section (lack of better words for the couple of lines which starts with a title, defines a root and tells GRUB where the kernel and modules are). Write this down on a piece of paper. Here's what it might look if you are running Ubuntu:
title Ubuntu Linux root (hd0,1) kernel /boot/vmlinuz root=/dev/hda2 ro console=tty0 initrd /boot/initrd.imgIn the above configuration, my Linux distribution is installed on the first partition of the first hard drive. Yes the partition numbering starts with 1, whereas the hard drive numbering starts with 0.Don't ask why. The next step is to install Solaris, which I am definitely not going to cover here. Google for it and I am sure you will find what you need.
If things went right, you will not see the option of booting into Linux right away, but in the GRUB menu you should notice that you have the option of booting either Solaris or Solaris failsafe. Choose the first and lets get logged in to Solaris as root. Just a note, the GRUB boot method was made available with build 14 of Nevada, so make sure you have this build or something newer. Once in, navigate your way to /boot/grub and with your favorite editor open menu.lst. Near the end of the file, add in all the lines you wrote down on the piece of paper. Here's what mine looks like:
[the first part snip'ed out] title Solaris 10.1 nv_14 X86 root (hd0,0,a) kernel /platform/i86pc/multiboot module /platform/i86pc/boot_archive
title Solaris failsafe root (hd0,0,a) kernel /boot/multiboot kernel/unix -s module /boot/x86.miniroot-safe
title Ubuntu Linux root (hd0,1) kernel /boot/vmlinuz root=/dev/hda2 ro console=tty0 initrd /boot/initrd.imgI would advise you to not touch the Solaris boot sections at all. Do double check your work with bootadm, here's how:
sdebnath@tornado [/usr/sbin] % sudo bootadm list-menu default 0 timeout 10 0 Solaris 10.1 nv_14 X86 1 Solaris failsafe 2 Ubuntu Linux sdebnath@tornado [/usr/sbin] %And thats its! Reboot and you should be now able to boot into your favorite Linux distribution :-)
sdebnath@tornado [~] % cdAnd that should be it. The '-m' specifies it to be written to MBR instead of being written to the partition. stage1 and stage2 are the respective files (you could specify the path but we cd'ed to the dir). And /dev/rdsk/c0d0s0 happens to be my root Solaris parition (yours could be different)./boot/grub sdebnath@tornado [ /boot/grub] % ls bin jfs_stage1_5 reiserfs_stage1_5 ufs_stage1_5 e2fs_stage1_5 menu.lst splash.xpm.gz vstafs_stage1_5 fat_stage1_5 menu.lst.orig stage1 xfs_stage1_5 ffs_stage1_5 minix_stage1_5 stage2 install_menu nbgrub stage2_eltorito iso9660_stage1_5 pxegrub ufs2_stage1_5 sdebnath@tornado [ /boot/grub] % sdebnath@tornado [ /boot/grub] % installgrub -m stage1 stage2 /dev/rdsk/c0d0s0 Updating master boot sector destroys existing boot managers (if any). continue (y/n)?y stage1 written to partition 0 sector 0 (abs 2016) stage2 written to to partition 0, 229 sectors starting 50 (abs 2066) stage1 written to master boot sector sdebnath@tornado [ /boot/grub] %
Hope this helped. If it didn't, feel free to post questions here, and I will try my best to check it often.
. e1, Sun CSO Asia South.
Posted by Iwan Rahabok on November 27, 2005 at 06:03 PM PST #
Posted by Rainer Frey on March 13, 2006 at 02:39 AM PST #
Posted by Adam Stephen on April 04, 2006 at 08:41 AM PDT #
Error 1: Filename must be either an absolute pathname or blocklist
Before the solaris installation all my OS's lives in armony, now only lives Solaris and Debian together, but Debian don't boot. I'm very angry because the poor documentation about this topic.
My grub conf is:
title Debian GNU/Linux
root (hd0,4)
kernel /boot/vmlinuz root=/dev/hda5 ro
initrd /boot/initrd.img
savedefault
boot
Solaris boot's ok, not the same with my Debian. I don't now what to do.
Thanx. :)
Posted by Luis Antonio Galindo Castro on July 10, 2006 at 12:40 PM PDT #
I also installed grub on the boot sector of my Debian partition and chainloaded this from the Solaris grub so that the Debian Automagic Kernel list updates would still work.
You can also add an entry to this menu to chainload back to the Solaris grub. This means an extra menu to get to Debian, but I judged that the benefits outweighed this.
Posted by Gerry Munn on October 11, 2006 at 06:51 AM PDT #
I have a boot configuration that has Windows XP Pro, Ubuntu Linux, and Solaris 10 installed in that order. Consequently, I'm using GRUB from Solaris 10. Initially, it only saw the Windows XP but, I copied into the Solaris GRUB menu.lst file the entries that boot Ubuntu Linux from Ubuntus' menu.lst. The curious thing about this is that I find that when booting into the Solaris GRUB, it does not boot Ubuntu Linux. It seems to begin booting but then "goes off into space" meaning that it seems to go through the boot process (verbose mode is obviously on) until it reaches the CD driver upon which it stops and waits for a good 10 minutes or so. At that point it goes to the Ubuntu single user command line. However, at the Solaris GRUB menu, if I choose to go directly into GRUB command line mode and explicitly enter the commands behind the Ubuntu Linux GRUB entry, then it boots just fine. I've tried everything I can think of to resolve this problem but, no luck.
The commands behind the Ubuntu Linux entry is something like the following. I can't testify to the exact commands because I'm going from memory:
title Ubuntu Linux,
root (hd0,2)
kernel /boot/vmlinuz root=UUID=4bcb-0023-9cab-[more alphanumeric strings] ro quiet splash
initrd /boot/initrd.img
After entering these commands, I follow this with the boot command which is not explicitly part of menu.lst. If anyone has any ideas I would really appreciate some insight.
Thanks,
Robert
Posted by Robert Parkin on September 26, 2007 at 02:03 PM PDT #
great guide, thanks man.
Posted by matt on November 22, 2007 at 08:43 PM PST #
i got it to work for Windows 2000/ Solaris 10 and Kubuntu 7.0.
Had to install in that order.
Windows then Solaris
then partitioned the free space in Windows before installing Kubuntu.
Installed Kubuntu then forced back the mbr of solaris.
Then edited the menu.lst file to get it to work.
Had to include console=tty0 instead of splash and changed the root=UUID= to root=sda4 (sda4 is where kubuntu is located on my HDD in Kubuntu language).
To find out it was sda4 i had to boot using the kubuntu live cd.
Good luck guys. Thanks for the blog Debnath!
Posted by Patrick on January 31, 2008 at 03:04 PM PST #
I am new to Linux and Unix. I decided to get rid of Windows and installed Ubuntu first. When I installed OpenSolaris 10, I ran into the issue that brought me to your blog – only Solaris would boot. Learning from your instructions, I reinstalled Ubuntu, took down the information from the menu.lst file:
title Linux
root (hd0,1)
kernel /vmlinuz root=/dev/hda2 ro
and then tried to install Solaris again. After the install, I opened Solaris’ menu.lst file and added my Ubuntu information. After restarting, it gave me the option for either OS, but when I chose Linux, it told me that it was an unknown file type and could not load. I tried fooling around with different things, but basically had the same result – Linux would not boot. I decided to just install Ubuntu on the drive, although I left about 20GB open in case I figured anything out.
I noticed that both times I installed Solaris, it erased my Linux swap drive. Always starting with four partitions, I would end up with only two. Upon further research, at Linux.com, an article said that Solaris and Linux do not like to exist on the same hard drive, so they suggest to install on separate hard drives.
If I do the same thing to Solaris’ menu.lst file, but have the OS’ on separate hard drives, will this allow me to dual boot? I don’t want to lose my Linux stuff again (it’s backed up, but just an inconvenience). Thanks for any advice!!
Posted by Jason on July 23, 2008 at 08:09 AM PDT #
another approach to this topic...
I have Ubuntu installed on an extended partition and win XP on my primary partition. I decided to uninstall Windows and change it to Solaris 10 (with ZFS as primary filesystem type).
Solaris installed it's own GRUB and overwrote Ubuntu GRUB, so I wrote the following lines into menu.lst (on Solaris /rpool/boot/grub/menu.lst):
title Ubuntu 8.10
root (hd0,4)
chainloader +1
obviously you have to be sure that (hd0,4) is your Linux partition (in my case it was /dev/sda5)
After this, I booted my Ubuntu 8.10 with a Live CD and mounted my /dev/sda5 as /mnt and issued the following command:
sudo grub-install --root-directory=/mnt /dev/sda5
When I boot my machine it starts with Solaris GRUB. You can start Solaris from here.
Additionally, it appears an Ubuntu 8.10 Option, if you choose it, it goes to Ubuntu GRUB with those options installed on it and you can start Ubuntu from Here
Posted by Eduardo on April 07, 2009 at 09:16 AM PDT #