Posts Tagged ‘solaris’

solaris tips

June 30th, 2013 No comments
pkginfo -l SUNWcsu
mdb & kmdb
echo ::memstat | mdb -k #memory usage profile
echo ::kmastat | mdb -k
echo “::threadlist -v” | mdb -k #collect the stack trace of all threads in mdb
truss -p <pid>/ndd/etc/system
pstack /var/core/core_doxerorg_vxconfigd_0_0_1343173375_140 #print a stack trace of running processes, or <pid>, /var/crash
/var/cron/log #solaris 10 cronlog,
###EFI SMI label
###solaris proc tools
cd /proc/ ; for i in *; do echo — process $i —; pfiles $i | grep -i “port: 11961″; done
pldd 578 #dynamic libraries linked into the process
eeprom use-nvramrc? #whether nvramrc is enabled
eeprom nvramrc #aliases. halt will go to OK mode. type sync there then it will sync disks and then generate a static coredump<if faied, try savecore -L(live) in OK mode/or in OS>
eeprom auto-boot? #auto boot
mpathadm list mpath-support
/etc/dfs/dfstab #like /etc/mtab, also in HPUX
prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s – /dev/rdsk/c1t1d0s2 #solaris,copy disk head info from c1t0d0 to c1t1d0
isainfo -kv #64bits or 32bits, pagesize,
getconf PAGESIZE #linux
grep -i /etc/network path_to_inst #find out the network cards available on the system, cat /etc/path_to_inst | egrep -i ‘eri|ge|ce|qfe|hme’
sysdef #solaris, output system definition
mpstat 2 #solaris, per-processor,cpu
prtdiag -v #solaris hardware type, prtconf
dladm #solaris administer data links
dladm show-dev/show-link/show-aggr/ #two dev can be a link aggr<bonding, on one switch, increase link speed>
dladm show-dev -s e1000g1
ifconfig e1000g1 plumb
ifconfig vmxnet0 netmask up #at last, config /etc/hostname.vmxnet0
ifconfig vmxnet0 down
dladm create-aggr -l passive -d e1000g2 -d e1000g3 1(first unplumb e1000g2/3)
ifconfig aggr1 plumb
ifconfig aggr1 netmask up
/usr/sbin/cfgadm -c configure /dev/cfg/c2::5006048452a72687
/usr/sbin/fcinfo hba-port -l #solaris, hba, like Qlogic<chibrat5>, Emulex<upora06a>
fcinfo remote-port -l -p 210000e08b18024f #Lists the remote-port information
/opt/FJSVmadm/sbin/{madmin,hrdconf -l } #madmin is an menu-driven interactive utility that allows you to perform various hardware-related diagnostics and maintenance.
/opt/FJSVsnap/bin/fjsnap -a output #like sun explorer, add -C to include crashdump information
/opt/FJSVhwr/sbin/fjprtdiag -v
/opt/FJSVcsl/bin//mainmenu #hardware etc on SMC and partition poweron/poweroff(PrimePower System Management Controller)
/opt/FJSVcsl/bin/get_console -w -n <partition_name> #partition_name in /etc/hosts #maybe /opt/scripts/bin/ 0 FORCE, if you know the number(through mainmenu)
##to get into OK prompt
a. ctrl+] to get the telnet prompt
b. From telnet prompt, type “send break”  to get OK prompt
ndd #change UDP parameters etc
solaris IPMP configuration solaris-IPMP.pdf

zpool create tank c4t0d0
zpool list
zpool list tank
zpool get autoexpand tank
zpool replace tank c4t0d0 c1t13d0
zpool list tank
zpool set autoexpand=on tank
zpool list tank
zfs userspace tank
zfs groupspace tank
zpool status
zpool status -x #all pools are healthy
zpool history
zpool history -l
zfs mount -a
zfs get mountpoint,compression tank
zfs create -o compression=gzip tank/home
zfs create -o compression=gzip tank/home/firsttry
zfs create -o compression=gzip -o mountpoint=/export/secondtry tank/home/secondtry
##the below is equal to:
##zfs create tank/home/secondtry
##zfs set mountpoint=/export/secondtry tank/home/secondtry
zfs get -s local all
zpool get all tank
zfs list
zfs mount zones/test #Mount the ZFS
zfs unmount zones/test/
zpool status -x
zpool status
zpool clear tank
/usr/lib/pool/poold #start poold manually
pgrep -l poold #1333 poold

