Operating System - Linux
1827687 Members
3400 Online
109967 Solutions
New Discussion

C/C++/Perl/Shell code to get SCSI Info

 
Arunvijai_4
Honored Contributor

C/C++/Perl/Shell code to get SCSI Info

Hi All,

I need a C/C++/Perl/Shell code to get SCSI disk information such as #cylinders, Tracks/Cylinder, Sectors/Track etc.. Any pointers would be helpful.

Thanks,
Arun
"A ship in the harbor is safe, but that is not what ships are built for"
5 REPLIES 5
H.Merijn Brand (procura
Honored Contributor

Re: C/C++/Perl/Shell code to get SCSI Info

Is diskinfo -v enough?

# diskinfo -v /dev/rdsk/c1t15d0
SCSI describe of /dev/rdsk/c1t15d0:
vendor: HP 73.4G
product id: ATLAS10K3_73_SCA
type: direct access
size: 71687369 Kbytes
bytes per sector: 512
rev level: HP05
blocks per disk: 143374738
ISO version: 0
ECMA version: 0
ANSI version: 2
removable media: no
response format: 2
(Additional inquiry bytes: (32)58 (33)39 (34)32 (35)32 (36)33 (37)5a (38)57 (39)20 (40)20 (41)20 (42)20 (43)51 (44)55 (45)41 (46)4e (47)54 (48)55 (49)4d (50)20 (51)c (52)0 (53)0 (54)0 (55)0 (56)0 (57)0 (58)0 (59)0 (60)0 (61)0 (62)0 (63)0 (64)0 (65)0 (66)0 (67)0 (68)0 (69)0 (70)0 (71)0 (72)0 (73)0 (74)0 (75)0 (76)0 (77)0 (78)0 (79)0 (80)0 (81)0 (82)0 (83)0 (84)0 (85)0 (86)0 (87)0 (88)0 (89)0 (90)0 )


Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Arunvijai_4
Honored Contributor

Re: C/C++/Perl/Shell code to get SCSI Info

Thanks Procura, I was aware of diskinfo. But, i need a piece code to get these details. Developer says, diskinfo is not reliable :( .. I need to prove my point though.

Thanks again,
Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Torsten.
Acclaimed Contributor

Re: C/C++/Perl/Shell code to get SCSI Info

Read this post (last entry) and search the web for e.g. "zone bit recording".

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=989308

You will find that you probably don't want to know this values.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Peter Godron
Honored Contributor

Re: C/C++/Perl/Shell code to get SCSI Info

Arun,
how about using fsdb.
As warning states, should only be used by experienced users.
Torsten.
Acclaimed Contributor

Re: C/C++/Perl/Shell code to get SCSI Info

see also "man disktab" and "more /etc/disktab" and note

"This file is provided for backward compatibility with previous HP-UX releases only. Its use is discouraged"

http://docs.hp.com/en/B2355-60127/disktab.4.html


What result do you expect?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!