March 29, 2010
If you have a Solaris box with few NIC cards configured. You can list them as follows:
# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
vsw0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 188.8.131.52 netmask ffffff00 broadcast 184.108.40.206
And you’d get the output as shown above. So this is reflecting on localhost and one virtual switch vsw0. But what about other NIC cards? You can list all of the network cards at once using the following command:
ifconfig -a plumb
This will list all the network devices available on the Solaris Box. So even if you have a freshly installed Solaris machine with no interface configured, you can use the above command to list the network cards and then proceed with configuring them.
March 18, 2010
It actually happens a number of times that although you’ve inserted the disc in a sparc machine but still it refuses to mount the disk. One of the workaround is to restart the vold and vomgt daemons. But even the if you don’t see your cdrom mounted, you can do it manually as mentioned below:
First find the cdrom, i.e. we need to know the x in cxtxdx.
Fire the following command to find the actual path of cdrom:
ls -al /dev/sr*
This would look like something as follows:
bash-3.00# ls -al /dev/sr*
lrwxrwxrwx 1 root root 12 Mar 8 14:14 /dev/sr0 -> dsk/c1t0d0s2
So here my cdrom is /dev/dsk/c1t0d0sx
We’re not yet sure about the slice no. so I’ve mentioned sx in above line.
Now we’ll ltry to mount the above slice manually:
mount -F hsfs /dev/dsk/c0t1d0s2 /mnt/cdrom
hsfs mount: /dev/dsk/c1t0d0s1 is not an hsfs file system.
If this fails then we can try for another slice:
mount -F hsfs /dev/dsk/c1t0d0s0 /mnt/cdrom
And it works this time, meaning our cdrom was at s0 slice.
November 22, 2009
Here are the list of useful commands frequently used during package management.
Adds software packages to the system
Removes software packages from the system
Displays software package information
Checks the accuracy of a software package installation
So, we’ll take an example to use above commands. I’ve a package called SUNWant.Z, which I want to install.
So I use the following syntax to add a package.
pkgadd -d SUNWant.Z
To check whether your package has been installed, you can use pkginfo and grep the output to find a specific package.
pkginfo | grep SUNWant
To check the accuracy of the package, you can use pkgchk command as:
To remove above package, we have the pkgrm command to use:
Refer the Sun documentation for further details.
November 12, 2009
The run levels in Solaris are little different than what you know about run levels in Linux. So, if you come from Linux background this could be little confusing initially.
There are total 8 run levels in Solaris. Default run level is 3. At a given point of time, a system can be in only one run level.
0 Power Down State
To shut down the operating system so that it is safe to turn off power to the system. This will bring the machine to Open Boot Prompt (OK)
s or S Single User State
To run as a single user with some file systems mounted and accessible.
1 Administrative State
To access all available file systems. User logins are disabled.
2 Multiuser State
For normal operations. Multiple users can access the system and all file system. All daemons are running except for the NFS server daemons.
3 Multiuser level with NFS resources shared
For normal operations with NFS resources shared. This is the default run level for the Solaris environment.
4 Alternative multiuser state
5 Power-down state
To shut down the operating system so that it is safe to turn off power to the system. If possible, automatically turns off power on systems that support this feature.
6 Reboot state
To shut down the system to run level 0, and then reboot to multiuser level with NFS resources shared (or whatever level is the default in the inittab file).
May 23, 2009
If you have a system with a fresh installed Solaris 10 and it does not have an entry with ‘name server’, there are chances that it’ll set the hostname as ‘unknown’. To change this hostname you need to edit 3 files, follow the following steps:
For the sake of example, say the IP of my system is 192.168.1.32 and I want to set the hostname to ‘sol10_sparc’
Use a text editor like vi to open and edit the following file:
# vi /etc/hosts
By default you’ll find the following line in the above file:
192.168.1.32 unknown #set by DHCP
Simply edit the file to replace ‘unknown’ with your hostname to make it look like as:
192.168.1.32 sol10_sparc #set by DHCP
Next we need to edit the file called nodename
# vi /etc/nodename
Just insert the hostname ‘sol10_sparc’ into this file.
And now last, find out the name of your ethernet card with the ‘ifconfig -a’ command. Say my ethernet card is called ‘rge0’. I’ll create and edit the following file:
# vi /etc/hostname.rge0
Insert your new hostname ‘sol10_sparc’ in this file, save and exit.
Restart your machine:
# init 6
That’s it, after your machine restarts, check the hostname:
Done, enjoy 🙂
May 23, 2009
To perform this you need to access the terminal physically or via telnet. And obviously you have to be a root user.
From terminal, use a text editor like vi to open the configuration file of SSH
# vi /etc/ssh/sshd_config
Now look for following line in the file:
You need to replace the ‘no’ with ‘yes’ to enable SSH.
Save the file and exit.
Restart the SSH service with the following command:
# svcadm restart network/ssh
That’s it, you’re done.