So long and thanks for all the fish

I joined Sun over ten years back almost right out of
school. I started out working on Solaris Security where
one of my first projects was to help integrate SSH into
Solaris 9. Over the years I moved around a bunch and
worked on a myraid of technologies from Solaris Volume 
Manager, NFS and Install. 

During these years I've had the pleasure of working 
with some of the finest engineers in the industry and
made a lot of friends here (some of whom are more like
family at this point). Thank you guys for making this
such a fun place to work!

Besides the people, I have had a chance to experience and
work on truly one of the best Operating Systems on the
planet. Even though the rigor imposed by Solaris 
Engineering on developers seemed daunting and frustrating 
at times,  looking back -- it is one of the primary reasons 
why the OS is so rock solid. I am forever grateful for 
having gotten a chance to work on Solaris.

Now the time has come for me to venture into something 
new – outside Oracle. While I'm excited about the 
opportunity that beckons me, it is tough for me to leave 
behind colleagues with whom I truly loved working with.

This is my last blog entry here. In the future, you can
find my blog at http://alokaggarwal.wordpress.com/. My new 
email will be aggarwaa at cs dot pdx dot edu. I'm on 
Linkedin and Facebook as well should you wish to 
connect that way. 

Thanks again!

Leave a comment

Filed under Uncategorized

Automated Installer from media

The holiday season, the most fun part of the year, is
here. It is also the season to give. I just finished
giving (okay, delivering) another way to do an (automated)
install of OpenSolaris.

Starting with OpenSolaris build 130, the automated
installer (AI) x86/SPARC iso and USB images will be
bootable standalone. That is, the AI media can now be
booted without necessarily needing to setup an AI server/
services. The machine will boot from such media and do an
Automated Install from an IPS repo. Either a default
manifest (pointing to pkg.opensolaris.org/release) can be
used or a custom manifest can be used to specify the
installation parameters.

This opens up a few avenues:

a) SPARC machines that are not capable of wanboot (a requirement
for doing AI over the network), can now be directly booted
and an OpenSolaris install done using that media.

b) The AI media can also be used as a rescue disk.

On SPARC, the following will simply boot the AI media and
not start an install.

ok boot cdrom

On x86, edit the GRUB menu entry to have ‘aimanifest=’. This
will boot the AI media without starting an install.

A user can log in thereafter as root/opensolaris and perform
the necessary repair/diagnostic procedures.

c) An xVM PV install can now be done without needing to setup
an AI server/services so it greatly simplifies the install.

The following command line does a PV install from the AI media:

# virt-install -n domU-mediaboot-ai –paravirt -r 2048 –disk
path=/rpool/domU-mediaboot-ai,size=20,driver-tap,
subdriver-vdisk,format=vmdk -l

http://10.6.35.111:5555/export/home/images/mediaboot-ai.iso

–autocf aimanifest=default,auto-shutdown=enable
–nographics 0:16:36:20:a2:7d

Using a Custom Manifest

If you wish to customize the installation parameters, a custom manifest
must be specified.

On x86, the first choice (also the default choice) in the GRUB menu, allows
one to specify a custom manifest.

On SPARC, the following allows one to specify a custom manifest:

ok boot cdrom – install prompt

(‘ok boot cdrom – install’ uses a default manifest located on the
media instead)

If a custom manifest is specified as above, the user is presented with the
following prompt during boot up:

Enter the URL for the AI manifest [HTTP, default]:

Currently, only an HTTP path to the manifest can be specified. Once enhancement
request 13201 is fixed, it may be possible to specify other sorts of paths as well.

NOTE: If you plan to use the AI media to do an install before OpenSolaris 2010.03
ships, you must install using a custom manifest that specifies ‘http://pkg.opensolaris.org/dev’
instead of ‘http://pkg.opensolaris.org/release’ as the IPS repo to install from. Otherwise the
installed system may not be bootable.

3 Comments

Filed under General

Serving Up Lzma

I just pushed the changes that add LZMA to (Open)Solaris
and also allow lofi(7D) to use LZMA as one of the
supported compression algorithms.

On an snv_111 machine, here's what you will see -

contraption# lofiadm -h
lofiadm: illegal option -- h
Usage: lofiadm -a file [ device ]  [-c
aes-128-cbc|aes-192-cbc|aes-256-cbc|des3-cbc|blowfish-cbc] [-e] 
[-k keyfile] [-T[token]:[manuf]:[serial]:key]
       lofiadm -d file | device
       lofiadm -C [gzip|gzip-6|gzip-9|lzma] [-s segment_size] file
       lofiadm -U file
       lofiadm [ file | device ]

So, if you take large'ish file and compress it with gzip
and lzma, the size difference is quite noticeable.

contraption# du -h solaris.orig
 2.2G   solaris.orig
contraption# lofiadm -C lzma solaris.orig
contraption# du -h solaris.orig
 555M   solaris.orig
contraption# lofiadm -U solaris.orig
contraption# lofiadm -C gzip solaris.orig
contraption# du -h solaris.orig
 702M   solaris.orig

With LZMA support now available for both userland and
kernel consumers, it should be very easy for other Solaris
utilities (zfs?) to provide support for it.  

