An intern's life in the Solaris World
Shawn Debnath
Archives
« July 2009
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
31
 
       
Today
XML
Search

Links
Referrers

Today's Page Hits: 3

All | General | Solaris
20050711 Monday July 11, 2005
Solaris Internals 2nd Edition!
Yep, thats right, the second edition for the only book with in-depth technical coverage on Solaris is in works! And guess what? I am working on the UFS chapter (many thanks to Richard)! More information here: http://blogs.sun.com/roller/page/rmc/20050708.

Jul 11 2005, 10:49:12 PM PDT Permalink Comments [1]

20050615 Wednesday June 15, 2005
Dual Booting Solaris and Linux
WARNING: If you are not careful, you can toast your system. This article is for informational purposes only. Neither Sun nor I can be held responsible for any action you take based on this article. Be very careful and read the entire article before attempting to tinker with your system. And backup your files!
Welcome to the OpenSolaris era! Undoubtedly, folks will want to run Solaris and Linux on the same machine and if you are an OS junkie like me, perhaps you also have several different flavors of BSD and Linux and your pet OS project installed as well. In this blog, I am going to focus on getting a Solaris installation to play nice with an existing installation of Linux using GRUB and at the end talk a bit about what if you are like me and have to install Linux on a system which already has Solaris.

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 XFS
In 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.img
In 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.img
I 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 :-)

What to do if you already have Solaris installed and want to install Linux?

Welp, its quite easy surprisingly. Go ahead and install your favorite Linux distribution in a separate partition and install GRUB on the Linux side. Yes you will no longer be able to boot into Solaris b/c more than likely the Linux setup program overwrote the MBR. So what do we do? Insert the Solaris CD/DVD (build 14 of Nevada or later) and get to the command line by choosing option 6 Single User during bootup. Once in, mount your solaris partition, edit the menu.lst file in /boot/grub and type the required linux boot section directives in (yes, you should have written it down after you installed Linux, but no worries, you just need more coffee and couple more reboots). All set, check your setup with bootadm again, and then do the following:
sdebnath@tornado [~]  %  cd /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]  % 
And 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).

Hope this helped. If it didn't, feel free to post questions here, and I will try my best to check it often.


Jun 15 2005, 10:09:11 AM PDT Permalink Comments [10]

20050526 Thursday May 26, 2005
Hello Blog World
A very brief introduction is in order here. I have been at Sun since March 2004 as an intern in the file systems group in Solaris. I have primarily worked on UFS, filebench, and now slowly starting to weave my way into the NFS and "future NFS" projects. Thanks to Sun, I have lived in Colorado and California while working full time and continued as part time while attending Purdue University. So far I am quite amazed at the Sun culture and have truly fallen in love with it.

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.


May 26 2005, 03:22:07 PM PDT Permalink Comments [1]