Posts Tagged ‘ Solaris ’

Changing the default boot device on a Sparc server

March 2, 2010
By Andrew Lin

You can display and change the default boot device on a SUN Sparc server from the eeprom console. List the bootable devices with the devalias command, ok devalias cdrom /pci@0,600000/pci@0/pci@0/scsi@0/disk@4,0:f net ...
Read more »

Tags: , ,
Posted in Hardware | No Comments »

How to list the status of swap in Solaris

February 26, 2010
By Andrew Lin

List the status of all swap areas. # swap -l swapfile dev swaplo blocks free dev/dsk/c0t0d0s1 32,9 16 8425712 8425712 The output has five columns: path The path name for the swap area. dev The major/minor device number...
Read more »

Tags: , , ,
Posted in Software | 1 Comment »

How to change the IP address in Solaris 10

February 25, 2010
By Andrew Lin

Here is a list of files that you need to edit when changing the IP address of an interface in Solaris 10. /etc/hosts /etc/hostname.interface-name /etc/nodename /etc/defaultrouter /etc/resolv.conf /etc/netmasks Add the ip address and server name to the host file. vi /etc/hosts 10.0.0.10 server-name Select the interface you want, your server may have more than one network interfaces. vi /etc/hostname.bge0 10.0.0.10 netmask 255.255.255.0 Change the node name vi /etc/nodename server-name Add...
Read more »

Tags: ,
Posted in Software | No Comments »

How to configure Samba on Solaris 10

February 11, 2010
By Andrew Lin

If you need to find the version of Samba installed on the Solaris 10 server use the command smbstatus. # /usr/sfw/bin/smbstatus Samba...
Read more »

Tags: ,
Posted in Software | 1 Comment »

Using grep/egrep to find out which file contains a word or string in Unix or Linux

February 2, 2010
By Andrew Lin

If you need to find out which file in a directory contains a specific word then the grep command is your friend. Here is an example, if you wanted to find out which file in the directory /home contains the word groundhog. grep –i “groundhog” /home/* /home/shadow:Today is groundhog day The –i option means grep will ignore upper/lower...
Read more »

Tags: , , ,
Posted in Software | 2 Comments »

Success, failure of the tar command recorded with time and date stamp

January 27, 2010
By Andrew Lin

I needed to determine the amount of time it would take to archive large amount of data on my unix server. If I had infinite amount of free time I could sit in front of the screen with a stop watch. But the better way is to create a script that would...
Read more »

Tags: , , ,
Posted in Software | No Comments »

How to delete a file or directory with special characters using the inode in Unix or Linux

January 22, 2010
By Andrew Lin

My fat fingers inadvertently created a directory on my unix server with special characters. I could not access this directory nor could I delete it. When I listed the directory using the command ls –b, I could see all the funny characters. ls –b scritps010/010/010/010 I tried every command I could think of, rmdir “scripts”,...
Read more »

Tags: , , ,
Posted in Software | No Comments »

How to change the hostname in Solaris 10

January 21, 2010
By Andrew Lin

To change the hostname in Solaris 10 you need to edit 3 files and appply the new name. /etc/nodename /etc/hostname.*interface, e.g. hostname.bge0 /etc/inet/hosts this file is a hard link to /etc/inet/ipnodes. You will need to make /etc/inet/ipnodes writable before editing it. To enable write use the command chmod 744 /etc/inet/ipnodes. Finally rename directory /var/crash, the system...
Read more »

Tags: ,
Posted in Software | No Comments »

How to create a ZFS filesystem on two striped disk drives

January 15, 2010
By Andrew Lin

I ran out of space on my SAN drive on the Solaris 10 SPARC server. Since I had two spare disk drives sitting in the server that were not being used, I decided to create a single striped volume out of the two drives. The drives contained the factory installed Solaris 10 image. Here...
Read more »

Tags: ,
Posted in Software | 2 Comments »

List files by size in reverse numerical order in Linux or Unix.

January 7, 2010
By Andrew Lin

The root drive on my Solaris server was full and I needed to find out what file was the largest. The du command can list the size of the files in a directory, you can then use the sort command to display the results in numerical order (by size). Below is an example of the...
Read more »

Tags: , ,
Posted in Software | No Comments »