[HPADM] SUMMARY: Interpretation of HEX Numbers to CTD Numbers



Please find the attached script Fellow System Admins.

I got a number of responses and thanks to everyone who
reponded in a few minutes. The one attached is a
tailor made script to find the ctd numbers.


Note: forwarded message attached.


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--- Begin Message --- This script was written to do the translation for LBOLT messages but it
looks like you're using the same devices so will probably work for that.
You may be able to find the Windows executable at HP's site if you'd
prefer to use that over the script.

Name the script LBOLTdecoder.sh:

#!/bin/ksh
#
# Script to do LBOLT decodes.
# jlightne 2004-Jul-13 - Original write
# jlightner 2005-Jun-09 - Minor modifications to comments
#
# Usage: LBOLTdecoder <LBOLT number>
# Where: LBOLT number is an 8 digit hex number (or 10 digits if
# 0x prefix is included).
#
# This script is based on assumptions made after reviewing the results
of
# Don Vaughan's Windows executable's output.
#
# Known from Don Vaughan's executable:
# - The LBOLT seen will be in the form 0x12345678 where the numbers
following
# the 0x can be 0-F (1 through 16 hexadecimal).
# - The 0x is not needed for the decode.
#
# Assumptions based on testing done on the binary:
# -The first pair of numbers are the MAJOR number of the disk block
device.
# -The remaining 6 numbers are the MINOR number of the disk device.
# -The first pair of numbers from MINOR define the Controller (c)
number.
# -The third number from MINOR defines the Target (t) number.
# -The fourth number from MINOR defines the Disk (d) number.
# -The remaining numbers have nothing to do with the decode.

# Example: The LBOLT number seen is 0x1f242400.
# 0x = Designates the remaining as hex and is always there.
# 1f = This is the hex for MAJOR of block device. Hex 1f = Decimal 31
# 242400 = MINOR for device in hex.
# 24 = First pair of MINOR in hex. Hex 24 = Decimal 36 <-
Controller number
# 2 = Third number of MINOR in hex. Hex 2 = Decimal 2 <- Target
number
# 4 = Fourth number of MINOR in hex. Hex 4 = Decimal 4 <- Disk
number
#
# Based on above the block device should be MAJOR 31, Minor 0x242400 and
it is
# named /dev/dsk/c36t2d4
# Results of ls -ld /dev/dsk/c36t2d4:
# brw-r----- 1 bin sys 31 0x242400 Jul 8 07:01
/dev/dsk/c36t2d4
# Notice that the MAJOR and MINOR are as predicted.

# Set the input argument as a variable
#
LBOLT=$1
echo LBOLT is $LBOLT

# The number as presented in error messages is usually prepended with 0x
to
# let one know it is a hex number. Don Vaughan's binary requires you to
strip
# out the 0x. This script allows input of the full number.

# To allow script to be used like the binary it also allows for input of
# the number without the 0x. Accordingly a test is needed here to
determinf
# whether the 0x prefix was input. If not add it so the cuts below are
correct.
#
if [ ! `echo $LBOLT |cut -c1-2` = "0x" ]
then LBOLT=0x$LBOLT
fi
echo LBOLT is now $LBOLT

# Based on input and above assumptions define the Controller, Target and
Disk.
# Also convert hex a,b,c,d,e & f to upper case because bc doesn't
understand
# these hex "numbers" unless presented in upper case.
# Hexadecimal to decimal equivalents are: A=10, B=11, C=12, D=13, E=14 &
F=15
#
CNH=`echo $LBOLT |tr "[a-f]" "[A-F]"|cut -c5-6`
CN=`echo "ibase=16\n $CNH " |bc`
TNH=`echo $LBOLT |tr "[a-f]" "[A-F]"|cut -c7-7`
TN=`echo "ibase=16\n $TNH " |bc`
DNH=`echo $LBOLT |tr "[a-f]" "[A-F]"|cut -c8-8`
DN=`echo "ibase=16\n $DNH "|bc`

UNIXDEV=c${CN}t${TN}d${DN}

# Output the results:
# NOTE: The ls command output is ONLY valid if this script executed on
the
# server from which the LBOLT device originally came.
#
echo LBOLT DEV $LBOLT is UNIX DEV $UNIXDEV
ls -l /dev/*dsk/$UNIXDEV


-----Original Message-----
From: hpux-admin-owner@xxxxxxxxxxxxx
[mailto:hpux-admin-owner@xxxxxxxxxxxxx] On Behalf Of Neil Paniraj
Sent: Friday, March 03, 2006 8:19 AM
To: Neil Paniraj; hpux-admin@xxxxxxxxxxxxx
Subject: [HPADM] Interpretation of HEX Numbers to CTD Numbers

Gentlemen:

Could someone tell me how I can intepret the following
Hex numbers to "ctd" numbers. I just want to check
these disks:


AUTOPATH: Warning: Failed to discover the device
0x1f043700. Cause: Device is Busy

AUTOPATH: Warning: Failed to discover the device
0x1f044000. Cause: Device is Busy

AUTOPATH: Warning: Failed to discover the device
0x1f063700. Cause: Device is Busy

AUTOPATH: Warning: Failed to discover the device
0x1f064000. Cause: Device is Busy

NEIL

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

--
---> Please post QUESTIONS and SUMMARIES only!! <---
To subscribe/unsubscribe to this list, contact
majordomo@xxxxxxxxxxxxx
Name: hpux-admin@xxxxxxxxxxxxx Owner:
owner-hpux-admin@xxxxxxxxxxxxx

Archives: ftp.dutchworks.nl:/pub/digests/hpux-admin (FTP, browse
only)
http://www.dutchworks.nl/htbin/hpsysadmin (Web, browse &
search)


--- End Message ---


Relevant Pages

  • [Summary] puzzle with cold mirror script
    ... puzzle with cold mirror script ... DUMP: Date of last level 0 dump: the epoch ... all the disk information and a listing of the script follows. ... /export/home/chris# format ...
    (SunManagers)
  • Re: to lvm or not to lvm?
    ... A typo in a script can do more harm in 20 ... with disk space. ... As long as it's not possible for a growing partition to take space away from another partition, I can't see how this would do anything but give you more time to react, you run your messed up script that starts pushing the contents of /dev/zero into a text file and eating harddrive space, if your sitting next to the machine you see the HDD lights come on and hear the seeking, if your remote the first clue you get is an email or SMS saying /blah has been automatically grown by 5GB because it was more than 85% full, you can kill your script, delete the text file, reduce the partition again and nothing crashed, if all it had done was email you a message pointing out /blah was running out of space, and /blah was also required by some other vital process that ran out of space and crashed before you could kill the script, you'd wish you had auto growth. ... The LV extending commands were never ...
    (Debian-User)
  • Re: FGC to Grapheus
    ... probable/unsure sign's signifiance from sign's (probable/unsure, ... Phaistos Disk is NOT related in one way or the other to the LinearA/ ... Civilization, Greek yes, but NOT "Mycenaean"... ... "Cultures" (in particular Script) were somewhat different... ...
    (sci.lang)
  • ufsdump/ufsrestore error
    ... I am using ufsdump and ufsrestore in a script to copy one disk to ... Warning: `.' ... missing from directory ./sadm/pkg/SUNWcsr/save ...
    (SunManagers)
  • puzzle with cold mirror script
    ... This is the mirror script from BigAdmin modified just ... DUMP: Date of last level 0 dump: the epoch ... all the disk information and a listing of the script follows. ... /export/home/chris# format ...
    (SunManagers)