/etc/svc/volatile #logs related to current services
fmadm faulty #fault management. fmd, fmdump, fmstat. FRU(Field replaceable unit)
fmadm #fault management configuration tool, fmadm faulty -a
fmadm config
fmadm faulty #show faults in fma
fmstat -m zfs-retire 2 5
fmdump -vv -u 177b4b48-8ed1-ea7a-e6f3-feed10dd4c38
fmdump -Vu 6252dd23-4397-cbda-8c72-8774fd175bc1
fmdump /var/fm/fmd/errlog
svcs -a | grep -i cron
svcs cron
svcs -l ipfilter #dependency, dependent
svcs -D ipfilter #dependent
svcs -d ipfilter #dependency
svcs -a|grep lrc #smf can monitor init.d scripts but can not manage them
svcadm enable -r ipfilter #boot cascade
svcadm enable -rt ipfilter #single user mode
svcadm restart cron
svcadm refresh #make snapshot working
svcs -p telnet#check relationship between services and processes, may need pkill -9
svcadm clear telnet #check /var/svc/log
#recover snapshot
svccfg ->select network/ipfilter:default -> listsnap ->help ->help revert ->revert start ->quit
svcadm refresh network/ipfilter:default #refresh /etc/svc/repository.db
svcadm restart network/ipfilter:default #restart
svcadm clear svc:/system/filesystem/local:default
svcs -xv FMRI#check for reason
svccfg -s network/ipfilter:default #unselect,quit
svccfg export pfil >/tmp/pfil.desc
pargs -e `pgrep -f cron`
svccfg -s system/cron setenv LD_PRELOAD
svccfg -s system/cron setenv UMEM_DEBUG default
svcadm refresh system/cron
svcadm restart system/cron
pargs -e `pgrep -f cron`
inetadm -l telnet | grep tcp_trace
inetadm -m telnet tcp_trace=TRUE
inetdadm -l ftp|grep exec
inetadm -m ftp exec=”/usr/sbin/in.ftpd -a -l”
inetconv -e -i /etc/inet/inetd.conf
pkill -HUP inetd
/lib/svc/method/sshd start #man smf_method
svccfg import
svcs |grep milestone
svcadm -v milestone -d multi-user-server:default #/var/svc/manifest/milestone/multi-user-server.xml
RBAC #man smf_security
svcadm enable apache2 # manipulate service instances
inetadm – bserve and configure services that are controlled by inetd. inetadm -?, inetconv
svcprop – retrieve values of service configuration properties
FMRI:Fault Management Resource Identifier
svccfg delete /network/http:apache2
ups auxww|grep fmd
-bash-3.00# svccfg -s smtp
svc:/network/smtp> list
svc:/network/smtp> select sendmail
svc:/network/smtp:sendmail> list
svc:/network/smtp:sendmail> listprop *exec
start/exec astring “/lib/svc/method/smtp-sendmail start”
stop/exec astring “/lib/svc/method/smtp-sendmail stop %{restarter/contract}”
refresh/exec astring “/lib/svc/method/smtp-sendmail refresh”
/lib/svc/method/fs-* #/opt/csw/bin:/opt/csw/sbin

/usr/sbin/pkgchk -l -p /usr/sbin/fcinfo #SUNWfcprt
pkginfo #/var/sadm/pkg/pkgname/pkginfo
pkgmap #/var/sadm/install/contents
pkginfo -d ./top-3.5-sol10-intel-local
pkgadd -d . topxxx
pkgadd -d ./xxx
pkgadd -d ./top-xxx -s /var/spool/pkg SMCtop
pkgtrans ./topxxx /var/spool/pkg
pkgadd -d . -s spool
pkginfo -d spool SMCtop
pkgrm -s spool SMCtop
grep showrev /var/sadm/install/contents
pkginfo|grep -i top
root@beisoltest02 ~ # pkgadd
pkgadd: ERROR: no packages were found in </var/spool/pkg>
less /etc/apache/README.Solaris
pkgrm SMCtop
pkgchk SMCtop
pkgchk -p /usr/local/doc/top/README
pkgparam SMCtop PATCHLIST
root:/usr/local/src# wget
root:/usr/local/src# pkgadd -d BOLTpget.pkg all

