Technical Hints and Tips

Embed Size (px)

Citation preview

Technical Cookbook Hints and Tips

Technical Hints and Tips1 ALOM FIRMWARE

ALOM upgrades can be found at:

http://www.sun.com/software/download/sys_admin.htmlor: http://www.sun.com/downloadand search for "Sun Advanced Lights Out Manager"

if you download the ALOM1.5Help-en file and untar it, you can browse all alom-info

Use the flashupdate command to install a new version of the ALOM firmware from a location that you specify. The values you enter for command options specify the IP address of the site from which you download and the path at which the firmware image is located.

There are two types of ALOM firmware images: the main firmware and the bootmon (boot monitor) firmware. The bootmon firmware is the low-level bootstrap image. Be sure to locate the correct image when preparing to use the flashupdate command.

Caution: Do not use the scadm resetrsc command while a firmware update is in progress. If you need to reset ALOM, wait until after the update is complete. Otherwise, you could corrupt the ALOM firmware and render it unusable.

How to Use the flashupdate Command

Note: You must have a level user permission to use this command.

Before You Begin

To use this command, you need to know the following:

* IP address of the server from which you want to download the firmware image

* The path at which the image is stored

* The user name and password to enter at the prompts

Before you start, if your server has a front panel keyswitch, make sure that the keyswitch is in the Normal (unlocked) position. If you use this command with the keyswitch in the Locked position, the firmware will not update.

1. At the sc> prompt, type one the following commands. Substitute the IP address of the server where the firmware image is stored for ipaddr, and the path name for pathname.

For the main firmware image, the command is similar to the following:

sc> flashupdate -s ipaddr -f pathname/alommainfw

For the bootmon image, the command appears similar to this:

sc> flashupdate -s ipaddr -f pathname/alombootfw

Note: The path you use for pathname is /usr/platform/

platform-name/lib/images/(alommainfw | alombootfw). To find the correct value for platform-name, use the uname -i command.

2. When prompted, type your user name and password, which are based on your UNIX or LDAP user name and password and not your ALOM user name and password.

3. After you type your user name and password, the download process continues. As the download process progresses, a series of periods appear across your screen. (If you selected the -v option, ALOM returns status messages as the download process occurs.) When the download process is finished, ALOM displays the message: Update complete.

4. Type the resetsc command to reset ALOM.

For example (replace xxx.xxx.xxx.xxx with a valid IP address):

sc> flashupdate -s xxx.xxx.xxx.xxx -f

/usr/platform/SUNW,Sun-Fire-V440/lib/images/alommainfw

Username: joeuser

Password: ********

..........................

Update complete. To use the new image the device will need to be reset using 'resetsc'.

sc>2 How to override the ALOM password

To overide the system's ALOM password, you need to do the following:

1. Attach the console to Serial Management Port.

2. Power on the server via the front power button. Once POST has completed,

you will need to wait 1 to 2 minutes for a timeout to occur and for the

system to drop to the "ok>" prompt.

Below is an example of what you might see on the console:

Please login:

SC Alert: Host System has Reset

[wait one two minutes]

Serial line login timeout, returns to console stream.

ok>

3. Boot the system to the OS level. If Solaris[TM] is not currently

installed on the server, you will need to install it at this point.

4. Use the scadm command to reset the admin password:

a. cd /usr/platform/`uname -i`/sbin

b. /scadm userpassword admin

5. Use the escape sequence "#." to get the system back to the ALOM login

prompt.

6. You can now log into the admin account using the password from Step 4b.

3 How to Create an explorer output

etbs28-SUN480:/opt/SUNWexplo/bin>./explorer -q -e

WARNING: EXP_SERIAL_83193527 not set!

WARNING: EXP_CONTRACT_ID not set!

WARNING: EXP_USER_NAME not set!

WARNING: EXP_USER_EMAIL not set!

WARNING: EXP_PHONE not set!

WARNING: EXP_ADDRESS_1 not set!

WARNING: EXP_ADDRESS_CITY not set!

