Changing the Hostname of a Solaris System

On Solaris 10 the value in the /etc/nodename file is sufficient for setting the hostname of the system.
The hostname of a solaris system needs a change in the following files. So replace the old hostname with the new one in these file. Do not try to comment out as this may lead to some boot time errors.

  • /etc/nodename
  • /etc/hosts
  • /etc/hostname.*
  • /etc/net/*/hosts
  • /etc/inet/ipnodes (Solaris 10 or later)

In order to change the hostname and nodename for the current session run:

uname -S new_hostname

Next change the savecore-dir (Solaris 7 or later)

dumpadm -s /var/crash/`uname -n`

Finally restart the syslog service to log messages using the new hostname.

Courtsey – http://www.princeton.edu/~unix/Solaris/troubleshoot/hostname-change.html

Posted in Solaris/AIX/HP-UX | Tagged | Leave a comment

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
Posted in Solaris/AIX/HP-UX | Tagged , , | Leave a comment

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
Posted in Solaris/AIX/HP-UX | Tagged | Leave a comment

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.

Posted in Solaris/AIX/HP-UX | Tagged | Leave a comment

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

Posted in Solaris/AIX/HP-UX | Tagged , | Leave a comment