zoneadm list -civ #-v,verbose,zfs list
zonecfg -z andyred #interactive configuration
zoneadm -z andyred boot #boot
zlogin andyred shutdown -i5 -g0 -y #shutdown
zoneadm -z andyred halt #halt,no shutdown scripts will be run
zoneadm -z andyred uninstall -F #delete
zoneadm -z test detach #detach the zone
zoneadm -z test attach -u
zlogin -C andyred #login zone from global zone
zonename #which zone am I in
netstat -p #non-global zone to get global zone name

Categories: tips, Unix Tags:

re-ip on solaris server howto – change ip netmask defaultrouter gateway

May 18th, 2012 No comments

To change ip/netmask/defaultrouter/gateway on solaris 10 or solaris 9 server permanently, you need care for files below:

/etc/hosts -> /etc/inet/hosts
/etc/hostname.<tags of your interface>

Let’s assume that the new ip address is, new netmask is, new gateway is, new broadcast address is, here goes the steps:
1)change /etc/hosts(or /etc/inet/hosts which of them are the same file) <tag for your server’s ip address>

2)change defaultrouter in /etc/defaultrouter: /etc/defaultrouter

3)change /etc/hostname.<tags of your interface>(this step may not needed):

4)change netmask in /etc/inet/netmasks:
You’ll need first calculate network address from the given ipaddress( and netmask address( You can calculate it by hand(refer to this article, but I would prefer to use ipcalc:
[root@doxer~]# ipcalc -pnbm

So from the output, you’d know that the network address is Then add a line to /etc/inet/netmasks with format <network address> <netmask address>:

If you need change ip/netmask using ifconfig temporarily on solaris, use the following command:
ifconfig qfe1 netmask broadcast + up

5)Now reboot your server and then use ifconfig -a and netstat -rnv to confirm everything is working as expected.

If you encounter errors below when booting solaris, then there may be some problem with network configuration on your host. Consider going to single user mode and change networking configuration detailed in this article.

Setting /dev/arp arp_cleanup_interval to 60000
Setting /dev/ip ip_forward_directed_broadcasts to 0
Setting /dev/ip ip_forward_src_routed to 0
Setting /dev/ip ip_ignore_redirect to 1
Setting /dev/ip ip_respond_to_address_mask_broadcast to 0
Setting /dev/ip ip_respond_to_echo_broadcast to 0
Setting /dev/ip ip_respond_to_timestamp to 0
Setting /dev/ip ip_respond_to_timestamp_broadcast to 0
Setting /dev/ip ip_send_redirects to 0
Setting /dev/ip ip_strict_dst_multihoming to 1
Setting /dev/ip ip_def_ttl to 255
Setting /dev/tcp tcp_conn_req_max_q0 to 4096
Setting /dev/tcp tcp_conn_req_max_q to 1024
Setting /dev/tcp tcp_smallest_anon_port to 32768
Setting /dev/tcp tcp_largest_anon_port to 65535
Setting /dev/udp udp_smallest_anon_port to 32768
Setting /dev/udp udp_largest_anon_port to 65535
Setting /dev/tcp tcp_smallest_nonpriv_port to 1024
Setting /dev/udp udp_smallest_nonpriv_port to 1024
Setting /dev/ip ip_ire_arp_interval to 60000
Setting /dev/tcp tcp_extra_priv_ports_add to 6112
Setting /dev/tcp tcp_rev_src_routes to 0

Categories: Networking Security, Unix Tags:

method to start stop SUNWwbsvr webservd Sun webserver

April 28th, 2012 No comments

Here’s steps to start Sun webserver:

cd /apps/SUNWwbsvr/<https-tag-of-your-hostname>


Here’s steps to stop Sun webserver:

cd /apps/SUNWwbsvr/<https-tag-of-your-hostname>


To check whether start/stop/restart completes:

ps -ef | grep SUNWwbsvr

Categories: IT Architecture, Unix Tags: ,

resolved pca 403 forbidden server error on solaris

April 28th, 2012 No comments

Today when I was patching a solaris 5.9 host, error occurred with error message as follows after entering MOS(my oracle support) user/password:

122300 56 < 63 RS- 22 SunOS 5.9: Kernel Patch
Looking for 122300-63 (2/52)
Trying Oracle
Please enter My Oracle Support Account User: [email protected]
Please enter My Oracle Support Account Password:
Trying (zip) (1/1)
Failed (Error 403: Forbidden)
Failed (patch not found)

Then I went to and searched patch 122300-63. The patching info page says I’ll need “Vintage Solaris download access/privilege” to download this patch, but obviously none of my CSI had this Vintage Solaris download access/privilege.

As this account issue may take some time to resolve, so I choose cluster patch or you may say patchset method to do the patching on solaris 9. Here’s the steps we need to do cluster patching on solaris 5.9:

  • latest cluster patching package that satisfies your host here
  • 2.unzip the package and have a read of Recommended.README file comes with the package
  • 3.ensure there’s enough free space on /, /var(better >4Gb)
  • 4. Now run ./install_patchset or ./install_cluster(you can add -nosave parameter if  you have limited free space on /, /var, but you will not be able to backout individual patches if the need arises)
  • 5.For more installation messages refer to the installation logfile:    /var/sadm/install_data/<patchset-name>_log
  • 6.reboot your machine to make all patches applied to your host.


If you have raid 1(mirror) on your solaris system, you can try first patch submirror and then apply to all system if server runs well after booting up. You can refer to the following for more infomation:


solaris svm breaking need boot from mirror

April 11th, 2012 No comments

If solaris’s svm has broken, and that broken one is for rootdisk, then the system will fail to boot up. We can now try boot from mirror disk rather than SVM. If the mirror is in good condition, then your system will boot up and after it’s up, we can do something to repair the broken solaris svm.

Here goes the steps to boot solaris from mirror disk without svm:

1.Prepare a cd/dvd with solaris of your host’s version.

2.goto ok mode

3.ok> boot cdrom -s ( Or boot net -s)

4.mount the root slice on /a

5.Take backup of /a/etc/vfstab and /a/etc/system files.

6.Modify the entries of the vfstab files and system files of /etc

7.Edit the /a/etc/system file, and remove the “rootdev” line shown below:

# vi /a/etc/system
*rootdev:/pseudo/md@0:0,0,blk #yours may be different
——> Do not comment the line. Remove it.

8.In the /etc/vfstab file, replace the lines for the system file system
metadevices with their underlying partitions.

For example, change lines from:

/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no -


/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no -

ONLY change the lines for root (/) and the file systems which were affected. All other metadevices, may stay ‘as is’, in this file.

9.Unmount and check the root file system.

# cd /
# umount /a
# fsck /dev/rdsk/c0t0d0s0

10.#/usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/cXtXdXs0


If you are using a cd/dvd or net which is having advance version of the Solaris OS to
the Solaris OS on the disk to boot to single user, then install the bootblk using the following command.

#/a/usr/sbin/installboot /a/usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/cXtXdXs0


11.init 0

12.Boot from the mirror disk.
Ok boot disk0


You can find more info if you search for “Unable to boot from a DiskSuite-controlled system disk” in google.

Categories: Storage, Unix Tags: ,

obu firmware patching for sun T2000/T5120/T5220 servers OBP patching

August 17th, 2011 No comments

Don’t know why there’s some formatting errors with this article, you can download the PDF version here: obu firmware patching for sun T2000-T5120-T5220 servers OBP patching

You can download Sun_System_Firmware-6_7_11-Sun_Fire_T2000 from or here(For SunFireT2000)

Categories: Servers Tags: