Archive for March, 2009

/bin/sh -> bash :(

Posted in HowTo on 26/03/2009 by Undersys

Some of us have odd requirements in life..

HP-UX, Soalris, AIX take your pick of any of he \”real\” unix flavors  they all have a real bourne shell. Usually modified a lot but its still bourne shell no matter how you look at it and still retains usually a lot of the older syntax and quirks of bourne shell.

Jump across to Linux.. hmmm no bourne shell! /bin/sh is a symlink to bash shell.  I like bash shell it makes my life easier.
So whats the issue.. Well as a good friend pointed out to me if we are writing stuff on unix machines and trying to test things at home and well maybe you don\’t have enough systems or don\’t have the same OS or the H/W to run it, or maybe you are transitioning your infrastructure to linux from something. Lets use linux  ok not the best idea but a valid one someday\’s. Now take that huge ass shell script you wrote and try run that on the bash shell.

oh.. epic fail.
You can use korn shell to some degree but that\’s not perfect. Works about 98%.

Or you can compile the real bourne shell!
I was given the following link to a copy of the bourne shell source code. Its quite hard to get surprising

The following steps are quite basic, we are just going to check out the code and compile it under Gentoo.
Note the following will NOT overwrite the /bin/sh

Commands are in Italics

  1. Check out the source code from CVS. Change to your build directory.
    # cvs login
    Hit enter when asked for a password
    # cvs co -P heirloom-sh
    Change directory into the heirloom-sh directory and edit the makefile.
    You must change the \”UCBINST\” option to point to /usr/bin/install
    Other things you may want to look at are install directory\’s and compiler flags. I\’ve set up my CFLAGS to be the same as my make.conf file from my system.
    # make
    # make install

And thats it your done, you now have a real bourne shell. Use it for what ever  wack needs you may have.


Purest Feeling..

Posted in Personal on 23/03/2009 by Undersys

Another non related tech post! But I can’t help this.. to excited

Finally.. I’ve got my hands on a copy of  The Fragile  on vinyl.
This is pretty hard to get  on vinyl. As it was released in 2000, vinyl was not popular, so there’s not to many copies.  Silly people.. vinyl sounds so much nicer :)
Its also got two more tracks then the CD version.

This is what I’ve got

Will go very nicely next to my Downward Spiral on vinyl :)

Sun Netra X1 — Netbooting and Installing Solaris 10/08

Posted in HowTo on 19/03/2009 by Undersys

Oh yes.. there are more Netra’s at my place then you can poke a dead stick at.
The baby to the Netra T1 is the X1 it is smaller in fact its smaller then my Nortel network switches!
Sun System Handbook : X1

This little device is a little more “consumer” grade. It takes standard ECC SD-RAM (pc-133) and standard IDE drives. Has two network ports, and no PCI slot.
I have already modded the X1’s fans.

So this guide will be about net booting Solaris 10 and installing over the network from another Soalris 10 machine.  For ease of deployment I’ll be using a Sun Sparc Enterprise 3000 of mine as described and set up in previous posts. By all means you can mix up your arch. So you can deploy SPARC arch from x86 and vise versa. I just like using the E3000.

This summary is taken from the Solaris 10  10/08 install guides I’ve made a  summary on how to install Solaris 10 via net boot for a good friend.

I’ll be using the ZFS pool i set up in the previous article called “store”.
Note :-
* That I won’t be using DHCP for this as sun makes it “hard” for you when your not using the Solaris DHCP server.
* This is by far the quick and easy way of net booting Solaris 10. You can do so so much more take a look though the Sun install guides
* Make sure your PROM is up to date, I’ve had some odd things happen with old PROM versions. Apply PROM patch 111952-03

