Wednesday, 29 October 2014

P2V conversion STEPS in solaris10


 
  flarcreate -S -n s10U10-system -L cpio /var/tmp/solaris_10_up3.flar
  gzip /var/tmp/solaris_10_up3.flar
##An md5 checksum can be created for the image in order to ensure no data tampering
  Source # digest -v -a md5 /var/tmp/solaris_10_up3.flar
 
  scp /var/tmp/solaris_10_up9.flar 10.10.10.10/var/tmp
 
  Then create the Zone for the same.
 
  mkdir /zones
  chmod 700 /zones
  zonecfg -z solaris_10_up3_zone
  create
  set zonepath=/zones
  set autoboot=true
  add net
  set address=10.10.10.10
  set physical=
  end
  verify
  commit
  exit
  Installing the Zone
  zoneadm -z solaris10-up3-zone install -p -a /var/tmp/solaris_10_up3.flar :- To preserver the system identity.

Monday, 29 September 2014

Open_files parameter_changes/ulimit value change in solaris

ulimit -a

root@xyz # ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) unlimited
stack(kbytes) 8192
coredump(blocks) unlimited
nofiles(descriptors) 8042
memory(kbytes) unlimited


change in /etc/system :-
add below parameters and take reboot :-
set rlim_fd_max=8042
set rlim_fd_cur=8042

Inode issue in solaris

Description

It is not possible to dynamically increase the number of inodes on a UFS filesystem. If you need to increase the number of inodes you will need to build the filesystem afresh using newfs.

Note that the newfs command will create a new filesystem on the slice you specify; this will destroy all data already on the slice. If you wish to access the data on the slice after running newfs you must back it up first, and restore after running the newfs command as described below.


Steps to Follow

You can have a file system reporting that is it full, and yet when you
look at the df -k output it looks like there should still be space left
on the file system.


The cause of this problem is due to a large number of small files on the
file system. This can use up all of the inodes allocated for that file
system while there is still plenty of disk space. To check for inodes,
run the following command df -o i filesystem

df -o i /work
Filesystem iused ifree %iused Mounted on
/dev/dsk/c0t0d0s7 13 1241587 0% /work

or run as below with out specifying a file system.

# df -o i
df: operation not applicable for FSType autofs
df: operation not applicable for FSType fd
df: operation not applicable for FSType mntfs
df: operation not applicable for FSType nfs
df: operation not applicable for FSType proc
df: operation not applicable for FSType tmpfs
Filesystem iused ifree %iused Mounted on
/dev/dsk/c0t0d0s0 5184 490432 1% /
/dev/dsk/c0t0d0s6 61652 680748 8% /usr
/dev/dsk/c0t0d0s1 7375 488241 1% /var
/dev/dsk/c0t0d0s5 16718 975282 2% /opt
/dev/dsk/c0t0d0s4 4 499196 0% /test
/dev/dsk/c0t0d0s7 13 1241587 0% /work

As you can see I don't have a problem with the inodes, if you did have a
problem the output from would indicate %iused 100%.

There is a way to resolve this issue, first you need to get a good backup
of the affected file system.

Then you can run the mkfs -m command to see how any filystem was created,
as seen below. See man page for mkfs

# mkfs -m /dev/rdsk/c0t0d0s7
mkfs -F ufs -o
nsect=255,ntrack=16,bsize=8192,fragsize=1024,cgsize=26,free=1,rps=90,nbpi=8235,opt=t,apc=0,gap=0,nrpos=8,maxcontig=16
/dev/rdsk/c0t0d0s7 20481600

The key field from the about output is nbpi=8235 (number bytes per inode)

The nbpi can be changed when running the newfs command to create a new file
system.
The following is from the newfs man page.

-i nbpi
The number of bytes per inode. This specifies
the density of inodes in the file system. The
number is divided into the total size of the
file system to determine the fixed number of
inodes to create. It should reflect the expected
average size of files in the file system. If
fewer inodes are desired, a larger number should
be used; to create more inodes a smaller number
should be given. The default for nbpi is as fol-
lows:.

Disk size Density

-1GB 2048
-2GB 4096
-3GB 6144
3GB- 8192


After you backup the file system you want to increase the inodes on,
then you newfs the file system using the -i nbpi option specifing a
smaller number. As the output from the mkfs -m /dev/rdsk/c0t0d0s7
shows nbpi=8235. If you cut that number in half when running the
newfs command with the -i nbpi=4117 will double your inodes on that
file system. Then after doing a newfs and increasing ther inodes you
restore your file system from the backup you created prior to starting
this process. See man page on newfs

Health checkup........in solaris

Health checkup........

iostat -xntc > /tmp/Health_status
iostat 1 5 >> /tmp/Health_status
vmstat 1 5 >> /tmp/Health_status
sar 1 5 >> /tmp/Health_status
mpstat >> /tmp/Health_status
prstat -a >> /tmp/Health_status
tail -f /var/adm/messages >> /tmp/Health_status
iostat -en >> /tmp/Health_status
swap -l >> /tmp/Health_status

/usr/bin/iostat -xcC 3 2

How to find the HBA manufacturer in solaris

prtpicl -v -c scsi-fcp | grep :manufacturer

Guds option in solaris for performance collection

./guds_2.9.1 -q -X 3 -c 10 -i 5 -n 10 -w 0  -s 3-12345678

Explorer execution in solaris and veritas

IN Veritas:-

# cd /opt/VRTSspt/VRTSexplorer
# ./VRTSexplorer
   answer prompts appropriately
   be sure not to restart vxconfigd
   once complete ftp to our site per the next steps

IN SOALRIS:

/opt/SUNWexplo/bin/explorer -w default,Tx000

explorer -w fru,scextended
 /opt/SUNWexplo/bin/explorer -w default,scextended,fru

For Linux ;-

We need to provide the sosreport

Checking duplex setting in solaris 8 and 9

For checking duplex setting in solaris 8 and 9

ifconfig -a" shows you the names of the interfaces, eg ge0.
to get the mode and speed you need the following commands:

ndd -set /dev/ge instance 0
ndd -get /dev/ge link_mode
ndd -get /dev/ge link_speed

if you want to check a qfe3 Interface just run

ndd -set /dev/eri instance 3
ndd -get /dev/eri link_mode
ndd -get /dev/eri link_speed


# ndd -get /dev/hme link_mode
Interpretation:
0 -- half-duplex
1 -- full-duplex

# ndd -get /dev/hme link_speed
Interpretation:
0 -- 10 Mbit
1 -- 100 Mbit
1000 -- 1 Gbit

Interpretation:
link_up - 0 down, 1 up
link_speed - speed in Mbit/s
link_duplex - 1 half duplex, 2 full duplex, 0 down

or

we can use direct this command in solaris 8 and 9
$ netstat -k ce | egrep 'link_speed|link_status|link_duplex'

***********************************************************
USE THIS COMMAND FOR CHECKING:-
ndd  /dev/bge0 \?

EX:-
Inter face qfe0

ndd -set /dev/qfe instance 0
ndd -set /dev/qfe adv_1000fdx_cap 0
ndd -set /dev/qfe adv_100fdx_cap 1
ndd -set /dev/qfe adv_100hdx_cap 0
ndd -set /dev/qfe adv_autoneg_cap 0

DNS Client Configuration:in solaris

Steps Followed to Resolve the DNS Client Configuration:

Step 1: Check the /etc/hosts file for the proper hostname entry and FQDN.

ipadddress hostname FQDN

example:

ipadddress hostname FQDN

0.1.2.3     GRID      grid.fra.com


Step 2: Stop the DNS Client services by:

svcs -a | grep dns
disabled       Jul_03   svc:/network/dns/server:default
online          8:50:53 svc:/network/dns/client:default

svcadm disable /network/dns/client

Step 3: Copy the files as mentioned below:

cp /etc/nsswitch.dns /etc/nsswitch.conf

and check for the entry given below. If not exist make an exact entry.

hosts:      files       dns

Step 4: Make resolv.conf file as below:

vi /etc/resolv.conf

search <domain>   ---> In case of windows confirm the suffix configured at the Windows DNS Server.
nameserver <primary dns server ip.>

example:

search fra.com
nameserver 0.1.2.3


Step 5: Enbale the DNS Client Service.

svcadm enable /network/dns/client

Check the service status (onile/offline).
svcs -l /network/dns/client

Step 6: Client Lookup.

nslookup <hostname>

It should give an output as mentioned below:

root@GRID # nslookup
> GRID
Server:         0.1.2.3
Address:        10.1.2.3#53

Name:   GRID.fra.com
Address: 0.1.2.3

> agrid
Server:         0.1.2.3
Address:        0.1.2.3#53

Name:   grid.fra.com
Address: 0.1.2.3

Removing disk in 880,890,280,480,490 from OS Kernal


cfgmgr will remove else use below process also

luxadm remove_device /dev/rdsk/c1t0d0s2
luxadm insert_device /dev/rdsk/c1t0d0s2
luxadm -v  replace_device -F /dev/rdsk/c1t0d0s2

How To Disable the dimms at ok prompt in v880/890 .....etc

If server continuous panic rebooting with dimm  error.Do below steps

1) Power Off the server and power on automatically failed dimm's disable at the time of POST
else
2)Run break at rsc/sc
3)enter into ok prompt mode and check the failed dimm's by using .asr it will work if you have configured asr

{3} ok asr-disable

Usage: asr-disable <dev-id>
Where <dev-id> is an absolute device path, a device alias, or a device label.
Valid device labels include:
    cpu3-bank3      cpu3-bank2      cpu3-bank1      cpu3-bank0
    cpu2-bank3      cpu2-bank2      cpu2-bank1      cpu2-bank0
    cpu1-bank3      cpu1-bank2      cpu1-bank1      cpu1-bank0
    cpu0-bank3      cpu0-bank2      cpu0-bank1      cpu0-bank0
    pci-slot5       pci-slot4       pci-slot3       pci-slot2
    pci-slot1       pci-slot0       gptwo-slotc     gptwo-slotb
    gptwo-slota     ob-ide          ob-net0         ob-net1
    ob-fcal         io-bridge9      io-bridge8      cpu3
    cpu2            cpu1            cpu0

{3} ok asr-disable cpu1-bank1
{3} ok .asr
ASR Disablement Status
Component:     Status

CPU0/Memory:   Enabled
CPU1:          Enabled
Memory Bank0:  Disabled
Memory Bank1:  Disabled
Memory Bank2:  Disabled
Memory Bank3:  Disabled
CPU2/Memory:   Enabled
CPU3:          Enabled
Memory Bank0:  Disabled
Memory Bank1:  Disabled
Memory Bank2:  Disabled
Memory Bank3:  Disabled
IO-Bridge8:    Enabled
IO-Bridge9:    Enabled
GPTwo Slots:   Enabled
Onboard FCAL:  Enabled
Onboard Net1:  Enabled
Onboard Net0:  Enabled
Onboard IDE:   Enabled
PCI Slots:     Enabled

Console-Vi editor settings

root@xyz123453 # EDITOR=vi
root@xyz123453 # export EDITOR
root@xyz123453 # TERM=vt100
root@xyz123453 # export TERM

console busy on SC for the domain on a Sun Fire 3800/4800/4810/6800

When you attempt to log into a domain on a Sun Fire 3800/4800/4810/6800 server and get the error

Connection refused, console busy          
the reason is that the console is still in use by another user, or the serial port session was not closed previously.


SOLUTION SUMMARY:
To fix this, telnet to the System Controller (SC) and log into the platform shell.

Example:

telnet HostNameofServer
Trying 129.148.xxx.xxx...
Connected to HostNameofServer.
Escape character is '^]'.


System Controller 'HostNameofServer':

    Type  0  for Platform Shell

    Type  1  for domain A console
    Type  2  for domain B console
    Type  3  for domain C console
    Type  4  for domain D console

    Input:          
Select 0 for the Platform Shell, then type: connections to show the active connections.

Example:

HostNameofServer-sc0:SC> connections        

ID  Hostname                 Idle Time Connected On   Connected To  
--- ------------------------ --------- -------------- --------------
  9 Localhost                00:01     Nov 01 19:58   Domain A      
 12 0.1.0.1          00:25     Nov 04 12:39   Console Menu  
  2 0.9.0.2          -         Nov 04 13:05   Platform                  
The Localhost is the serial port on the System Controller.

======================================================

console -d domain -f

OR

SC>disc Domain ID/Platform id

Command to find out No. of CORE's in solaris

kstat cpu_info|grep core|awk '{print $2}'|sort|uniq|wc -l

# kstat -m cpu_info|grep core_id|awk ‘{print $2}’|uniq|wc -l
       8

So we get 8 cores. So far so good.  A few more commands will complete the picture.

#psrinfo -p
1-Physicall CPU
#psrinfo |wc -l
      64
So here is the complete picture, T5220, has one socket, 8 cores, 8 threads per core which equates to 64 virtual CPU’s.


echo "`kstat -m cpu_info|grep  chip_id|uniq|wc -l` core(s) "
echo "`psrinfo -p` socket(s)"

to check cpu core info

mpstat |wc -l and compare it with prtdiag CPu output
if it is same then it is single core

CMM COMMANDS

show -d properties -level all /

clientmqueue flush script Or flush mailq to reduced the root file system

flush mailq to reduced the root file system

cd  /var/spool/clientmqueue
 - ls -ltr |awk '{print "rm " $9}' > /var/spool/clientmqueue.09Feb2011.rmfile ------> (date should be entered on which date we are doing activity)

- remove first line of rm
- add cd /var/spool/clientmqueue
- give execute command (i.e chmod 777 /var/spool/clientmqueue.09Feb2011.rmfile )
- run the script

mailq -Ac :- To Remove clinetmailque 

Wednesday, 24 September 2014

How to reset forgot RSC Password from Os level

Log in to the server do as below

===================RSC PASSWORD Reset===================================
root@BL04 # /usr/platform/SUNW,Sun-Fire-280R/rsc/rscadm usershow

 username            permissions        password
 --------            -----------        --------
 admin               cuar               Assigned

/usr/platform/SUNW,Sun-Fire-280R/rsc/rscadm userpassword admin

ALL About Sun-Fire 6800 Hardware


How To check physical/permanent memory assigned to which board

#cfgadm -alv |grep permanent

#cfgadm -c unconfigure N0.SB1====From OS Level we need to run this command to power off the board

#cfgadm -c disconnect N0.SB1===To Removed the board from os level check #prtdiag -v

SC>deleteboard NO.SB0---To delete board

SC>addboard -d a No.SB0----To add board to domain A

After configure the board on server

