Wednesday, January 27, 2010

HP-UX: Create a new software depot for patches

Taken from http://www.unixguide.net/hp/patch_depot.shtml

Creating a separate software depot for your patches is useful,
when space is tight and patches have dependencies.

Assuming you have two patches PHNE_20000 and PHNE_20001.

unshare all two patches by typing the following commands.

sh PHNE_20000
sh PHNE_20001

Next, we have to create a new software depot on the directory /newdir/depot

mkdir /newdir/depot
swpackage -s PHNE_20000.depot -d /newdir/depot

Register your new depot on the sd-ux.

swreg -l depot /newdir/depot

Copy the next patch to the newly created software depot.

swcopy -s `pwd`/PHNE_20001.depot PHNE_20001 @ /newdir/depot

You are now ready to install your patches

swinstall -s /newdir/depot

Wednesday, January 13, 2010

How to add temporary directory based swap space in HPUX

The examples enable paging to the file system containing the /paging directory. The maximum number of file system blocks available to the paging system is set to 5000, the number of file system blocks reserved for file system use only is set to 10000, and the priority is set to 2. The number of file system blocks initially taken by the paging system defaults to 0 in the first example, and is set to 0 in the second example. On a file system with the default 8kB block size, these examples allocate approximately 40MB of file system paging.

# /usr/sbin/swapon -l 5000 -r 10000 -p 2 /paging

Tuesday, February 3, 2009

lquerypr - low level tool to break scsi disk reservation

lquerypr -Vh /dev/vpath13 -- list
lquerypr -Vph /dev/vpath13 -- to reset


1. To test the persistent reservation status on the device:

lquerypr -h /dev/vpath30

This will try to read the persisten reservation on the device without displaying.
If there is a persistent reservation, shell return code will be 0 if device
reserved by the current host, or 1 if device reserved by the other hosts.

2. To test and display the persistent reservation on the device:

lquerypr -vh /dev/vpath30

Same as above. In addtion, it displays the persistent reservation key.

3. To release the persistent reservation if the device is reserved by the current host:

lquerypr -rh /dev/vpath30

Release the persistent reservation if device is reserved by the current host.
Return code should be 0 if the command succeeds or if device is not reserved.
If the command fails, return code is 2.

4. To remove the persistent reservation and clear all reservation key registration:

lquerypr -ch /dev/vpath30

Removes the persistent reservation and clears all reservation key registration.
Return code is 0 if the command succeeds or 2 if the command fails.

5. To remove the persistent reservation if the device is reserved by the other host

lquerypr -ph /dev/vpath30


Removes the persistent reservation by preempting the persistent reservation
reserved by the other hosts . Return code is 0 if the command succeeds or if the
device is not reserved;.or it returns 2 if the command fails.

Note: If the command issued without options of -p, -r or -c, the command
will return 0 if there is no persistent reservation key on the device, or the
device is reserved by the current host; it returns 1 if the persistent reservation
key is different from the host reservation key; it returns 2 if the command fails,
or it returns 3 if device is already opened.

If the command issued with one of the options of -p, -r or -c, it returns
0 if the command succeeds; it returns 2 if the command fails, or it returns 3
if device is alreayd opened.


**Thanks to Suhaila for contribution.

Thursday, September 4, 2008

SAN event data gathering tips

Taken from : http://www.redbooks.ibm.com/abstracts/tips0553.html

The purpose of this TIP is to outline all the basic information that needs to be collected to assist in resolving SAN related problems. You might find it daunting to have to go through several steps to gather all the data requested, but the most common cause of delays in problem resolution is a lack of data. Therefore, you should never assume that the root cause of any problem is in the most obvious place. By gathering logs from all parts of the SAN, you give yourself the greatest chance of getting a fast and effective resolution to the problem.

The second most common cause of delays in problem resolution is providing data that has been collected some hours or even days after the problem occurred. Often in this case, there is no longer evidence of the original problem. Timely and complete data collection will aid in problems being resolved quickly. Collection of timely and detailed information for hosts are outlined in the following sections.

The collection of log information is critical to understanding the cause of an event in a SAN environment, and to aid support in analyzing the collected logs. It is also useful to provide the time offsets of individual equipment. As some hardware may never have had its real-time clock set to the local time, it can become very difficult to match events from one piece of equipment to the other. Another important piece of information to aid in timely error analysis is a physical diagram of the SAN topology. This diagram should be kept up to date, and include all hosts, switches, directors, and storage devices within the SAN. This document can save countless hours of reconstructing the original picture by piecing together log information.

AIX

Time difference
Use the date command to display the system date and time.

Log collection
Collect both errpt and errpt -a (each piped to a file).

Hardware configuration collection
Take a snap (the errpt is found in a snap, but it is good to have a separate copy).
The preferred snap for IBM TotalStorage DS Family problems is:

snap -gfiLc where:

g - Gathers the output of the lslpp -hBc command, which collects the exact operating system environment
f - Gathers file system information
i - Gathers installation debug vital product data (VPD) information
L - Gathers LVM information
c - Creates a compressed pax image (snap.pax.Z file)


Multi-pathing data collection
SDD (all versions of AIX)
Issue the following commands and capture the output. This data is not found in a snap. Preferably provide the output of these commands during the failure.

datapath query adapter
datapath query device
lsvpcfg


