Archive for December, 2008

A great start into the new year 2009!

December 31, 2008

I am sure you agree – at least after watching the video on Brendan’s blog entry about I/O performance analysis on the Sun Storage 7000 series. The direct link is here.

Happy New Year to everyone!

Advertisements

Multibooting OpenSolaris 2008.11, Kubuntu 8.10, and Windows XP (one disk)

December 30, 2008

A while after I published my blog entries on Multibooting Solaris and Windows XP and on Multibooting Solaris, Ubuntu, and Windows XP, I thought it was time for some instructions on multibooting OpenSolaris 2008.11, Kubuntu 8.10, and Windows XP.

On my laptop, a Fujitsu-Siemens S6120D (Pentium M 1.4 GHz, 512 MB RAM, 40 GB IDE disk), I wanted to replace my old Solaris Nevada installation by the new OpenSolaris 2008.11, and then also an old Ubuntu 6.10 by Kubuntu 8.10.

After the OpenSolaris installation, I could boot into OpenSolaris and Windows XP just fine. But when I installed Kubuntu (using ext3 as the / filesystem), with the default install options, the grub that had been installed by OpenSolaris had been overwritten by Kubutu’s grub. Even after adding old OpenSolaris entries to the new grub, booting into OpenSolaris failed. After installing OpenSolaris again, that problem was solved, but I could not boot into Kubuntu! The following message was shown on screen:

Booting 'Ubuntu 8.10, kernel 2.6.27-7-generic'
root            (hd0,6)
Filesystem type is ext2fs, partition type 0x83
kernel          /boot/vmlinuz-2.6.27-7-generic root=UUID=69585a5b-ba20-43da-984c-148c40f82a7e ro quiet splash
Error 2: Bad file or directory type
Press any key to continue...

Apparently, neither of the two grub installations could read the root filesystem of its “opposite” operating system. The solution for this problem in my case was to chainload the Linux grub from the Solaris grub. I used the following procedure after installing OpenSolaris:

  1. Live boot from the Kubuntu CD and install, or use the “install to disk” menu item (2nd menu item in Kubuntu’s entry screen).
  2. Configure all necessary settings, as in the following screen shots:


    Start by choosing the installer’s language:


    Select a city close to your desired time zone:


    Select a keyboard layout:


    In the Prepare disk space screen, a proposal like the following might be shown:


    Select the manual partitioning feature to overwrite the old Linux partition:


    The Prepare partitions screen is shown, for example:


    Customize that screen according to your needs, like the following:


    Enter data into all required fields of the Who are you? screen:


    The Ready to install screen is shown. Please DO NOT CLICK on the Install button at this point in time. Instead, click on Advanced:


    This will show up the following screen:


    Change the default Device for boot loader installation to the device name of the Linux partition as shown in the partitioning screen (in my case /dev/sda7). This is to install the boot manager not in the master boot record but in the partition in which Kubuntu is installed.
    Press OK to continue, and then Install in the screen that was shown before (Step 6 of 6). This will install Kubuntu.

  3. After the installation has finished, reboot into OpenSolaris and change file
    /rpool/boot/grub/menu.lst (yes, that’s the location of menu.lst in OpenSolaris 2008.11) as follows:
    Add the following lines to boot from the OpenSolaris grub into the Ubuntu grub:
    menu Kubuntu 8.10
    root (hd0,6)
    chainloader +1

    Note that (hd0,6) corresponds to partition number 7 of the first disk (=device /dev/sda7 in my case).

  4. Reboot. You should now be able to boot into Kubuntu’s grub and from there into the various menu items configured during the Kubuntu installation (Kubuntu, Kubuntu failsafe/single user, memtest, and even Windows XP).

If it doesn’t work (e.g. if you installed the Kubuntu grub boot manager to the master boot record), you do not have to install Solaris again. Just do the following to overwrite the Kubuntu grub by the Solaris grub:

  1. Boot from the OpenSolaris 2008.11 CD.
  2. After booting has finished, open a terminal window and log in as root (password is “opensolaris”).
  3. Run the following command:
    $ format
    Notice the device name (e.g. c3t0d0). Install the Solaris grub into the master boot record, using the “-m” option of the installgrub command. For the last argument, add s0 to the device name: /usr/sbin/installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c3t0d0s0
    This will install the boot manager into the master boot record.
  4. Reboot. You should now be able to boot into Solaris or Windows.
  5. Boot into Solaris and add the Kubuntu lines as mentioned above.
  6. If the Kubuntu grub had not been installed into the Kubuntu partition before, you might be able to do this from the Kubuntu live CD or a Linux rescue CD (I haven’t tried that yet). If not, install Kubuntu again using the steps described in the first part of this blog entry.

Some remarks:

This is how the two FAT partitions look like after mounting them in OpenSolaris:

/dev/dsk/c3d0p0:1        55958     34547     21411  62% /p/sda1
/dev/dsk/c3d0p0:2      8481752   7093052   1388700  84% /p/sda8

These are the /etc/vfstab entries for mounting the two FAT partitions from OpenSolaris:

/dev/dsk/c3d0p0:1  /dev/rdsk/c3d0p0:1  /p/sda1  pcfs  2  yes  -
/dev/dsk/c3d0p0:2  /dev/rdsk/c3d0p0:2  /p/sda8  pcfs  2  yes  -

This is how my partition table looks like, from a Linux fdisk /dev/sda point of view:

Disk /dev/sda: 40.0 GB, 40007761920 bytes
255 heads, 63 sectors/track, 4864 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xbb88bb88
Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1           7       56196    6  FAT16
/dev/sda2               8        1224     9775552+  bf  Solaris
/dev/sda3            1225        4864    29238300    5  Extended
/dev/sda5            1225        3100    15068938+   7  HPFS/NTFS
/dev/sda6            3101        3164      514048+  82  Linux swap / Solaris
/dev/sda7            3165        3806     5156833+  83  Linux
/dev/sda8            3807        4864     8498353+   b  W95 FAT32

Please back up all your files before installing a new OS to your system! And as always in my blog, no guarantee, warranty, or similar, for anything! This is just a (hopefully error-free) documentation of how things worked for me. Maybe you’ll find it useful.

More on multiple Firefox packages on Solaris

December 30, 2008

After Alfred mentioned my blog entry on installing multiple versions of Firefox on Solaris using pkgadd instead of tar, I tested the package renaming script with Firefox 3.1b2 and found that I cannot extract the version number just from the pkginfo output. Instead, I had to use the VERSION line of the pkginfo -l output.

So I uploaded a changed version of the rename-firefox-pkg script (under its old name, as I only changed one line, and the script still works as before with older packages like Firefox 3.0.5 and Firefox 2.0.0.19).

OpenSolaris 2008.11: useful packages to install

December 25, 2008

Just a list of OpenSolaris packages I often install (using the pkg install command or the Package Manager, or the “Add More Software” icon) after OpenSolaris 2008.11 installation:

Package name Contents
openoffice OpenOffice
SUNWgnome-img-editor GIMP, the image manipulation program
SUNWvncviewer VNC Viewer
SUNWtvnc Tight VNC
SUNWcurl Curl
SUNWgnome-config-editor The Gnome configuration editor
SUNWj6dev Java 6 SDK
sunstudioexpress Sun Studio (Compiler and Tools)
SUNWgcc GNU Compiler
SUNWgnome-common-devel Gnome Development Tools
SUNWapch22 Apache 2.2 web server
amp AMP (Apache, MySQL, PHP) development kit
amp-dev AMP development cluster
SUNWgnu-mc GNU Midnight Commander

For unattended zones installation, some more packages should be installed if the zone locale is not “C”: This is done in file /usr/lib/brand/ipkg/pkgcreatezone. I added the following lines after line 179:

#
# Get some locale and language packages:
#
pkglist="$pkglist SUNWloc SUNWlang-enUS"

Multiple versions of Firefox packages on one Solaris system

December 25, 2008

Up to now, in cases where I had to use multiple versions of Firefox on the same Solaris system, I installed the latest version as pkgadd, and the other versions as tar, for example in /usr/local. This is because the Solaris contributed builds always are published under the same name (which is probably OK for most users).

But it is also possible to install multiple versions of Firefox (3.0.5, 3.0.4, 2.0.0.19, and so forth) on the same system, after extracting and then changing each package before installation. Here’s how it works:

  1. Expand the pkg.bz2 file to pkg, using bzip2 -dc.
  2. Create a temporary directory where the package content will be stored.
  3. Using the -s pkgadd option, spool (extract) the package into this directory.
  4. In the spool directory, rename the old Firefox directory to a new name (for example firefox to firefox-305).
  5. Change the pkginfo file to the new package name (e.g. MOZfirefox to MOZfirefox-305).
  6. Change the pkgmap file to match the new directoy name and the new size and checksum of the pkginfo file.
  7. Install the renamed package, using pkgadd -d . MOZfirefox-305, for example.

Here’s how it looks like after the installation:

/tmp# ls -ald extr*
drwxr-xr-x 3 root root 188 2008-12-23 22:11 extracted-firefox-20081223-221103
drwxr-xr-x 3 root root 188 2008-12-23 22:15 extracted-firefox-20081223-221529
drwxr-xr-x 3 root root 190 2008-12-24 12:02 extracted-firefox-20081224-120152
/opt/sfw/lib# pkginfo | grep MOZ
application MOZfirefox-20019                firefox 2.0.0.19 for Solaris 10
application MOZfirefox-304                  firefox 3.0.4 for Solaris 11
application MOZfirefox-305                  firefox 3.0.5 for Solaris 11
/opt/sfw/lib# ls -l
drwxr-xr-x 13 root bin 46 2008-12-24 12:02 firefox-20019
drwxr-xr-x 13 root bin 47 2008-12-23 22:15 firefox-304
drwxr-xr-x 13 root bin 47 2008-12-23 22:15 firefox-305

I wrote a script which performs all these steps (except installation). I have tested it on various Solaris releases from Solaris 10 to OpenSolaris. So far, I have not seen any errors.

As always: No guarantee or similar. Please back up your files before using the script.

Firefox for Solaris – latest versions as of Dec. 2008

December 23, 2008

These are the direct links for downloading the latest versions of Firefox for Solaris (thanks to everyone involved for making them avaiable!):

Version x86 SPARC
Firefox 3.0.5 OpenSolaris pkg  |  tar

pkg  |  tar
Firefox 3.0.5 Solaris 10 pkg pkg
Firefox 2.0.0.19 Solaris 10 pkg  |  tar pkg  |  tar
Firefox 2.0.0.19 Solaris 8 pkg  |  tar pkg  |  tar

Note: Firefox 2.0.0.20 was only made available for Windows (an important Firefox fix for Windows was missing in 2.0.0.19).

OpenSolaris 2008.11: More on unattended zones installation and the sysidcfg file

December 22, 2008

After my posting about a new zone for a web server, I did some more tests with the sysidcfg file and found that the following entries work (thanks, Jerry, for sending me a simple sample sysidcfg file):

system_locale=C
works fine.

system_locale=en_US.UTF-8
works after I added the following to file /usr/lib/brand/ipkg/pkgcreatezone in the global zone (after line 179) before starting the installation of the zone:

#
# Get some locale and language packages:
#
pkglist="$pkglist SUNWloc SUNWlang-enUS"

I found out the packages by looking into /usr/share/locale and /usr/lib/locale and searching for locales using (for example):
$ pkg search en_US.UTF-8

An example of a package that contains several languages is: SUNWinstall-l10n.


root_password=(short password string from Solaris 10’s /etc/shadow file)
works fine. The old password string will be put into the new /etc/shadow file of the 2008.11 zone but can later be changed from the command line (using the passwd command) and will then be replaced by a long string.


keyboard=...
is apparently not needed, as the terminal and keyboard works fine for me even without that parameter.


name_service=NONE
works fine.

name_service=DNS {domain_name=domain.TLD
name_server=DNS_IP_ADDR_1,DNS_IP_ADDR_2
search=domain.TLD
}

works fine as well. In case the system cannot verify some of the information, it displays just one confirmation screen (as usual, after configuring the same settings by hand) and after choosing “No” to not enter the information again and using <esc>-2, the rest of the sysidcfg configuration remains intact and will not be asked again, and shortly afterwards the login prompt is displayed.


terminal=xterms
works fine.

Building an energy efficient and virus-free office PC with OpenSolaris 2008.11

December 21, 2008

I chose the Intel D945GCLF board with an Intel Atom processor 230 with a TDP of just 4W. The northbridge/GPU apparently needs more power, so it is cooled with a fan whereas the CPU does not need one. Unfortunately, the fan is really loud. The following picture shows the original configuration with an additional case fan for CPU and RAM:

I looked at various northbridge coolers (for example the Zalman ZM-NBF47, mentioned in this blog entry by Matthias Pfützner) but then found a much cheaper and very elegant solution: I just removed the existing northbridge/GPU fan and installed a standard 80mm quiet fan (about 1000/min) on top of the cooler, using just one of the two cooler holes by mounting the fan with a 3mm screw and nut:

I also added a small part of a plastic packaging to the fan so more air would flow downwards towards the CPU cooler (this reduced the CPU temperature by 2 to 3 degrees Celsius):

The whole PC with 2 GB RAM and DVD-ROM drive needs just 30W which is OK, I think.

For the OpenSolaris 2008.11 installation, my first attempt was to install it on an external 200GB USB drive. But contrary to my installation experience on my Intel D201GLY2A (see my other blog entry), this time the USB ports got renamed at every next cold boot attempt, so I had to try all USB ports until the disk drive was found. Which is really funny if your USB disk has two connectors (an additional one for extra power). The good thing was that the power supply of the case had an additional SATA power outlet. And as the D945GCLF mainboard has two SATA connectors, and my external USB disk was a SATA type disk drive, I could remove the disk from its USB case and install it inside the computer case. As it only has 5.25″ and 3.5″ drive bays, I attached an additional u-shaped sheet of metal in the 5.25/3.5″ drive bay so that the 2.5″ disk is supported from below and has a solid, flat metal surface to lay on, and the two mounting screws on just one side of the disk are sufficient to keep it in place:

Installation went smoothly from the OpenSolaris 2008.11 CD. Network and Sound worked right from the start. Up to now, I only had a problem with printing from Firefox: The fonts were either pixel fonts with a very coarse resolution or the font hinting was not implemented (the spaces between characters did not look correctly). I have not yet analyzed that problem so far.

Installing OpenSolaris 2008.11 on a USB stick

December 14, 2008

For installing OpenSolaris 2008.11 on a USB stick (installation on a 250 GB USB drive worked fine for me), please be aware of bug 4755 which leads to a GRUB> prompt after attempting to boot from a newly installed OpenSolaris 2008.11 USB stick.

Here’s how it worked for me, on a Intel D201GLY2A system with 1 GB RAM:

  1. Change your BIOS so that it will boot from USB or CD, if present
  2. Boot from the OpenSolaris 2008.11 CD
  3. After the system as booted, plug in a USB stick with at least 4 GB (in my case 8 GB) capacity and wait until a new symbol shows up on the desktop
  4. Double click on the “Install Solaris” icon, select the USB stick, use the “use whole disk” setting, proceed through the rest of the installation customizing and press the appropriate button to start the installation.
  5. Wait until the installation has completed, but do not press the “Reboot” button!
  6. Follow this advice:
    1. Download this file (76.8 kB)
    2. unzip and untar it to /tmp, using command
      cd /tmp
      gzip -d grub_zfs_devid.tar.gz | tar -xf -

      (will create two files: stage1 and stage2)
    3. run
      zpool status
      to find out the device name of the newly created pool on the USB stick. Let’s assume the device name shown is /dev/rdsk/c4t0d0s0.
    4. and install the two files from the tar file on that device:
      installgrub /tmp/stage1 /tmp/stage2 /dev/rdsk/c4t0d0s0
  7. Then, press the reboot button. Take out the OpenSolaris CD when the system starts booting, so that it will boot from the USB stick. According to the bug, booting might fail if the boot order is changed in the BIOS, so until the bug is fixed, you should keep the boot order as it was during the installation.

OpenSolaris 2008.11: How to create a new zone for an Apache web server

December 10, 2008

For those of you that want to install a web server in an OpenSolaris 2008.11 zone (e.g. for separating a web server from a file server while using the same hardware), here’s a short howto. The procedure is a bit different from previous OpenSolaris releases as the zone files are not immediately available after the zone is installed – might have something to do with the new ipkg zone brand. The zone installation is now much faster than before. Here’s how I got it installed:

  1. Create a parent zfs filesystem for the zone’s root, if it does not yet exist:
    $ zfs create -o mountpoint=/zones rpool/zones
  2. Create a zone configuration file:
    $ cat > /var/tmp/webserv-z.cfg
    create
    set zonepath=/zones/webserv-z
    set autoboot=true
    add net
    set address=192.168.0.20/24
    set physical=ADAPTER
    set defrouter=192.168.0.1
    end
    verify
    commit
    exit
    

    Please replace ADAPTER by the name of your network adapter (can be seen in the output of ifconfig -a | nawk '!/^[\t]/&&!/lo/{gsub (":", "");print $1}' or just ifconfig -a, for example). In my case, it was sfe0 on one system and bge0 on another.
    Then, configure the new zone:

    $ zonecfg -z webserv-z -f /var/tmp/webserv-z.cfg
  3. Install the new zone:
    $ zoneadm -z webserv-z install
    A ZFS file system has been created for this zone.
    Authority: Using http://pkg.opensolaris.org/release/.
    Image: Preparing at /zones/webserv-z/root ...
    Cache: Using /var/pkg/download.
    Installing: (output follows)
    Refreshing Catalog 1/1 opensolaris.org
    Creating Plan /
    DOWNLOAD                                    PKGS       FILES     XFER (MB)
    SUNWPython                                  6/52    213/7862    1.71/72.41
    Completed                                  52/52   7862/7862   72.41/72.41
    PHASE                                        ACTIONS
    Install Phase                             3637/12939
    
    
  4. Wait! Before booting the zone, mount it first:
    zoneadm -z webserv-z mount

  5. Create a configuration file with the name sysidcfg (for sample files and a detailed explanation on the syntax, see: this link on http://docs.sun.com) in directory /zones/webserv-z/root/etc so you don't have to go through all the configuration screens after connecting to the new zone the first time:
    $ cat > /zones/webserv-z/root/etc/sysidcfg
    system_locale=C
    timezone=Europe/Berlin
    terminal=xterms
    security_policy=NONE
    timeserver=localhost
    root_password=PASSWD_STRING
    name_service=dns {domain_name=DOMAIN.TLD
    name_server=DNS_IP_ADDR_1,DNS_IP_ADDR_2
    search=DOMAIN.TLD
    }
    network_interface=primary {hostname=webserv-z
    ip_address=192.168.0.20
    netmask=255.255.255.0
    protocol_ipv6=yes
    default_route=192.168.0.1
    }
    nfs4_domain=dynamic
    

    Before proceeding, please replace the placeholders DOMAIN.TLD, DNS_IP_ADDR_1, and DNS_IP_ADDR_2 by the names or addresses of your choice! For PASSWD_STRING (root_password parameter), you may use the old (short) password string from a Solaris 10 /etc/shadow file. If you do not use the root_password parameter in the sysidcfg file, you will be asked for the root password during initial zone boot.

  6. Wait! Before booting the zone, unmount it first:
    zoneadm -z webserv-z unmount
  7. Now you can boot the zone:
    $ zoneadm -z webserv-z boot
  8. Log in to the zone:
    root@soly:/# zlogin -C webserv-z
    [Connected to zone 'webserv-z' console]
    Loading smf(5) service descriptions: 27/68
    ...
    68/68
    Reading ZFS config: done.
    Mounting ZFS filesystems: (5/5)
    Creating new rsa public/private host key pair
    Creating new dsa public/private host key pair
    Configuring network interface addresses: sfe0.
    

    After a while, a series of screens will be displayed which ask you to select missing system configuration information. Use the <F2> key or <esc> 2 to go from one screen to the next. After that, a login prompt will be displayed, and you can login to the newly created zone:

    webserv-z console login: root
    Password:
    Dec  8 10:12:14 webserv-z login: ROOT LOGIN /dev/console
    Sun Microsystems Inc.   SunOS 5.11      snv_101b        November 2008
    

    The output of the df -k command should display the following file systems (probably with slightly different values in the "used" column and totally different values in the "avail" column (depends on your disk and swap space size):

    root@webserv-z:~# df -k
    Filesystem            kbytes    used   avail capacity  Mounted on
    /                          0  240451 186876163     1%    /
    /dev                       0       0       0     0%    /dev
    proc                       0       0       0     0%    /proc
    ctfs                       0       0       0     0%    /system/contract
    mnttab                     0       0       0     0%    /etc/mnttab
    objfs                      0       0       0     0%    /system/object
    swap                  775608     196  775412     1%    /etc/svc/volatile
    /usr/lib/libc/libc_hwcap1.so.1
    187116614  240451 186876163     1%    /lib/libc.so.1
    fd                         0       0       0     0%    /dev/fd
    swap                  775412       0  775412     0%    /tmp
    swap                  775420       8  775412     1%    /var/run
    root@webserv-z:~#
    
  9. Install Apache and prerequisites in the local zone:
    $ pkg install SUNWapch22
    root@webserv-z:~# pkg install SUNWapch22
    Refreshing Catalog 1/1 opensolaris.org
    Creating Plan \
    DOWNLOAD                                    PKGS       FILES     XFER (MB)
    SUNWapch22                                   0/4      0/1342     0.00/5.85
    SUNWperl584core                              3/4    913/1342     4.21/5.85
    
  10. Start the web server:
    root@webserv-z:~# svcadm enable apache22
  11. Point your browser to http://webserv-z or http://192.168.0.20 and see the first web page!
    Now you can change the file /var/apache2/2.2/htdocs/index.html according to your needs and watch the web page changing after reloading it in the browser!

Note: If you need to clean up the configuration, I suggest using the following commands:
$ zoneadm -z webserv-z uninstall -F
$ zonecfg -z webserv-z delete -F
$ zfs destroy -r rpool/zones

Be careful! These commands perform uninstall, delete or destroy actions without confirmation!. The zfs destroy command shown will also destroy all other zfs file systems that were created for other zones with zone root path starting with /zones!