WARNING: EXP_ADDRESS_STATE not set!

WARNING: EXP_ADDRESS_ZIP not set!

WARNING: EXP_ADDRESS_COUNTRY not set!

WARNING: EXP_REPLY not set!

11 warnings found in /opt/SUNWexplo/etc/default/explorer

You will find the result in :

etbs28-SUN480:/opt/SUNWexplo/output>ls

explorer.83193527.etbs28-2002.10.29.10.48

explorer.83193527.etbs28-2002.10.29.10.48.tar.gz

Sun has created this website: https://supportfiles.sun.com/ for customers who

want to upload Explorer files to Sun through its secured and encrypted HTTPS

channel. Companies will no longer have to worry about its system information

being exposed to the public in plain text format when transferring.

There are 3 steps to follow:

1. In step 1, click the "Browse" button to obtain the Explorer file to be

uploaded to Sun.

2. In step 2, in the "Destination" drop down box select "Explorer".

3. Click the button "Upload", and you are done!

This allows upload of Explorer files to Sun in a secured way.

The explorer will stay on supportfiles.sun.com only for max 2 days,

so warn the sun-engineer that upload has been done.

PROBLEMS USING EXPLORER :

As in the message I'am invited to run the command

"/bin/explorer -g" to update explorer defaults file.

when I run it, at the question :

Agree to these terms? [y,n]

my answer is never understood , it ask over and over again the question

SOLUTION

On a system with Explorer 5.1 installed and where the problem occurs,

in a root /sbin/sh shell,

# unset LD_LIBRARY_PATH

# PATH=/usr/bin:/usr/sbin

# export PATH

# /opt/SUNWexplo/bin/explorer -g

4 Script to change hostname

!!! not applicable for a Sun cluster node !!!

export NAME=SAMCP1

echo $NAME > /etc/nodename

echo "$NAME $NAME" > /etc/net/ticlts/hosts

echo "$NAME $NAME" > /etc/net/ticots/hosts

echo "$NAME $NAME" > /etc/net/ticotsord/hosts

for i in `ls -1 /etc/hostname.*`

do

MACHINE=`cat /etc/nodename`

TYPE=`echo $i|cut -d "." -f 2`

echo $MACHINE"_"$TYPE > $i

done

mv /var/crash/`ls -1 /var/crash` /var/crash/`cat /etc/nodename`

dumpadm -s /var/crash/`cat /etc/nodename`

ls -l /var/crash

To check :

cat /etc/hostname*

cat /etc/nodename

cat /etc/net/ticlts/hosts

cat /etc/net/ticots/hosts

cat /etc/net/ticotsord/hosts

cat /etc/hosts|grep $NAME

! /etc/hosts should be already populated with the new hostname

! Do not forget to change the license server hostname if needed :

echo "7588@NEW_NAME" > /opt/SUNWspro/license_dir/lic_router

! Do not forget to update the NTP configuration if needed with the new hostnames :

#vi /etc/ntp.conf

/etc/rc2.d/S74xntpd stop

/etc/rc2.d/S74xntpd start

5 Swap

5.1 Add swap space using a file.

As root run

mkfile 5100538368 /in/swap2

where 5100538368 is the size in bytes and /in/swap2 is the location of the file

swap -a /in/swap2

to add the swap

add the following line to /etc/vfstab

/in/swap2 - - swap - no -

after the mount command of /in

Check with swap -l and swap s

5.2 Add swap space using a slice.

first check for a free partition and make a new one:

metastat show the internal disk mirrors and submirrors

df -k

more /etc/vfstab

when you have find a free one

format

format>disk choose your disk

format>partition

partition>print shows the current config of the disks

partition>0 if your free partition is 0

Enter partition id tag[root]: swap

Enter partition permission flags[wm]:

Enter new starting cyl[0]:

Enter partition size[263872b, 56c, 128.84mb, 0.13gb]: 2.00gb

partition> label

Ready to label disk, continue? yes

partition> print

partition> quit

swap -a /dev/dsk/c1t10d0s0