MPIO (available on AIX 5.2 and above)
Issue the following commands and capture the output. This data is not included in a snap.

pcmpath query adapter
pcmpath query device
pcmpath query essmap


HP-UX

Time difference
Use the date command to get the system date and time.

Log collection
Collect the contents of the /var/adm/syslog/syslog.log file.

Hardware configuration collection
Provide the following server details for each server involved with the SAN:

Manufacturer
Machine Type/Model Number
Feature details, for example, number of CPUs, amount of memory


HBA details
For SAN problems we always need the following details about the FC HBAs:

Hardware manufacturer, brand and model
BIOS (firmware) level - BIOS settings if QLogic
Driver level


Software configuration collection
Capture the output of the uname -a command

Multi-pathing data collection
SDD
Issue the following commands and capture the output. Preferably provide the output of these commands during the failure.

datapath query adapter
datapath query device


Linux

Time difference
Use the date command to get the system date and time.

Log collection
Capture the contents of /var/log/messages
Capture the output of the dmesg command

Hardware configuration collection
For IBM xSeries hardware, the best way to collect configuration data is by using the e-gatherer tool. Make sure you also supply the HBA details. You can download e-gatherer from:




Software configuration collection
Capture the output of the command: uname -a

If you are running Redhat, install and run sysreport and send the output.

Multi-pathing Data Collection
SDD
Issue the following commands and capture the output. Preferably provide the output of these commands during the failure.

datapath query adapter
datapath query device


Microsoft Windows

Time difference
Display the system date and time using the clock in the bottom right hand corner, or by issuing the time and date commands at a command prompt.

Log collection
Always save the system logs and the application logs as soon as possible after the event.
Do not export and provide the logs in EVT format, it is not helpful.
To find the system logs, either right click My computer then Manage or click:

Start -> Programs -> Administrative Tools -> Computer Management
When this opens, go to:
System Tools -> Event Viewer -> System
And then:
Action -> Save Log file as changing the save as type to CSV
Repeat for Application logs.


Hardware configuration collection
For IBM xSeries hardware, the best way to collect configuration data is by using the e-gatherer tool. Make sure you also supply the HBA details. You can download e-gatherer from:




Software configuration data collection
If you cannot take the e-gatherer data provide:

Operating System
Service Pack Level


Multi-pathing data collection

SDD
If you are running SDD, issue the following commands and capture the output.

datapath query adapter
datapath query device


Novell Netware

Time difference
Display the system date and time.

Log collection
CONLOG.EXE is a utility which writes all system console messages to a .LOG file.
More details can be found at url:




Hardware configuration collection
There is no e-gatherer for Netware.

Software configuration data collection
Provide:

Operating System Level
State whether this is a clustered system


Multi-pathing data collection

SDD
If you are running SDD, issue the following commands and capture the output.

datapath query adapter
datapath query device


SUN Solaris

Time difference
Use the date command to get the system date and time.

Log collection
Save the /var/adm/messages file. Previous days messages are normally available as /var/adm/messagesx where x is the number of days since the logs rolled.

Hardware configuration collection
There is no e-gatherer or snap command to collect these details, so a good description of the hardware including the following is required:

Software configuration data collection
Provide :

Operating System details.
A copy of your sd.conf file
Output from iostat -El


Depending on the HBA there will be a /kernel/drv/*.conf where the * could be QLogic or JNI.

Multi-pathing data collection

SDD
Issue the following commands and capture the output.

datapath query adapter
datapath query device


Veritas Volume Manager DMP
Provide the output from the following commands:

ls -lL /dev/rdsk/*
ls -la /dev/vx/dmp/*
format


**Contributed by shah_mr

Sunday, June 15, 2008

Migrate filesystem on any UNIX platform

# cd /"source directory/filesystem"
# tar cfp - ./* |(cd /"target directory/FS"; tar xvfp -)

Thursday, May 15, 2008

Command to perform immediate ufsdump

E.g.:
ufsdump 0f - / | gzip -f -1 - > root.dump.gz

Tuesday, March 11, 2008

synclvodm - synchronising your logical volume manager in IBM AIX


Description

If you have problems with LVM because it is out of sync with the ODM in IBM AIX, you may see the following errors:

0516-306 getlvodm: Unable to find hd7copie in the Device
Configuration Database.
0516-912 rmlv: Unable to remove logical volume hd7copie.

To correct this, you must sync the ODM:

Before correction:

# lsvg -l rootvg
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
...
hd7copie ??? 8 8 1 closed/syncd N/A

Run the sync command:

# synclvodm -v rootvg
synclvodm: Physical volume data updated.
synclvodm: Logical volume hd5 updated.
synclvodm: Logical volume hd6 updated.
synclvodm: Logical volume hd8 updated.
synclvodm: Logical volume hd4 updated.
synclvodm: Logical volume hd2 updated.
synclvodm: Logical volume hd9var updated.
synclvodm: Logical volume hd3 updated.
synclvodm: Logical volume hd1 updated.
synclvodm: Logical volume hd7 updated.
synclvodm: Logical volume hd7copie updated.
synclvodm: Logical volume rootvglv01 updated.

After the sync command completes:

# lsvg -l rootvg
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
...
hd7copie dump 8 8 1 open/syncd N/A
Example

synclvodm -v vg_name