#cfgadm -c configure NO.SB0=====>To Configure board at OS level

After configure the board it will start the test in background.

To check we need to log in to the console and check

p03-sc0:C> showbo
Slot     Pwr Component Type                 State      Status     Domain
----     --- --------------                 -----      ------     ------
/N0/SB2  Off CPU Board V2                   Assigned   Not tested C
p03-sc0:C> poweron sb2/N0/SB2: powered on
p03-sc0:C> showbo
Slot     Pwr Component Type                 State      Status     Domain
----     --- --------------                 -----      ------     ------
/N0/SB2  On  CPU Board V2                   Assigned   Not tested C
p03-sc0:C> showcomp sb2
Component           Status   Pending  POST   Description
---------           ------   -------  ----   -----------
/N0/SB2/P0          enabled  -        untest UltraSPARC-III+, 1050MHz, 8M ECache
/N0/SB2/P1          enabled  -        untest UltraSPARC-III+, 1050MHz, 8M ECache
/N0/SB2/P2          enabled  -        untest UltraSPARC-III+, 1050MHz, 8M ECache
/N0/SB2/P3          enabled  -        untest UltraSPARC-III+, 1050MHz, 8M ECache
/N0/SB2/P0/B0/L0    enabled  -        untest 512M DRAM
/N0/SB2/P0/B0/L2    enabled  -        untest 512M DRAM
/N0/SB2/P0/B1/L1    enabled  -        untest 512M DRAM
/N0/SB2/P0/B1/L3    enabled  -        untest 512M DRAM
/N0/SB2/P1/B0/L0    enabled  -        untest 512M DRAM
/N0/SB2/P1/B0/L2    enabled  -        untest 512M DRAM
/N0/SB2/P1/B1/L1    enabled  -        untest 512M DRAM
/N0/SB2/P1/B1/L3    enabled  -        untest 512M DRAM
/N0/SB2/P2/B0/L0    enabled  -        untest 512M DRAM
/N0/SB2/P2/B0/L2    enabled  -        untest 512M DRAM
/N0/SB2/P2/B1/L1    enabled  -        untest 512M DRAM
/N0/SB2/P2/B1/L3    enabled  -        untest 512M DRAM
/N0/SB2/P3/B0/L0    enabled  -        untest 512M DRAM
/N0/SB2/P3/B0/L2    enabled  -        untest 512M DRAM
/N0/SB2/P3/B1/L1    enabled  -        untest 512M DRAM
/N0/SB2/P3/B1/L3    enabled  -        untest 512M DRAM
p03-sc0:C> testbo sb2
Mar 23 11:12:26 p03-sc0 Domain-C.POST: Domain C: diag-level = mem2
Mar 23 11:12:26 p03-sc0 Domain-C.POST: Domain C: verbosity-level = min
Loading the test table from board SB2 PROM 0 ...
Mar 23 11:12:26 p03-sc0 Domain-C.POST: Domain C: error-level = max
{/N0/SB2/P2} Running CPU POR and Set Clocks
{/N0/SB2/P3} Running CPU POR and Set Clocks
{/N0/SB2/P0} Running CPU POR and Set Clocks
{/N0/SB2/P1} Running CPU POR and Set Clocks
{/N0/SB2/P0} @(#) lpost         5.20.16         2010/08/24 02:34
{/N0/SB2/P2} @(#) lpost         5.20.16         2010/08/24 02:34
{/N0/SB2/P1} @(#) lpost         5.20.16         2010/08/24 02:34
{/N0/SB2/P3} @(#) lpost         5.20.16         2010/08/24 02:34
{/N0/SB2/P0} Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
{/N0/SB2/P2} Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
{/N0/SB2/P3} Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
{/N0/SB2/P2} Subtest: Setting Fireplane Config Registers for aid 0xa
{/N0/SB2/P1} Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
{/N0/SB2/P3} Subtest: Setting Fireplane Config Registers for aid 0xb
{/N0/SB2/P0} Subtest: Setting Fireplane Config Registers for aid 0x8
{/N0/SB2/P1} Subtest: Setting Fireplane Config Registers for aid 0x9
{/N0/SB2/P0} Running Basic CPU
{/N0/SB2/P2} Running Basic CPU
{/N0/SB2/P1} Running Basic CPU
{/N0/SB2/P3} Running Basic CPU
{/N0/SB2/P0} Subtest: Display CPU Version, frequency
{/N0/SB2/P2} Subtest: Display CPU Version, frequency
{/N0/SB2/P1} Subtest: Display CPU Version, frequency
{/N0/SB2/P3} Subtest: Display CPU Version, frequency
{/N0/SB2/P0} Version register = 003e0015.23000507
{/N0/SB2/P2} Version register = 003e0015.23000507
{/N0/SB2/P1} Version register = 003e0015.23000507
{/N0/SB2/P3} Version register = 003e0015.23000507
{/N0/SB2/P2} CPU features = 2000225f.004205ff
{/N0/SB2/P0} CPU features = 2000225f.004205ff
{/N0/SB2/P1} CPU features = 2000225f.004205ff
{/N0/SB2/P3} CPU features = 2000225f.004205ff
{/N0/SB2/P2} Ecache Control Register 00000000.07c35400
{/N0/SB2/P3} Ecache Control Register 00000000.07c35400
{/N0/SB2/P0} Ecache Control Register 00000000.07c35400
{/N0/SB2/P1} Ecache Control Register 00000000.07c35400
{/N0/SB2/P2} Cpu/System ratio = 7, cpu actual frequency = 1050
{/N0/SB2/P3} Cpu/System ratio = 7, cpu actual frequency = 1050
{/N0/SB2/P0} Cpu/System ratio = 7, cpu actual frequency = 1050
{/N0/SB2/P1} Cpu/System ratio = 7, cpu actual frequency = 1050
{/N0/SB2/P2} @(#) lpost         5.20.16         2010/08/24 02:34
{/N0/SB2/P3} @(#) lpost         5.20.16         2010/08/24 02:34
{/N0/SB2/P0} @(#) lpost         5.20.16         2010/08/24 02:34
{/N0/SB2/P2} Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
{/N0/SB2/P1} @(#) lpost         5.20.16         2010/08/24 02:34
{/N0/SB2/P3} Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.

--------------------------------------------------------------
--------------------------------------------------------------

PostTestSequencer.testListSequencer: EpiMemR1
cpuCD: All agents under test failed POST
PostTestSequencer.sequencer: Cpu functional tests
cpuCD: All agents under test failed POST
{/N0/SB2/P1} Running Ecache Functional
Mar 23 11:47:20 p03-sc0 Domain-C.POST: {/N0/SB2/P1} not responding
PostTestSequencer.testListSequencer: EpiFecacheR1
cpuAB: All agents under test failed POST
PostTestSequencer.phaseSequencer: Cpu functional tests
cpuAB: All agents under test failed POST
PostTestSequencer.sequencer: Cpu advanced tests
cpuAB: All agents under test failed POST
{/N0/SB2/P0} Failed
{/N0/SB2/P1} Failed
{/N0/SB2/P2} Failed
{/N0/SB2/P3} Failed
Mar 23 11:47:20 p03-sc0 Domain-C.POST: {/N0/SB2/P1}     Memory DIMM J14400 failed

To find out the failed memory slot in a board

P031-SC1:SC> showchs -b
Component           Status
---------------     --------
/N0/SB2/P0/B1/D2/L0 Faulty
/N0/SB2/P0/B1/D2/L1 Faulty
/N0/SB2/P1/B1/D3/L0 Faulty
/N0/SB2/P1/B1/D3/L1 Faulty
/N0/SB2/P2/B0/D0/L0 Suspect
/N0/SB2/P2/B0/D1/L0 Suspect
/N0/SB2/P2/B0/D1/L1 Faulty
/N0/SB2/P2/B0/D2/L0 Suspect
/N0/SB2/P2/B0/D3/L0 Suspect
/N0/SB2/P2/B1/D1/L0 Faulty
/N0/SB2/P2/B1/D1/L1 Faulty
/N0/SB2/P3/B0/D1/L0 Faulty
/N0/SB2/P3/B0/D1/L1 Faulty
/N0/SB2/P3/B1/D0/L0 Faulty
/N0/SB2/P3/B1/D0/L1 Faulty
P031-SC1:SC>
P031-SC1:SC[service]> setchs -s ok -r "mem2 Test" -c /N0/SB2/P0/B1/D2/L0
P031-SC1:SC[service]> setchs -s ok -r "mem2 Test" -c /N0/SB2/P0/B1/D2/L1
P031-SC1:SC[service]> setchs -s ok -r "mem2 Test" -c /N0/SB2/P1/B1/D3/L0
P031-SC1:SC[service]> setchs -s ok -r "mem2 Test" -c /N0/SB2/P1/B1/D3/L1
P031-SC1:SC[service]> setchs -s ok -r "mem2 Test" -c /N0/SB2/P2/B0/D0/L0
P031-SC1:SC[service]> setchs -s ok -r "mem2 Test" -c /N0/SB2/P2/B0/D1/L0
P031-SC1:SC[service]> setchs -s ok -r "mem2 Test" -c /N0/SB2/P2/B0/D1/L1
P031-SC1:SC[service]> setchs -s ok -r "mem2 Test" -c /N0/SB2/P2/B0/D2/


How To check the System Board connectivity

#cfgadm -al|grep SB


How To take the backup and restore by using ufsdump

Command:-

#ufsdump 0f - /dev/rdsk/c0t0d0s7 | (cd /home; ufsrestore xf -)

How To check and change the TCP Anon Port range in solaris,linux,hp-ux,aix

Solaris

Solaris uses the "ndd" utility program to change tunable IP stack parameters.  The ephemeral ports on Solaris can be tuned individually for both TCP and UDP, so there are really two separate ephemeral port ranges.  Solaris also provides options to change the privileged port range (ports only processes running with superuser privileges can use).
The good news is that Solaris by default provides a large range at the end of the port range (32768 through 65535, or the upper 50%) so it is unlikely you will need to change the range from the default values.
The example below shows how to query the existing values for the TCP ephemeral ports, and change the range to 49152 through 61000:
          #ndd -get /dev/tcp tcp_smallest_anon_port
            OR
# /usr/sbin/ndd /dev/tcp tcp_smallest_anon_port tcp_largest_anon_port
32768

65535
# /usr/sbin/ndd -set /dev/tcp tcp_smallest_anon_port 49152
# /usr/sbin/ndd -set /dev/tcp tcp_largest_anon_port 61000
# /usr/sbin/ndd /dev/tcp tcp_smallest_anon_port tcp_largest_anon_port
49152

61000


Linux

Linux allows you to view and change the ephemeral port range by simply using the file /proc/sys/net/ipv4/ip_local_port_range.  For example, this shows the default configuration on a kernel 2.2 system:
$ cat /proc/sys/net/ipv4/ip_local_port_range 
1024 4999
To change this to the preferred range, you could do (as superuser):
# echo "49152 65535" > /proc/sys/net/ipv4/ip_local_port_range 
Note that you would need to do this each time the system boots, so be sure to add a line to a system startup script such as /etc/rc.local so your range is always used.
Also note that the Linux 2.4 kernel will default the range of 32768 through 61000 if adequate kernel memory is available, so changing the range may not be necessary on newer Linux systems.
Finally, also note that you may be able to use the sysctl interface to change the settings rather than using the /proc filesystem. The name of the sysctl parameter is "net.ipv4.ip_local_port_range".  Edit the/etc/sysctl.conf file if you have it, or have a startup script run the sysctl command manually if you want to change this parameter using sysctl.

HP-UX

HP-UX uses the "ndd" utility program to change tunable IP stack parameters.  The ephemeral ports on HP-UX can be tuned individually for both TCP and UDP, so there are really two separate ephemeral port ranges.  HP-UX also provides options to change the privileged port range (ports only processes running with superuser privileges can use).
The good news is that HP-UX uses our recommended port range (49152 through 65535) so it is unlikely you will need to change the range from the default values.
The example below shows how to query the existing values for the TCP ephemeral ports, and change the range to 50001 through 61000:
# /usr/bin/ndd /dev/tcp tcp_smallest_anon_port tcp_largest_anon_port
49152

65535
# /usr/bin/ndd -set /dev/tcp tcp_smallest_anon_port 50001
# /usr/bin/ndd -set /dev/tcp tcp_largest_anon_port 61000
# /usr/bin/ndd /dev/tcp tcp_smallest_anon_port tcp_largest_anon_port
50001

61000
Note that if you change the range values, you must do it each time the system boots.  As we've mentioned, the default values are sufficient so you do not need to change the range values, but if you decide to proceed, the preferred way to do this for HP-UX is to edit the file /etc/rc.config.d/nddconf and add entries.  For example, you might append these lines to your /etc/rc.config.d/nddconf file:
TRANSPORT_NAME[0]=tcp
NDD_NAME[0]=tcp_largest_anon_port
NDD_VALUE[0]=65535

TRANSPORT_NAME[1]=tcp
NDD_NAME[1]=tcp_smallest_anon_port
NDD_VALUE[1]=49152
If you do that, be sure that the entries are numbered accordingly.  For example, if there are 4 entries already present, you would see them numbered 0 through 3 (i.e. TRANSPORT_NAME[3]=...).  In that case, the entries you append need to be numbered after the existing entries.

AIX

AIX uses the "no" command to set network options.  AIX uses two separate ephemeral port ranges, one for TCP and UDP, and both default to the values 32768 through 65535:
# /usr/sbin/no -a | fgrep ephemeral
        tcp_ephemeral_low = 32768
       tcp_ephemeral_high = 65535
        udp_ephemeral_low = 32768
       udp_ephemeral_high = 65535
The default range is sufficient, but you can change it using the no command.  Here is an example that sets the TCP ephemeral port range to 49152 through 65535:
# /usr/sbin/no -o tcp_ephemeral_low=49152 -o tcp_ephemeral_high=65535
The options you set with no must be done each time the system starts up.  One way to do that is to edit /etc/rc.tcpip and insert your no commands just before the script starts running the server daemons.


Syscall count checking in solaris by process or by process id

# Syscall count by process name,
dtrace -n 'syscall:::entry { @num[execname] = count(); }'

# Syscall count by process ID,
dtrace -n 'syscall:::entry { @num[pid,execname] = count(); }'

RBACK Implementation in solaris for a user

Create a User and Role using command line
---------------------------------------------------------

# roleadd -m -d /export/home/sdown sdown
# passwd sdown

# grep sdown /etc/passwd
sdown:x:100:1::/export/home/sdown:/bin/pfsh
# grep sdown /etc/shadow
sdown:nVpVp8UAgLl8Q:15913::::::

# more /etc/user_attr
adm::::profiles=Log Management
lp::::profiles=Printer Management
postgres::::type=role;profiles=Postgres Administration,All
root::::auths=solaris.*,solaris.grant;profiles=Web Console Management,All;lock_after_retries=no;min_label=admin_low;clea
rance=admin_high
sdown::::type=role;profiles=All


Create the profile name Shut by adding a line to the /etc/security/prof_attr file
------------------------------------------------------------------------------------------------------------------

# vi /etc/security/prof_attr
Shut:::Able to shutdown the system:


Add the profile to the Role

# rolemod -P Shut sdown
# grep sdown /etc/user_attr
sdown::::type=role;profiles=Shut


Create a user and assign it access to sdown role
-----------------------------------------------------------------

# useradd -m -d /export/home/suresh -s /bin/ksh -R sdown suresh
# passwd suresh
# grep suresh/etc/user_attr
suresh::::type=normal;roles=sdown

# more /etc/user_attr
sdown::::type=role;profiles=Shut
suresh::::type=normal;roles=sdown


Assign the shutdown command to the profile
---------------------------------------------------------------

# vi /etc/security/exec_attr
Shut:suser:cmd:::/usr/sbin/shutdown:uid=0


Now Test the Configuration
-------------------------------------------

# su - suresh
bash-3.2$ profiles
Basic Solaris User
All

bash-3.2$ roles
sdown

bash-3.2$ su sdown                    
Password:
      {After login do not use bash shell}
$ profiles -l

      Shut:
          /usr/sbin/shutdown    uid=0
      All:
          *

$ /usr/sbin/shutdown

snoop/tcp dump collection in Solaris and HP-UX

Please use the below commands to collect the snoop/tcp dump

1)For Solaris we have snoop inbuilt command and tcpdump we need to install the pkg separately

# snoop -d vnet0 -o /temp/tcp/file.pcap host xyz


2) For HP-UX

a) Start collecting
# nettl -tn 0x30800000 -e all -tracemax 99999 -f /temp/tcp/raw0

b)List the logs files
# ls -la /temp/tcp/raw0.TRC*
-rw-------   1 root       sys        24108412 Sep 12 17:05 /temp/tcp/raw0.TRC000
-rw-------   1 root       sys        45472087 Sep 12 17:03 /temp/tcp/raw0.TRC001

c)Stop Tracing to the Raw Trace File

# nettl -tf -e all

mv /temp/tcp/raw0.TRC000 /temp/tcp/raw0.pcap
mv /temp/tcp/raw0.TRC001 /temp/tcp/raw1.pcap

--> Rename files to .pcap and Send these two files to Network team

IBM AIX

#tcpdump -s 0 -w /tmp/dump.pcap dst 0.0.0.0 and port 2013

Monday, 22 September 2014

Snapshots are Consuming more space on root and How to reduce the root space by deleting that snapshots


bash-3.00$ df -h /
Filesystem             size   used  avail capacity  Mounted on
tank/rpool
                      234G   2.4G   231G    98%    /

To Take snapshot of a mark dataset use below command

#zfs snapshot tank/home/mark@snap1
#zfs snapshot tank/home/mark@snap2

Parent/individual Snapshots are destroyed by using the zfs destroy command

#zfs destroy tank/home/matt@friday

How to create the clone from a snapshot

# zfs clone tank/home/mark@snap2    tank/home/mark1

To List data sets and snapshots in a pool (i.e tank/home)

#zfs list -r tank/home
NAME                   USED  AVAIL  REFER  MOUNTPOINT
tank/home/snap1           0      -    34K  -
tank/home/mark/snap1      0      -  2.00G  -------->Look's Ok
tank/home/mark/snap2      550M      -  2.00G  ------->Issue space occupying on root 550MB
tank/home/matt/snap1      0      -  1.00G  -
tank/home/tom/snap1       0      -  2.00G  -
tank/home/mark1                  0      -  2.00G

If you create a snapshot from a parent snapshot then we can't delete the parent snapshot with out deleting the chaild snapshot

For that we need to find out the parent and chaild snapshots for that particular dataset by using the name,creation format.

Process:-

#zfs list -t snapshot -r tank/home
NAME                   USED  AVAIL  REFER  MOUNTPOINT
tank/home@snap1           0      -    34K  -
tank/home/mark@snap1      0      -  2.00G  -
tank/home/mark@snap2      550M -  2.00G  -
tank/home/matt@snap1      0      -  1.00G  -
tank/home/tom@snap1       0      -  2.00G  -

# zfs list -r -t snapshot -o name,creation tank/home
NAME                      CREATION
tank/home/cindy@today     Fri May  6  6:32 2011
tank/home/mark@snap1      Fri May  6  6:22 2011
tank/home/mark@snap2      Fri May  12  6:22 2012
tank/home/matt@tuesday    Tue May  3  6:27 2011
tank/home/matt@wednesday  Wed May  4  6:28 2011
tank/home/matt@thursday   Thu May  5  6:28 2012

From the above command we can find the difference in year i.e 2011 and 2012.
2012 was chaild snapshot  and 2011 was parent snapshot.


If You want to delete the snapshot of the "tank/home/mark@snap1"
Below error occurred due to parent-chaild interconnection

# zfs destroy tank/home/mark@snap1
cannot destroy 'tank/home/mark@today': snapshot has dependent clones
use '-R' to destroy the following datasets:
tank/home/mark@snap2=====>It's recommended to delete  2nd
tank/home/mark1==========>It's recommended to delete 1st

Note:-Why We have to delete "tank/home/mark1" first?

Ans :-We have created a clone copy from chaild snapshot to check the date consistency.
Before destroy the any chaild snapshot we need to clear/destroy/separate  the clone copy.


1) Find out the origin of the chaild snapshot

# zfs get origin tank/home/mark1  
NAME               PROPERTY  VALUE                      SOURCE
tank/home/mark1    origin    tank/home/mark@snap2 -


# zfs get origin tank/home/mark@snap2
NAME               PROPERTY  VALUE                      SOURCE
tank/home/mark@snap2    origin    tank/home/mark@snap1 -

# zfs get origin tank/home/mark@snap1
NAME               PROPERTY  VALUE                      SOURCE
tank/home/mark@snap1    origin    tank/home/mark  -

First We need to destroy the chaild clone i.e "tank/home/mark1"

# zfs destroy tank/home/mark1

And then

# zfs destroy tank/home/mark@snap2

Then

# zfs destroy tank/home/mark@snap1

Issue:-

If you are taking the snapshots continuously and creating a clone copy from chaild snapshots and you are not removing the previous snapshot/clones before taking the new snapshot at that time snapshots will occupy more space on root.

To clear/reduce the root space below process need to follow


Solution:- 

If you are having space in other pool.Then by using the send receive method's in zfs we can move the date from one pool to other Pool and delete the clones and snapshot copy's.
#zfs send tank/home/mark@snap2| zfs receive zpool1/test1clone.

Or

Enable the promote option in zfs .This will divide the clone from snapshot and then there was no dependence to delete the chaild snapshots.

Once if you enable this feature in zfs it's actlike individual dataset. Before enabling to this feature please check the available space in root/ANY

#zfs promote tank/home/mark1

Conclusion:-

Do send receive process from source server to destination and delete the clones and snapshots.
After deleting the clones and snapshots space will free and do vice verse.
i.e Take the snapshot from destination server and do the send receive process to source server.



Saturday, 20 September 2014

How To check the total memory consumed at kernal level debugging

test2#echo "::memstat" | mdb -k

how to run the SC extended explorer in solaris

test2#cd /opt/SUNWexplo/bin/

test2#explorer -w default,fru,scextended

Configuring Solaris Host as NTP Client

Create the file /etc/inet/ntp.conf with the following entries:
server <0.0.0.0 > (Some document says it can be hostname as well. Please use IP
for safer option)
driftfile /var/ntp/ntp.drift
• Create the file /var/ntp/ntp.drift with the following entry
0.0 → It inform to NTP daemon rate of drift of client clock.
• Restart NTP services
• Solaris 8/9 – Use /etc/rc2.d/S74xntd stop/start
• Solaris 10 – Use svcadm restart ntp
• Check Status
• #ntpq
• ntpq> peers
remote refid st t when poll reach delay offset disp
=====================================================
*NTP Server IP some_ip 2 u 29 64 377 0.52 -13.796 0.93
• According to Sun, NTP can only sync time if it is off by no more than 17 minutes.
Furthermore, adjusting time being off by seconds will take several minutes because NTP is
architected to slowly adjust to the NTP master's time. It may also be adviseable to to use rdate
daily\weekly to account for systems that, for whatever reason, have their clocks off by more
than 17 minutes.
• Do not try this on a cluster. You need to shutdown the cluster when changing the cluster nodes
time
• Solaris Zones sync their time with Global Zones. So NTP Client configuration will not work for
Zones.
• Refer following links for detailed design, architecture, administration of NTP functioning.
• http://www.sun.com/blueprints/0701/NTP.pdf
• http://www.sun.com/blueprints/0801/NTPpt2.pdf
• http://www.sun.com/blueprints/0901/NTPpt3.pdf
• use ntpdate or rdate to sync time instantaneously
• NTP uses UDP Port – 123 for all communications.
• In case of using Multiple NTP Server, add flag “prefer” in front of your preferred server. Else,
NTP protocol will identify accuracy based on its algorithm and sync accordingly.
• Use multicasr or broadcast in case client need to use any broadcasted/multicasted packets on
network from any NTP server
• multicastclient 224.0.1.1 → Default address is used if not specified. You can specify any other
multicast address as well.
• Broadcastclient word do not require any address in front of it as it listens all brodcasted packets


mounting local iso image in solaris

sunsolaris# lofiadm -a /export/software/iso_image.iso
/dev/lofi/1

Mount the ISO Image block device

sunsolaris# mount -F hsfs -o ro /dev/lofi/1 /mnt

Where /mnt is the mount point.

How To create metaset and assign the ownership to metaset in solaris

root@test2 # metaset -s NEW-DMX04-DG01 -a -h test2
root@test2 # metaset

Set name = TESTDG01, Set number = 1

Host                Owner
  test2              Yes

Drive                              Dbase

/dev/dsk/c3t5006048C52A99AC7d124   Yes

/dev/dsk/c3t5006048C52A99AC7d125   Yes

Set name = NEW-DMX04-DG01, Set number = 2

Host                Owner==========No Owner
  test2


root@test2 # format c4t5006048C52A76EC8d159

c4t5006048C52A76EC8d159: configured with capacity of 136.15GB
selecting c4t5006048C52A76EC8d159
[disk formatted]


FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !<cmd>     - execute <cmd>, then return
        quit
format> p


PARTITION MENU:
        0      - change `0' partition
        1      - change `1' partition
        2      - change `2' partition
        3      - change `3' partition
        4      - change `4' partition
        5      - change `5' partition
        6      - change `6' partition
        7      - change `7' partition
        select - select a predefined table
        modify - modify a predefined partition table
        name   - name the current table
        print  - display the current table
        label  - write partition map and label to the disk
        !<cmd> - execute <cmd>, then return
        quit
partition> p
Current partition table (default):
Total disk cylinders available: 37178 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm       0 -    34      131.25MB    (35/0/0)       268800
  1       swap    wu      35 -    69      131.25MB    (35/0/0)       268800
  2     backup    wu       0 - 37177      136.15GB    (37178/0/0) 285527040
  3 unassigned    wm       0                0         (0/0/0)             0
  4 unassigned    wm       0                0         (0/0/0)             0
  5 unassigned    wm       0                0         (0/0/0)             0
  6        usr    wm      70 - 37177      135.89GB    (37108/0/0) 284989440
  7 unassigned    wm       0                0         (0/0/0)             0

partition> 0
Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm       0 -    34      131.25MB    (35/0/0)       268800

Enter partition id tag[root]:
Enter partition permission flags[wm]:
Enter new starting cyl[0]: 0
Enter partition size[268800b, 35c, 34e, 131.25mb, 0.13gb]: 0
partition> p
Current partition table (unnamed):
Total disk cylinders available: 37178 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0 unassigned    wm       0                0         (0/0/0)             0
  1       swap    wu      35 -    69      131.25MB    (35/0/0)       268800
  2     backup    wu       0 - 37177      136.15GB    (37178/0/0) 285527040
  3 unassigned    wm       0                0         (0/0/0)             0
  4 unassigned    wm       0                0         (0/0/0)             0
  5 unassigned    wm       0                0         (0/0/0)             0
  6        usr    wm      70 - 37177      135.89GB    (37108/0/0) 284989440
  7 unassigned    wm       0                0         (0/0/0)             0

partition> 1
Part      Tag    Flag     Cylinders         Size            Blocks
  1       swap    wu      35 -    69      131.25MB    (35/0/0)       268800

Enter partition id tag[swap]:
Enter partition permission flags[wu]:
Enter new starting cyl[35]: 0
Enter partition size[268800b, 35c, 34e, 131.25mb, 0.13gb]: 0
partition> p
Current partition table (unnamed):
Total disk cylinders available: 37178 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0 unassigned    wm       0                0         (0/0/0)             0
  1 unassigned    wu       0                0         (0/0/0)             0
  2     backup    wu       0 - 37177      136.15GB    (37178/0/0) 285527040
  3 unassigned    wm       0                0         (0/0/0)             0
  4 unassigned    wm       0                0         (0/0/0)             0
  5 unassigned    wm       0                0         (0/0/0)             0
  6        usr    wm      70 - 37177      135.89GB    (37108/0/0) 284989440
  7 unassigned    wm       0                0         (0/0/0)             0

partition> 6
Part      Tag    Flag     Cylinders         Size            Blocks
  6        usr    wm      70 - 37177      135.89GB    (37108/0/0) 284989440

Enter partition id tag[usr]:
Enter partition permission flags[wm]:
Enter new starting cyl[70]: 0
Enter partition size[284989440b, 37108c, 37107e, 139155.00mb, 135.89gb]: 0
partition> p
Current partition table (unnamed):
Total disk cylinders available: 37178 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0 unassigned    wm       0                0         (0/0/0)             0
  1 unassigned    wu       0                0         (0/0/0)             0
  2     backup    wu       0 - 37177      136.15GB    (37178/0/0) 285527040
  3 unassigned    wm       0                0         (0/0/0)             0
  4 unassigned    wm       0                0         (0/0/0)             0
  5 unassigned    wm       0                0         (0/0/0)             0
  6 unassigned    wm       0                0         (0/0/0)             0
  7 unassigned    wm       0                0         (0/0/0)             0

partition> 0
Part      Tag    Flag     Cylinders         Size            Blocks
  0 unassigned    wm       0                0         (0/0/0)             0

Enter partition id tag[unassigned]:
Enter partition permission flags[wm]:
Enter new starting cyl[0]:
Enter partition size[0b, 0c, 0e, 0.00mb, 0.00gb]: $
partition> p
Current partition table (unnamed):
Total disk cylinders available: 37178 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0 unassigned    wm       0 - 37177      136.15GB    (37178/0/0) 285527040
  1 unassigned    wu       0                0         (0/0/0)             0
  2     backup    wu       0 - 37177      136.15GB    (37178/0/0) 285527040
  3 unassigned    wm       0                0         (0/0/0)             0
  4 unassigned    wm       0                0         (0/0/0)             0
  5 unassigned    wm       0                0         (0/0/0)             0
  6 unassigned    wm       0                0         (0/0/0)             0
  7 unassigned    wm       0                0         (0/0/0)             0

partition> l
Ready to label disk, continue? yes

partition> p
Current partition table (unnamed):
Total disk cylinders available: 37178 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0 unassigned    wm       0 - 37177      136.15GB    (37178/0/0) 285527040
  1 unassigned    wu       0                0         (0/0/0)             0
  2     backup    wu       0 - 37177      136.15GB    (37178/0/0) 285527040
  3 unassigned    wm       0                0         (0/0/0)             0
  4 unassigned    wm       0                0         (0/0/0)             0
  5 unassigned    wm       0                0         (0/0/0)             0
  6 unassigned    wm       0                0         (0/0/0)             0
  7 unassigned    wm       0                0         (0/0/0)             0

partition> q


FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !<cmd>     - execute <cmd>, then return
        quit
format> q
root@test2 # format c4t5006048C52A76EC8d158

c4t5006048C52A76EC8d158: configured with capacity of 136.15GB
selecting c4t5006048C52A76EC8d158
[disk formatted]


FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !<cmd>     - execute <cmd>, then return
        quit
format> p


PARTITION MENU:
        0      - change `0' partition
        1      - change `1' partition
        2      - change `2' partition
        3      - change `3' partition
        4      - change `4' partition
        5      - change `5' partition
        6      - change `6' partition
        7      - change `7' partition
        select - select a predefined table
        modify - modify a predefined partition table
        name   - name the current table
        print  - display the current table
        label  - write partition map and label to the disk
        !<cmd> - execute <cmd>, then return
        quit
partition> p
Current partition table (default):
Total disk cylinders available: 37178 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm       0 -    34      131.25MB    (35/0/0)       268800
  1       swap    wu      35 -    69      131.25MB    (35/0/0)       268800
  2     backup    wu       0 - 37177      136.15GB    (37178/0/0) 285527040
  3 unassigned    wm       0                0         (0/0/0)             0
  4 unassigned    wm       0                0         (0/0/0)             0
  5 unassigned    wm       0                0         (0/0/0)             0
  6        usr    wm      70 - 37177      135.89GB    (37108/0/0) 284989440
  7 unassigned    wm       0                0         (0/0/0)             0

partition> 0
Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm       0 -    34      131.25MB    (35/0/0)       268800

Enter partition id tag[root]:
Enter partition permission flags[wm]:
Enter new starting cyl[0]: 0
Enter partition size[268800b, 35c, 34e, 131.25mb, 0.13gb]: 0
partition> p
Current partition table (unnamed):
Total disk cylinders available: 37178 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0 unassigned    wm       0                0         (0/0/0)             0
  1       swap    wu      35 -    69      131.25MB    (35/0/0)       268800
  2     backup    wu       0 - 37177      136.15GB    (37178/0/0) 285527040
  3 unassigned    wm       0                0         (0/0/0)             0
  4 unassigned    wm       0                0         (0/0/0)             0
  5 unassigned    wm       0                0         (0/0/0)             0
  6        usr    wm      70 - 37177      135.89GB    (37108/0/0) 284989440
  7 unassigned    wm       0                0         (0/0/0)             0

partition> 1
Part      Tag    Flag     Cylinders         Size            Blocks
  1       swap    wu      35 -    69      131.25MB    (35/0/0)       268800

Enter partition id tag[swap]:
Enter partition permission flags[wu]:
Enter new starting cyl[35]: 0
Enter partition size[268800b, 35c, 34e, 131.25mb, 0.13gb]: 0
partition> p
Current partition table (unnamed):
Total disk cylinders available: 37178 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0 unassigned    wm       0                0         (0/0/0)             0
  1 unassigned    wu       0                0         (0/0/0)             0
  2     backup    wu       0 - 37177      136.15GB    (37178/0/0) 285527040
  3 unassigned    wm       0                0         (0/0/0)             0
  4 unassigned    wm       0                0         (0/0/0)             0
  5 unassigned    wm       0                0         (0/0/0)             0
  6        usr    wm      70 - 37177      135.89GB    (37108/0/0) 284989440
  7 unassigned    wm       0                0         (0/0/0)             0

partition> 6
Part      Tag    Flag     Cylinders         Size            Blocks
  6        usr    wm      70 - 37177      135.89GB    (37108/0/0) 284989440

Enter partition id tag[usr]:
Enter partition permission flags[wm]:
Enter new starting cyl[70]: 0
Enter partition size[284989440b, 37108c, 37107e, 139155.00mb, 135.89gb]: 0
partition> p
Current partition table (unnamed):
Total disk cylinders available: 37178 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0 unassigned    wm       0                0         (0/0/0)             0
  1 unassigned    wu       0                0         (0/0/0)             0
  2     backup    wu       0 - 37177      136.15GB    (37178/0/0) 285527040
  3 unassigned    wm       0                0         (0/0/0)             0
  4 unassigned    wm       0                0         (0/0/0)             0
  5 unassigned    wm       0                0         (0/0/0)             0
  6 unassigned    wm       0                0         (0/0/0)             0
  7 unassigned    wm       0                0         (0/0/0)             0

partition> 0
Part      Tag    Flag     Cylinders         Size            Blocks
  0 unassigned    wm       0                0         (0/0/0)             0

Enter partition id tag[unassigned]:
Enter partition permission flags[wm]:
Enter new starting cyl[0]:
Enter partition size[0b, 0c, 0e, 0.00mb, 0.00gb]: $
partition> p
Current partition table (unnamed):
Total disk cylinders available: 37178 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0 unassigned    wm       0 - 37177      136.15GB    (37178/0/0) 285527040
  1 unassigned    wu       0                0         (0/0/0)             0
  2     backup    wu       0 - 37177      136.15GB    (37178/0/0) 285527040
  3 unassigned    wm       0                0         (0/0/0)             0
  4 unassigned    wm       0                0         (0/0/0)             0
  5 unassigned    wm       0                0         (0/0/0)             0
  6 unassigned    wm       0                0         (0/0/0)             0
  7 unassigned    wm       0                0         (0/0/0)             0

partition> l
Ready to label disk, continue? yes

partition> q


FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !<cmd>     - execute <cmd>, then return
        quit
format> q
root@test2 # metaset -s NEW-DMX04-DG01 -a c4t5006048C52A76EC8d159 c4t5006048C52A76EC8d158
root@test2 # metaset

Set name = TESTDG01, Set number = 1

Host                Owner
  test2              Yes

Drive                              Dbase

/dev/dsk/c3t5006048C52A99AC7d124   Yes

/dev/dsk/c3t5006048C52A99AC7d125   Yes

Set name = NEW-DMX04-DG01, Set number = 2

Host                Owner
  test2              Yes

Drive                              Dbase

/dev/dsk/c4t5006048C52A76EC8d159   Yes

/dev/dsk/c4t5006048C52A76EC8d158   Yes

root@test2 # metaset -s NEW-DMX04-DG01 -t
root@test2 # metaset

Set name = TESTDG01, Set number = 1

Host                Owner
  test2              Yes

Drive                              Dbase

/dev/dsk/c3t5006048C52A99AC7d124   Yes

/dev/dsk/c3t5006048C52A99AC7d125   Yes

Set name = NEW-DMX04-DG01, Set number = 2

Host                Owner
  test2              Yes===============>ownership Appear

Drive                              Dbase

/dev/dsk/c4t5006048C52A76EC8d159   Yes

/dev/dsk/c4t5006048C52A76EC8d158   Yes



Note:After Reboot Meta set ownership will gone/disappear manually we need to assign the ownership by using  (metaset -s NEW-DMX04-DG01 -t)

root@test2 # metainit -s NEW-DMX04-DG01 d200 1 2 c4t5006048C52A76EC8d159s0 c4t5006048C52A76EC8d158s0
NEW-DMX04-DG01/d200: Concat/Stripe is setup

root@test2 # metastat -s NEW-DMX04-DG01
NEW-DMX04-DG01/d200: Concat/Stripe
    Size: 571023360 blocks (272 GB)
    Stripe 0: (interlace: 32 blocks)
        Device                               Start Block  Dbase Reloc
        /dev/dsk/c4t5006048C52A76EC8d159s0          0     No    Yes
        /dev/dsk/c4t5006048C52A76EC8d158s0          0     No    Yes

Device Relocation Information:
Device                             Reloc        Device ID
/dev/dsk/c4t5006048C52A76EC8d159   Yes          id1,ssd@n60060480000290102715533032463133
/dev/dsk/c4t5006048C52A76EC8d158   Yes          id1,ssd@n60060480000290102715533032463142

root@test2 # metainit -s NEW-DMX04-DG01 d202 -p d200 30g
d202: Soft Partition is setup
root@test2 # metainit -s NEW-DMX04-DG01 d203 -p d200 15g
d203: Soft Partition is setup
root@test2 # metainit -s NEW-DMX04-DG01 d204 -p d200 25g
d204: Soft Partition is setup
root@test2 # metainit -s NEW-DMX04-DG01 d205 -p d200 20g
d205: Soft Partition is setup

root@test2 # metastat -s NEW-DMX04-DG01
NEW-DMX04-DG01/d214: Soft Partition
    Device: NEW-DMX04-DG01/d200
    State: Okay
    Size: 4194304 blocks (2.0 GB)
        Extent              Start Block              Block count
             0                559940032                  4194304

NEW-DMX04-DG01/d200: Concat/Stripe
    Size: 571023360 blocks (272 GB)
    Stripe 0: (interlace: 32 blocks)
        Device                               Start Block  Dbase        State Reloc Hot Spare
        /dev/dsk/c4t5006048C52A76EC8d159s0          0     No            Okay   Yes
        /dev/dsk/c4t5006048C52A76EC8d158s0          0     No            Okay   Yes
NEW-DMX04-DG01/d205: Soft Partition
    Device: NEW-DMX04-DG01/d200
    State: Okay
    Size: 41943040 blocks (20 GB)
        Extent              Start Block              Block count
             0                251658400                 41943040

NEW-DMX04-DG01/d204: Soft Partition
    Device: NEW-DMX04-DG01/d200
    State: Okay
    Size: 52428800 blocks (25 GB)
        Extent              Start Block              Block count
             0                199229568                 52428800

NEW-DMX04-DG01/d203: Soft Partition
    Device: NEW-DMX04-DG01/d200
    State: Okay
    Size: 31457280 blocks (15 GB)
        Extent              Start Block              Block count
             0                167772256                 31457280

NEW-DMX04-DG01/d202: Soft Partition
    Device: NEW-DMX04-DG01/d200
    State: Okay
    Size: 62914560 blocks (30 GB)
        Extent              Start Block              Block count
             0                104857664                 62914560
Device Relocation Information:
Device                             Reloc        Device ID
/dev/dsk/c4t5006048C52A76EC8d159   Yes          id1,ssd@n60060480000290102715533032463133
/dev/dsk/c4t5006048C52A76EC8d158   Yes          id1,ssd@n60060480000290102715533032463142



root@test2 # newfs /dev/md/NEW-DMX04-DG01/rdsk/d203
root@test2 # newfs /dev/md/NEW-DMX04-DG01/rdsk/d205

root@test2 #mount -F ufs /dev/md/NEW-DMX04-DG01/dsk/d202 /u13/oradata/archive1_New
root@test2 #mount -F ufs /dev/md/NEW-DMX04-DG01/dsk/d203 /u01/app/oms_New
root@test2 #mount -F ufs /dev/md/NEW-DMX04-DG01/dsk/d204 /u01/app/wls_New
root@test2 #mount -F ufs /dev/md/NEW-DMX04-DG01/dsk/d205 /u11/oradata/undo_New





How to add the locals in solaris


Mount the iso image in /mnt

and do as below

#localeadm -a en_US.UTF-8 -d /mnt

How to check local's

#locale -a

How to check the Serial Number from SC prompt in Sun Hardware

showpl -p mac

How To Restart and Repai FMADM in Solaris

1. The CPU/Mem board on slot C needs to be replaced.
2. Clear the fma errors

*To clear the FMA faults and error logs from Solaris:*

a) Show faults in FMA
# fmadm faulty

b)  For each fault listed in the 'fmadm faulty' run
# fmadm repair <uuid>