Commands are in Italics

  1. Insert the Solaris 10 Install DVD or mount the ISO.. See below
    Sometimes I like to use the ISO image..
    Create a fake device pointing t the ISO
    # lofiadm -a /home/username/solaris.iso /dev/lofi/1
    # mount -F hsfs -o ro /dev/lofi/1 /mnt/dvd
  2. Create a directory to deploy from ( this will hold the install media)
    # cd /store/store
    # mkdir -p deploy
  3. Change to Tools directory on the DVD and run the install server command
    # /mnt/dvd/Solaris_10/Tools/
    # ./setup_install_server /store/store/deploy/
    ( the last directory you be the directory we made in step 2)
    It should spew forth the following :-
    Verifying target directory…
    Calculating the required disk space for the Solaris_10 product
    Calculating space required for the installation boot image
    Copying the CD image to disk…
    Copying Install Boot Image hierarchy…
    Copying /boot netboot hierarchy…
    Install Server setup complete
  4. Set up the boot server
    # mkdir -p /store/store/boot
    # cd /mnt/dvd/Solaris_10/Tools/
    # ./setup_install_server -b /store/store/boot/
    It will spew forth :-
    Verifying target directory…
    Calculating space required for the installation boot image
    Copying Solaris_10 Tools hierarchy…
    Copying Install Boot Image hierarchy…
    Copying /boot netboot hierarchy…
    Install Server setup complete
  5. You need to add the MAC address of the client to be net booted into the /etc/ethers file
    # touch /etc/ethers
    # vi /etc/ethers .  Add the following
    xx:xx:xx:xx:xx:xx X1
  6. Edit the Host file to make the name above resolvable.
    # vi /etc/hosts
    Add the following  (replace with your Ip and domain)
    192.168.0.xx   X1
  7. Now lets add the X1 into the Solaris “install Client”
    cd /store/store/deploy/Solaris_10/Tools/
    # ./add_install_client X1 sun4u (where X1 is the name and sun4u is arch type)
    It should spew forth something like this :-
    making /tftpboot
    enabling tftp in /etc/inetd.conf
    Converting /etc/inetd.conf
    enabling network/tftp/udp6 service
    enabling network/rarp service
    enabling network/rpc/bootparams service
    updating /etc/bootparams
    copying boot file to /tftpboot/inetboot.SUN4U.Solaris_10-1
  8. Connect to your X1 via serial console and make sure you’ve got a network cable plugged into “net 0”
    Issue the following commands at the “ok>” prompt
    ok> boot net
    If all has gone well you should see something like this.. ( note the ARP/RARP timeouts are normal)
    Resetting …Sun Netra X1 (UltraSPARC-IIe 400MHz), No Keyboard
    OpenBoot 4.0, 640 MB memory installed, Serial #xxxxxxxx.
    Ethernet address x:x:x:x:x:xx, Host ID: xxxxxxxx.
    Timeout waiting for ARP/RARP packet
    Timeout waiting for ARP/RARP packet
    Timeout waiting for ARP/RARP packet
    Requesting Internet address for x:x:xx:x:xx:xx
    SunOS Release 5.10 Version Generic_137137-09 64-bit
    Copyright 1983-2008 Sun Microsystems, Inc.  All rights reserved.
    Use is subject to license terms.
    Configuring devices.
    Using RPC Bootparams for network configuration information.
    Attempting to configure interface dmfe1…
    Skipped interface dmfe1
    Attempting to configure interface dmfe0…
    Configured interface dmfe0
    Reading ZFS config: done.
    Setting up Java. Please wait…
    NOTE: Not enough memory for graphical installation.  Graphical installation
    requires 768 MB of memory.  Found 640 MB of memory.
    Reverting to text-based installation.
    Serial console, reverting to text install
    Beginning system identification…
    Searching for configuration file(s)…
    Search complete.
    Discovering additional network configuration…

Just after this you will be asked for install language and terminal type.
Make sure you select the right terminal emulation type,  since i am using mincom and its set to VT102 I’ve selected option 3 “DEC VT100” If you select the wrong type you won’t see the install menu’s correctly.

We should now be seeing the text mode install for Solaris 10. You should now be able to follow the normal install prompts and menu’s to install Solaris as we did on the E3000. Only thing diffrent will be install souce will be set up as NFS and pre populated with the install server IP and NFS share name.

Solaris 10 Base Line Configuration

Posted in HowTo, Projects on 16/03/2009 by Undersys

After the Solaris 10 install on the E3000 we need to do a  few things to get a  somewhat functional system.
During the install I’ve allowed all network services to be open. The E3000 is hidden away on a firewalled VLAN.

Commands are in Italics

  1. Create a user,  other then root…
    Whats that you say?? just log in as root..  no thats just dumb and if you can not understand why move away from your keyboard now
    Creating users in Solaris 10 is easey
    # useradd -m -G users USERNAME ( replace USERNAME with your username)
    This will have a whinge as /home is  controlled by the automounter and is not a “real” directory.
    Create the real user home directory ready for the automounter
    # mkdir  /export/home/USERNAME
    # chown USERNAME:GROUP /export/home/USERNAME
    as per normal replace USERNAME and GROUP with real entry’s
  2. Configure the automounter to pick up your new user. Yes you can disable the automounter for /home, lets just assume your really going to use this as networked system!
    # vi /etc/auto_home
    Do the following changes :-
    * Comment out the line “+auto_home”
    * Add this “USERNAME HOSTNAME:/export/home/USERNAME
    Save and exit vi
    Now make the automouter reread its config
    # automount -v
  3. Time to add some more disks!
    Since I added the disks after the install I need to make soalris rescan its H/W and update /dev
    # devfsadm -vC
    Use the “format” command to make sure we can see new disks. Unformated/Unlabed disks will appear at the top. You can also search the path /dev/dsk <- this is my preference
    # format
    Searching for disks…donec0t1d0: configured with capacity of 16.95GB
    c0t14d0: configured with capacity of 16.95GB
    c0t15d0: configured with capacity of 16.95GBAVAILABLE DISK SELECTIONS:
    0. c0t0d0 <COMPAQ-BD01864552-3B07 cyl 6999 alt 2 hd 20 sec 254>
    1. c0t1d0 <COMPAQ-BD01864552-3B07 cyl 6999 alt 2 hd 20 sec 254>
    2. c0t3d0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>
    3. c0t14d0 <COMPAQ-BD01864552-3B07 cyl 6999 alt 2 hd 20 sec 254
    4. c0t15d0 <COMPAQ-BD01864552-3B07 cyl 6999 alt 2 hd 20 sec 254

    As you can see disk c0t1d0, c0t14d0, c0t15d0  are all unknown to the install.  c0t1d0, holds my Gentoo install so i know c0t14d0, c0t15d0 are the two new disks.


    # ls -la /dev/dsk
    lrwxrwxrwx   1 root     root          50 Mar 16 18:01 c0t14d0s1 -> ../../devices/sbus@3,0/SUNW,fas@3,8800000/sd@e,0:a
    lrwxrwxrwx   1 root     root          50 Mar 16 18:01 c0t15d0s1 -> ../../devices/sbus@3,0/SUNW,fas@3,8800000/sd@f,0:a
    So much nicer don’t you think :)

  4. Format and the new disks and remove any un-needed partitions. Some knowledge on how solaris “format” works here is assumed, if not read the MAN page.. works for me!
    # format
    format> format
    format> p
    partition> p
    Check now for any useless partitions and remove
    partition> 1
    partition> m 0
  5. So lets create a new ZFS pool with the two spare disks.
    # zpool create store c0t14d0s1 c0t15d0s1
    Note the above will create  “Raid 0” like pool, For its purpose I don’t care. My root volume is in mirror.
    Check it..
    # zpool status
    pool: boot_vol
    state: ONLINE
    scrub: none requested

    boot_vol      ONLINE       0     0     0
    mirror      ONLINE       0     0     0
    c0t0d0s0  ONLINE       0     0     0
    c0t3d0s0  ONLINE       0     0     0

    errors: No known data errors

    pool: store
    state: ONLINE
    scrub: none requested

    store        ONLINE       0     0     0
    c0t14d0s1  ONLINE       0     0     0
    c0t15d0s1  ONLINE       0     0     0

    errors: No known data errors

  6. Now we need to create a ZFS file-system on the new pool.
    # zfs create store/store (You can call this what ever you like)
    check to see if its mounted, it should auto mount if all is good.
    # df -h

    we’ll come back to this later, its for the netboot environment

  7. I like to have a few little extra  apps on my Solaris installs. I use for this. blastwave supports Solaris 8 and up on SPARC and x86.
    So lets get to installing it.
    Taken from this guide
    pkgadd -d`/sbin/uname -p`.pkg
    Select “all” when prompted
    Select “y” when prompted
    # mkdir /etc/opt/csw
    # cp -p /opt/csw/etc/pkgutil.conf.CSW /etc/opt/csw/pkgutil.conf
    # /opt/csw/bin/pkgutil –catalog
    # /opt/csw/bin/pkgutil –install gnupg textutils

    answer “y” to any questions here
    # /opt/csw/bin/pkgutil –install wget
    answer “y” to any questions here
    # /opt/csw/bin/wget
    # /opt/csw/bin/gpg –import gpg_key.txt
    Note :- “Method 3” listed on the howto was not working for me at this time
    # /opt/csw/bin/gpg –edit-key A1999E90
    Now type “Trust” and select Option 5, then “y” , finaly type “quit
    Edit the following file to make use of the gpg key
    # vi /etc/opt/csw/pkgutil.conf
    Edit the following :-
    Uncomment the two above entry’s, then save and exit vi.
    Last step! Re fetch the catalog
    # /opt/csw/bin/pkgutil –catalog
    Now you can use the follwoing command to install anything from blastwave
    # /opt/csw/bin/pkgutil –install PKGNAMEI like to update the path just to make my life a little easer..
    Edit the two below files :-
    * /etc/default/login
    * /etc/default/su
    Uncomment/change “PATH=” to the following

This is just a real basic setup. Showing off ZFS and some of my basic tweaks. I’ve be setting up more  services in the next post.

You should be able to connect via SSH and XDMCP.

Solaris 10 10/08 On the Sun Sparc Enterprise 3000

Posted in HowTo, Projects on 15/03/2009 by Undersys

I’ve got a thing for sun gear in particular SPARC. Its just so well made and when i say well made I mean you could drop my E3000 off a cliff and it would still work. It would Most likely break what ever it hit at the bottom.

When Sun first made Solaris 10 Open Source they where giving away free Media kits for quite some time. I managed to get one “Solaris 11/06” Way back before ZFS was even in the Solaris install :)

This article is a primer to the next one hence the reason for a re-install on the E3000. I’ve just finished the download of Solaris 10 10/08  this now includes ZFS  boot support.

For thous not familiar with the E3000 :-
E3000 System Handbook
I’ve got mime populated with the following :-
1x —  501-4883 I/O board with SOC, I’ve also got an HVD SCSI and a FACL card on board all SBUS
3x — 501-4882 CPU/Memory boards each with 2x 336mhz Ultra Sparc2 64bit and 2Gb of ram ( 6 total CPU 6gb Total ram)
1x — Pioneer DVD-ROM drive
1x — Archive Python DDS2 drive.
5x — 18gb U2 10k SCSI disks , local

Not the fastest machine by todays standards but it goes very well for its age, I’ve also got a FACL disk array with it, more on that later..

Solaris 10 Is pretty easy to install. I am doing my install via serial console. Theres not much you can really do during the install. I’ve picked my ZFS pool and included two local 18gb disks, set up net work and its off installing. I’ve opted for the full install + OEM support.

One thing to keep in mind the E3000 will not boot 64bit Solaris 10 without a PROM update!

In order to do this I was required to install Solaris 9 first, update the PROM then install solaris 10.This was because my prom version was far to old to even boot Soalris 10..  lucky me having Solaris media all the way back to Solaris 2.6 :)

Patch ID 103346-30 will get you 64bit Solaris 10. Make sure you copy the new prom version to each CPU board!

Lets log in and check on zfs!

# zpool status
pool: boot_vol
state: ONLINE
scrub: none requested

boot_vol      ONLINE       0     0     0
mirror      ONLINE       0     0     0
c0t0d0s0  ONLINE       0     0     0
c0t3d0s0  ONLINE       0     0     0

errors: No known data errors

Nice Mirrored Root disks now.

Soju! — WIN Korean Goodness

Posted in Personal on 09/03/2009 by Undersys

Yes this is a tech blog…

Soju helps the tech work :D  Well it helps my head work… that and lots of caffeine.

I’ve recently come across Korean Soju at a local Korean restaurant.
The soju I’ve gotten here is made by Jinro and is called “Chamisul Fresh”. This comes in 375ml bottles at 19.5%.
So thats about 5.6 standard drinks. You drink it out of little shot glasses. Tasty as! more so with spicy food!
Like all rice distilled alcohol it has a very unique taste that i love :)

I had to have this at home. So I found  a place to sell it to me.
I’ve now got a box of 20 bottles.

For more information :-

Wiki — Soju

IDE disk boot disk for Netra T1

Posted in HowTo on 09/03/2009 by Undersys

The Netra T1 has an CMD604 IDE controller. Max Ultra DMA2.
Sun has only placed one 44pin IDE header on-board. I am quire sure you could solder a second IDE header on (see the image below), I would not suggest this the 604 has known issues with sending simultaneous DMA requests to each channel.

The header is a standard 40pin header + 4 pin power, so exactly the same as your standard laptop HDD. Sun originally placed this here for you to use a CD-ROM in the Netra via a special “paddle board” that are extremely hard to find!  In all realty we can build our own, but why would you want a CD-ROM when netboot wins!

In order to cut power requirements and to lower the noise level, I wanted to remove the two 9gb SCSI 10k rpm drives. I do not need redundancy nor do I need the speed.

Here is a image of the header in question :-

IDE Header

I brought a 30cm 44pin cable off eBay. You need to file down the sides of the plug to fit into the header, apart from that its 100% pin computable. Pin1 is really pin1.
I placed the IDE laptop HDD over the back SCSI port board as it was a nice snug fit and required no modification to keep the disk in place.
You can see the disk on top on the SCSI IO backplane here, please note I did insulate the disk bottom:-

HDD Location

The OpenPROM on the Netra will detect the disk without an issue.
It will not by default boot to it, nor is there a pre existing boot alias

You must set up an alias for the Netra to boot from the IDE disk.
Do the following at the “ok” prompt:-
(Note you can change BSD to what ever you like)

  • nvalias BSD /pci@1f,0/pci@1/pci@1/ide@e/disk@2,0

Now you can boot the system via

  • boot BSD

Done :) So now we can boot from an IDE, slow but power efficent and also quite.