then add the following line in /etc/vfstab

/dev/dsk/c1t10d0s0 - - swap - no 6 How do I find out what process is associated with a socket connectionThere are several ways to accomplish this (lsof, pfiles, crash):

A1. Use lsof which is available on the net from several locations:

ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/lsof.tar.Z

http://www.sunfreeware.com/programlistsparc7.html#lsof http://www.sunfreeware.com/programlistsparc8.html#lsof http://www.sunsite.org.uk/package/sunfreeware/pub/freeware/lsof examples:

Ex: netstat -a shows a connection between hodware port 36169 to ravin port 23

lsof shows the PID owner of the telnet connection.

example1# netstat -a

...

hodware.36169 ravin.telnet 8760 0 8760 0 ESTABLISHED

# lsof -i TCP@hodware:36169

COMMAND PID USER FD TYPE DEVICE SIZE/OFF INODE NAME

telnet 2686 steve 6u inet 0x709f21e8 0t0 TCP hodware:36169->ravin:telnet (ESTABLISHED)

Ex: netstat -an shows a connection in close_wait.

lsof showd the PID and process associated with that port.

example2# netstat -an |grep CLOSE_WAIT

10.10.192.103.58046 10.10.37.122.44788 24820 0 24820 0 CLOSE_WAIT

# /usr/local/bin/lsof -i | grep 44788

netscape 27096 steve 34u inet 0x300039bf760 0t0 TCP hodware:58046->nop:44788 (CLOSE_WAIT)

# ps -elf |grep 27096

8 S steve 27096 19185 0 51 20 ? 9307 ? Feb 18 pts/19 50:03 /opt/netscape/netscape

example3# netstat -an |grep 7100

*.7100 *.* 0 0 0 0 LISTEN

# /usr/local/bin/lsof -i TCP:7100

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME

inetd 4512 root 33u inet 0x300014ef750 0t0 TCP *:fs (LISTEN)

to list all ports with a process:

example4# lsof -i -P | grep snmpdx

snmpdx 5771 root 4u inet 0x60f5add0 0t0 UDP *:161 (Idle)

snmpdx 5771 root 5u inet 0x60ded648 0t0 UDP *:38725 (Idle)

snmpdx 5771 root 6u inet 0x61101358 0t0 UDP *:38726 (Idle)

#

to list all TCP connections

example5# /usr/local/bin/lsof -i TCP

note: lsof is not supported by Sun Enterprise Services, so you are on your own

as far as obtaining it, compiling it and running it and any problems you may encounter.

________________

A2. or use Solaris 8 pfiles

Solaris 8 added new feature to display socketname using pfiles tool.

see proc(1) and below example.

solaris 8 pfiles methods :

example5# cd /proc ; /usr/proc/bin/pfiles * | egrep "^[0-9]|sockname" | more

....

968: in.ftpd

sockname: AF_INET6 ::ffff:10.1.1.77 port: 21

sockname: AF_INET6 ::ffff:10.1.1.77 port: 21

or

example6# su

# cd /proc

# /usr/proc/bin/pfiles * > /tmp/pfiles.out

# vi /tmp/pfiles.out

/port: PortOfInterest

?^[0-9]

________________

A3. if you are resourceful enough, use adb or crash to trace down each open file descriptor

that a process owns, but there is no way to go in the reverse direction so this would be extremely

time consuming and tedious.

7 How TO check if /etc/system settings are activeExample;

# mdb -k

Loading modules: [ unix krtld genunix specfs dtrace ufs sd pcipsy ip

sctp usba fcp fctl nca md crypto zfs random nfs logindmux ptm cpc fcip

sppp ]

> sd_io_time/D

sd_io_time:

sd_io_time: 60

> sd_ua_retry_count/D

sd_ua_retry_count:

sd_ua_retry_count: 600

> scsi_reset_delay/D

scsi_reset_delay:

scsi_reset_delay: 3000

8 How to CHECK SCSI-BUS speed and adjust

You can check the negotiation speed with the following:

# prtpicl -v | grep sync

:no-dma-interrupt-sync

:target0-sync-speed 320000

:target1-sync-speed 320000

:target2-sync-speed 320000

:target0-sync-speed 40000

:target1-sync-speed 40000

:target2-sync-speed 40000

In the example, the second lot of disks are running at 40000, but the

onboard SCSI controller in the Sun Fire V440 server is an Ultra320 SCSI,

and in the Sun StorEdge S1 array is an Ultra160 SCSI. Therefore, the

minimum speed should be 16000.

Also, the following messages appear during boot:

NOTICE: mpt1: fault detected in device; service still available

NOTICE: mpt1: Connected command timeout for Target 0

WARNING: /pci@1f,700000/scsi@2,1 (mpt1):

Target 0 reducing sync. transfer rate

Add the following to the /kernel/drv/mpt.conf file and then reboot:

name="mpt" parent="/pci@1f,700000"

unit-address="2,1"

scsi-options=0x1ff8;

Compare the prtpicl output following this change to the prtpic1 output

shown previously:

# prtpicl -v | grep sync

:no-dma-interrupt-sync

:target0-sync-speed 320000

:target1-sync-speed 320000

:target2-sync-speed 320000

:target0-sync-speed 160000

:target1-sync-speed 160000

:target2-sync-speed 160000

Target 0 reverting to async. mode

In case of 3310 attached to ultra320 hba

ONLY TO BE DONE IF EXTERNALS DISKS ARE IN A SE3310 JBOD

A) To check with JBOD is connected, launch following command:

sccli> show inquiry-data

Vendor: SUN

Product: StorEdge 3310 D

Revision: A000

Peripheral Device Type: 0x3

Page 80 Serial Number: 005463

Device Type: Enclosure

B) Fix the speed of the Ultra320 HBA to 160 which is to the max speed of the

SE 3310 JBOD

1) Create following file (as root:sys 644): /kernel/drv/mpt.

2) In this file add following line (see example bellow) corresponding to

the devices of the externals disks:

Example:

name="mpt" parent="/pci@1c,600000" unit-address="1" scsi-options=0x1ff8;

name="mpt" parent="/pci@1d,700000" unit-address="2" scsi-options=0x1ff8;

In order to identify the devices used for external disks, the following rule

must been used:

- df -k to identify the mount point ==> identification of the external

drives (see disk config sheet)

- metastat (or 'scdidadm -l' if shared disks) to identify the device

corresponding to the external disks

- format to identify the controller associated to each device

3) Reboot the system to take changes into account

9 How to CHECK network speed

Example for bge interface

# /usr/sbin/ndd /dev/bge0 link_status

/actual link state, 0=down 1=up/

# /usr/sbin/ndd /dev/bge0 link_speed

/actual link speed in Mbit/s/

# /usr/bin/kstat -p bge:0::duplex

/actual duplex setting, full or half/

10 how to stop Metadevice sync Process

The procedure to stop the meta device syncing is based on making the size of the underlying partition of the metadevice temporarily 0. This will make the sync process fail and the metadevice will be put in maintenance status. Then later re-establishing the physical size of the partition and starting the sync process manually by re-attaching the metadevice.

ONLY TO BE USED in XTREME CONDITIONS

Example:

1) Observe the sync status:

metastat -s nfsds

nfsds/d0: Mirror

Submirror 0: nfsds/d1

State: Okay

Submirror 1: nfsds/d2

State: Resyncing

Resync in progress: 4 % done

Pass: 1

Read option: roundrobin (default)

Write option: parallel (default)

Size: 8299200 blocks

nfsds/d1: Submirror of nfsds/d0

State: Okay

Size: 8299200 blocks

Stripe 0: (interlace: 32 blocks)

Device Start Block Dbase State Hot Spare

d4s0 0 No Okay

d5s0 0 No Okay

nfsds/d2: Submirror of nfsds/d0

State: Resyncing

Size: 8299200 blocks

Stripe 0: (interlace: 32 blocks)