c) Clear ereports and resource cache
# cd /var/fm/fmd
# rm e* f* c*/eft/* r*/*

d)  Reset the fmd serd modules
# fmadm reset cpumem-diagnosis
# fmadm reset cpumem-retire
# fmadm reset eft
# fmadm reset io-retire 

About DEFUNCT Process


l  defunct processes does not consume any system resources (minimal, negligible) and can be ignored (until number is huge)
l  Defunct processes are created when a child process exits and it's parent does not wait for it
l  Once a child process exits and infroms parent process, parent process should send clean up signal. If parent process does not clean up child process, it turns into defunct process
l  Badly written programs leaks children and creates defunct processes
l  Normally, zombie (defunct) processes are cleaned by INIT process once their parent processes terminates.

Following actions can be taken when defucnt processes are observed

l  Fix the program to avoid defunct processes. This is always preferred way.

l  Restart the parent process. When parent process is stopped, child process becomes ORPHAN and INIT process becomes its parent. Note difference between defunct and orphan process. Defunct process with parent PID 1 are ORPHAN.
l  Reboot system – This will clean up all defunct processes. Please note this does not guarantee that defunct processes  will not be created after reboot

l  Use preap command (see man preap for syntax) to reap the child. Please note this can be dangerous as parent actually may be waiting for CHILD process and expecting to reap child at later date/time. PREAP should be used only if you are sure enough that process is defunct and parent is not waiting/expecting to clean up child process. ORPHAN processes are good candidates for preap use. KILL with signal 9 should be used prior to using preap.