Ajitabh Pandey's Soul & Syntax

Exploring systems, souls, and stories – one post at a time

Category: Solaris/AIX/HP-UX

  • Solaris10 on VirtualBox

    I installed Solaris10 11/06 on VirtualBox 1.5.6 OSE. The first problem immediately after installation I faced was that of mouse not being captured by virtual machine. So I open a terminal window and start the vold and then ran the volcheck command.

    /etc/init.d/volmgt start
    volcheck
    

    The mouse started working after this. The reason for this I guess is because I did not had the mouse inside the virtual machine while booting. I need to confirm this.

    Moving the home directory of root from / to /root:

    Changing the home directory of root using “usermod” command does not work as the root user is logged in. So edit the /etc/passwd file and change root’s home directory to /root. Logout and login again. After that remove all the /.* files and /Desktop directory.

    vi /etc/passwd
    rm -rf /.*pwd
    rm -rf /Desktop
    

    Installing third-party tools

    Next I need to install third party tools in the virtual machine. I downloaded the “pkg-get” as:

    pkgadd -d http://www.blastwave.org/pkg_get-3.8.4-SunOS5.8-all-CSW.pkg
    

    Next I downloaded the static version of the wget utility using mozilla from http://www.blastwave.org/wget-i386.bin and renamed it as wget.
    Next I put the directory containing the wget utility and the /opt/csw/bin directory in default PATH. The first thing installed was wget itself, so that I can get rid of the static version.

    pkg-get install wget
    

    Patch check advanced is a utility which I installed next to apply patches to the operating system.

    pkg-get install pca
    

    The gnupg program was needed to verify the signatures on the catalogue files. This can be installed as:

    pkg-get install gnupg
    

    To install the gpg key of the blastwave repository use the following commands:

    wget --output-document=/tmp/gpg.key http://www.blastwave.org/mirrors.php
    gpg --import /tmp/gpg.key
    
  • Swap Space Management in Solaris

    The swap utility provides an administrative interface to the management of the system swap areas. A standard swap partition which is not under the volume manager control cannot be resized, but swap space can be added using swap files.

    Create a swapfile of 512MB in /local:

    mkfile 512M /local/swapfile01

    Add the swap to system swap space:

    swap -a /local/swapfile01
    swap -a /dev/dsk/c0t0d0s1

    Add /etc/vfstab entry to add the swap space to make sure it is recognized after reboot:

    /local/swapfile01       -       -       swap    -       no      -
    /dev/dsk/c0t0d0s1       -       -       swap    -       no      -

    Delete a swap space:

    swap -d /local/swapfile01
    swap -d /dev/dsk/c0t0d0s1

    The /etc/vfstab entry has to be removed after removing the swap space.

    List swap space:

    swap -l

    List swap space statistics:

    swap -s
  • Timezones in Solaris

    The available timezones in solaris are listed in /usr/share/lib/zoneinfo/
    To find out the current timezone on the system:

    grep '^TZ' /etc/TIMEZONE
    

    and in order to change the timezone, modify the TZ line in /etc/TIMEZONE and then reboot the system.

  • Changing the IP Address of a Solaris System

    Use ifconfig to change the IP address immediately

    ifconfig    

    If the new IP address calls for a different gateway then change it using the route command:

    route add default 
    route del default 
     

    Change the hosts’s IP address in

    • /etc/hosts file to take effect after each reboot
    • /etc/inet/ipnodes (for Solaris 10)

    Change the host’s subnet mask in /etc/netmask

    Change the host’s default gateway in /etc/defaultrouter

  • Moving data to a seperate filesystem

    Often its required that the a directory (for example /home)be moved to a seperate filesystem. The steps are simple:

    • Boot system in single user mode (linux single), or if already booted take it down to single user using,
      init 1
      
    • Create a new partition if its not already done.
      fdisk /dev/hda
      
    • Create the filesystem on the new partition
      mkfs.ext3 /dev/hda3
      
    • Mount the filesystem under a suitable directory in /mnt
      mkdir /mnt/newpart && mount /dev/hda3 /mnt/newpart
      
    • Copy all files from the directory /usr to the new directory using
      cp -a /home/* /mnt/newpart/*
      

    The following steps needs to be done in a sequence.

    • Rename /home
    • Create new /home/ directory
    • Mount the new filesystem in /home
    • Update the /etc/fstab
    mv /usr /old-home && /bin/mkdir /home && /bin/mount /dev/hda3 /home