Device Start Block Dbase State Hot Spare

d6s0 0 No Okay

d7s0 0 No Resyncing

From this, see that the actual metadevice that is being synced to is:

d7s0 0 No Resyncing

2) This is in a cluster so d7 actually refers to did instance 7. Find the actual device:

scdidadm -L d7

7 sc-lvm1:/dev/rdsk/c1t1d2 /dev/did/rdsk/d7

7 sc-lvm2:/dev/rdsk/c1t1d2 /dev/did/rdsk/d7

Note: In this case d7 on node sc-lvm2 is /dev/rdsk/c1t1d2.

3)Change the partition size of d7 slice 0 to 0:

Using format command

format> partition

partition> print

Current partition table (original):

Total disk cylinders available: 2733 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks

0 unassigned wm 3 - 2732 1.98GB (2730/0/0) 4149600

1 unassigned wm 0 0 (0/0/0) 0

2 unassigned wm 0 0 (0/0/0) 0

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 wu 0 - 2 2.23MB (3/0/0) 4560

partition> 0

Part Tag Flag Cylinders Size Blocks

0 unassigned wm 3 - 2732 1.98GB (2730/0/0) 4149600

Enter partition id tag[unassigned]:

Enter partition permission flags[wm]:

Enter new starting cyl[3]:

Enter partition size[4149600b, 2730c, 2026.17mb, 1.98gb]: 0

partition> pr

Current partition table (unnamed):

Total disk cylinders available: 2733 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks

0 unassigned wm 0 0 (0/0/0) 0

1 unassigned wm 0 0 (0/0/0) 0

2 unassigned wm 0 0 (0/0/0) 0

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 wu 0 - 2 2.23MB (3/0/0) 4560

partition> label

Ready to label disk, continue? y

partition> q

metastat -s nfsds

nfsds/d0: Mirror

Submirror 0: nfsds/d1

State: Okay

Submirror 1: nfsds/d2

State: Needs maintenance

Pass: 1

Read option: roundrobin (default)

Write option: parallel (default)

Size: 8299200 blocks

nfsds/d1: Submirror of nfsds/d0

State: Okay

Size: 8299200 blocks

Stripe 0: (interlace: 32 blocks)

Device Start Block Dbase State Hot Spare

d4s0 0 No Okay

d5s0 0 No Okay

nfsds/d2: Submirror of nfsds/d0

State: Needs maintenance

Invoke: metareplace nfsds/d0 d7s0

Size: 8299200 blocks

Stripe 0: (interlace: 32 blocks)

Device Start Block Dbase State Hot Spare

d6s0 0 No Okay

d7s0 0 No Maintenance

Note: The d7s0 is now in maintenance state and is no longer being sync(ed).

Look for similar message on console and in system log:

Apr 26 11:06:28 sc-lvm2 md_stripe: WARNING: md: nfsds/d2: write error on

/dev/did/dsk/d7s0

Apr 26 11:06:29 sc-lvm2 md_mirror: WARNING: md: nfsds/d2: /dev/did/dsk/d7s0

needs maintenance

4)Enable syncing of the metadevice:

When ready to kick off the sync process, undo the changes in respect to the size of slice the slice you modified.

Use format/partition:

start the sync:

metareplace -s nfsds -e nfsds/d0 /dev/did/dsk/d7s0

nfsds/d0: device d7s0 is enabled

And finally check status:

metastat -s nfsds

nfsds/d0: Mirror

Submirror 0: nfsds/d1

State: Okay

Submirror 1: nfsds/d2

State: Resyncing

Resync in progress: 1 % done

The amount of time the sync process will take depends on the size of the

metadevice and system load.

11 how to bind a process to cpu

The pbind command binds all LWPs of a process (that is, every part

of a process) to a given CPU:

/usr/sbin/pbind -b

pbind can be used also to "unbind" a process with

/usr/sbin/pbind -i

and to query status of process bindings:

/usr/sbin/pbind -q

Please see the man page on pbind(1M) for more details