4 Comments

Filed under General

Compressed lofi for LiveCD – why

The OpenSolaris LiveCD contains hsfs filesystems that
are compressed with lofi compression, primary among
these are solaris.zlib which maps to /usr and solarismisc.zlib
which maps to /mnt/misc. 

The /usr filesystem contains essential components to
allow for the LiveCD to boot into a desktop. As a result
the layout of this filesystem is carefully ordered such
that accesses are sequential as opposed to being completely
random. This careful ordering of contents allows for the
LiveCD to boot into a desktop in a reasonable amount of
time (~3 minutes on most systems).

Since hsfs is the only OpenSolaris filesystem that allows
files to be ordered a certain way via the specification of
'-sort' flag to mkisofs(8), it was the obvious choice for
the /usr filesystem. And, the primary reason why compressed
lofi is used for the LiveCD as opposed to, say, ZFS or dcfs(7FS).

More details can be found in Moinak's slides here.

Leave a comment

Filed under General

Lzma Numbers

I recently wrote that LZMA has been used to pack more languages
onto the LiveCD. Here are some charts that show how LZMA
stacks up against someof the other popular compression algorithms.
(apologies for the poor image quality, open in another window
for a clearer image)















These tests were run on a LiveCD archive using 7za(1).
As you'll note, the compression ratio provided by LZMA is
about 35% better than gzip-9. However, LZMA is more
CPU intensive and as a result the compression and
decompression speed is slower than the alternatives.
So, for some use cases the cpu versus compression
tradeoff might make LZMA unsuitable but for the LiveCD
use case, it is reasonable provided we architect our
solution such that the decompression speed isn't a bottleneck
(Compression speed isn't a problem for the LiveCD architecture)

4 Comments

Filed under General

Lzma on OpenSolaris

The OpenSolaris 2008.05 release that is going to come
out sometime in May is going to have two versions of
the same LiveCD, one with a limited set of languages and
locales and another one with a more fuller set of languages.

One of the big challenges with creating a LiveCD with a
full set of languages was that there was limited amount
of available free space on the CD to allow for including
all the languages. How do you cram more stuff on the CD?
Compress it harder, I say! Even better, compress it with
LZMA!

The OpenSolaris kernel did not have an in-kernel implementation
of LZMA that could be taken advantage of (why do we need an
in-kernel implementation, I'll answer that in a separate blog entry). 
So, in our quest to provide one, we started looking at the LZMA SDK. 
Some of the challenges with porting the source from this SDK to the 
OpenSolaris kernel were that our lawyers were not amenable to the licensing
terms and the compression code was all written in C++ (which,
for the uninitiated, is strongly desisted in the kernel).

If you've ever dealt with lawyers you'll be quick to spot
that the licensing can be particularly troublesome. It was.
But only until we contacted with author of LZMA, Igor Pavlov.
Igor was not only willing to relicense the source code under
CDDL (which would ofcourse be agreeable to the lawyers) but
also willing to re-write the compression code in C. And, he 
did that in just a matter of couple of weeks -  truly outstanding. 
That, to me, is the power behind open source and the sharing 
opportunities it provides for the broader good.

So, thank you Igor for an excellent compression algorithm
in LZMA and thanks for all your assistance in making the
OpenSolaris 2008.05 release what it is. We look forward to
working with you in the future too.

10 Comments

Filed under General

Multiboot – Solaris and Ubuntu

I’ve recently been futzing with getting my laptop
to run both Solaris and Ubuntu. Ubuntu mostly
because I want to run VMware, which does not
support Solaris as the host operating system (yet?).
I wanted to run VMware mostly to cut down my
development time (I’ll save the answer to how I do
that for another day).

I failed miserably in trying to get Ubuntu grub to
boot Solaris; which I later found out that it doesn’t
work because the required changes to Solaris grub haven’t
gone back to the mainstream grub code.

I also realized that the order in which the two operating
systems are installed is also important primarily because
of the deficiency in grub – Ubuntu must be installed first
and Solaris second. This results in Solaris grub being
installed in the master boot record which can then be
taught about where to find Ubuntu by adding an entry such
as this to /boot/grub/menu.lst -

title          
Ubuntu, kernel 2.6.20-15-generic
root           
(hd0,1)
kernel        
/boot/vmlinuz-2.6.20-15-generic
root=UUID=91647296-9aca-4d1f-bdfd-7894ff9f0807 ro quiet splash
initrd         
/boot/initrd.img-2.6.20-15-generic
quiet
savedefault

Having said this, I also found by trial and error that
if you do install Solaris first and Ubuntu second with
the result Ubuntu grub lands in the MBR; you can salvage
the situation by manually slamming Solaris grub into the MBR.

In order to do this, boot off of the Solaris media and
get a shell. Then utter the following incantation -

# /sbin/installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/cNdNsN

where cNdNsN is the root slice. This restores sanity and
you can now add the lines for Ubuntu to the menu.lst
Please note that the Solaris release on the media should be
as close as possible to the installed Solaris release (if not
the same)

Leave a comment

Filed under General