Thursday, 15 March 2007

HOWTO Mount a CD-ROM into a Local Zone on Solaris 10

Imagine a situation when you need to install software from a CD-ROM into a local zone on Solaris 10. As you may know the CD-ROM physical device is not available in the local zone and therefore you can not access the media directly. Of course you can copy the files from the CD-ROM to a local zone directly from within a global zone as the most straightforward solution, but that would be a little inefficient and cumbersome. A cleaner and faster way to accomplish this is by using the loopback filesystem in Solaris and loopback mount the CD-ROM mount point from within the global zone into local zone. For instance assuming we have a local zone called testzone installed under /opt/zones/testzone we can take the following actions accomplish the task:

1. Assuming vold is running in the global zone and the media is in the CD-ROM/DVD-ROM, vold should mount the media under /cdrom directory. For instance I have a JES4 DVD in my machine:

# ls /cdrom
cdrom0 jes_05q4_dvd
2. Let's create a mount point in the local zone for the CD-ROM:
# mkdir /opt/zones/testzone/root/mnt/cdrom
3. Now we can loopback mount the CD-ROM/DVD into the local zone and install the software as if the media was available directly to the local zone:
# mount -F lofs /cdrom/cdrom0 /opt/zones/testzone/root/mnt/cdrom

# zlogin testzone
# zlogin full
[Connected to zone 'testzone' pts/9]
Last login: Thu Mar 15 11:09:39 on pts/9
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
#
# ls /mnt/cdrom
Copyright License README Solaris_sparc Solaris_x86
#
Done!

Wednesday, 7 March 2007

Tcl Rules the Roost on Regular Expressions

Tcl doesn't enjoy nearly as much popularity as Perl. Even though Perl is considered the scripting language of choice for doing regular expression processing on text, apparently Tcl beats Perl quite handily as far as speed of regular processing is concerned. The regex-dna benchark that is particularly sensitive to the speed of processing of RE's is good demonstration of Tcl's prowess in regular expressions. Tcl is apparently topping the charts handily beating most scripting language runtimes and most compiled languages:

Tcl is more than 4 times faster than Perl, 3 times faster than Ruby, and 2 times faster than Python! So if you're in a dire need of a scripting language that is capable of performing blazing fast regular expressions processing, time to consider Tcl.