- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Hex Conversion
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2004 12:20 AM
12-08-2004 12:20 AM
(device 0x1f006000)
Is this in hex?
How do I convert it, I've been out of school for quite a while.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2004 12:27 AM
12-08-2004 12:27 AM
Re: Hex Conversion
vmunix: LVM: Recovered Path (device 0x1f006000) to PV 0 in VG 0.
Dec 8 08:27:19 ihshp4 vmunix: SCSI: Write error -- dev: b 31 0x006000, errno: 126, resid: 1024,
Dec 8 08:27:18 ihshp4 vmunix: LVM: Recovered Path (device 0x1f006000) to PV 0 in VG 0.
Dec 8 08:27:19 ihshp4 vmunix: blkno: 3191299, sectno: 6382598, offset: -1027077120, bcount: 1024.
Dec 8 08:27:18 ihshp4 vmunix: LVM: Restored PV 0 to VG 0.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2004 12:33 AM
12-08-2004 12:33 AM
Re: Hex Conversion
In that case just do:
0*16^0 + 0*16^1 + 0*16^2 + 6*16^3 + 0*16^4 + 0*16^5 + 15*16^6 + 1*16^7
/Oskar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2004 12:43 AM
12-08-2004 12:43 AM
SolutionThe simplest way to know which is associated device
ll /dev/dsk/* | grep 006000
Else, decode it as follows.
1f - printf "%d\n" 0x1f
will give 31
/usr/sbin/lsdev -b 31
Character Block Driver Class
188 31 sdisk disk
This is a disk device
00600
c0t6d0
Hope this helps.
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2004 04:47 AM
12-08-2004 04:47 AM
Re: Hex Conversion
#convert the 8 character hex input string to decimal and output in device name format of c#t#d#
#found this in the HP itrc, usefull for decoding dmesg and syslog error entries
#sample use:
# scsi_decoder a12b3c44
# This translates to c43t3d12
Z=$1 #save input argument to $Z
#translate $Z to all upper case and save in $I
I=`echo $Z|tr '[a-z]' '[A-Z]'`
#get the length of the string in characters and save in $LENGTH_I
LENGTH_I=`echo $I|wc -m`
#if the input string is the correct length
if test "$LENGTH_I" -eq 9
then
#remove the first two characters of $I and save to $A
A=`echo $I|sed s/..//`
#now remove the last 4 characters of $A
#saving only the 3rd and 4th characters into $B
B=`echo $A|sed s/....$//`
#convert hex $B to decimal and save in $C
C=`echo "ibase=16;$B"|bc`
#remove first 4 characters
R=`echo $I|sed s/....//`
#and remove last 3 and save in $S
S=`echo $R|sed s/...$//`
#and convert hex $S to decimal and save in $T
T=`echo "ibase=16;$S"|bc`
#remove first 5 characters
F=`echo $I|sed s/.....//`
#and remove last two characters and save in $G
G=`echo $F|sed s/..$//`
#convert hex $G to decimal and save in $D
D=`echo "ibase=16;$G"|bc`
#send output to user in format of c#t#d#
echo "This translates to c"$C"t"$T"d"$D" "
echo
else
#tell the user if not the correct length
echo "The input string must be exactly 8 bytes. "
fi