Monday July 11, 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.
Its an exciting time here in our company. With OpenSolaris out there, I thought I would share bits of information that might make someone else's life out there easier. I am planning on covering a range of topics here, from Solaris administration tips to technical Solaris HOWTOs. Occasional personal rants might make it here as well.