Link to home
Start Free TrialLog in
Avatar of jituj
jituj

asked on

how to find a device in solaris 2.6?

I have a problem in solaris 2.6 . I have to check whether a device and a media associated with that device exist in the system. I have to check for CD-ROM, floppy, Tape, Raid, N/W card. We have tried using Volmgt_xxx() but they are working well for floppy. For others what should I do????
Avatar of khaled022498
khaled022498

i think the best command to use is ( prtconf ), the output from this command can be filtered to match your needs ( by using grep), this command will give you all the attached drivers which is loaded and the unloaded drivers.

i hope it helps you.

Avatar of jituj

ASKER

Hi Khaled,
    We are already using this command but it gives the node and the instance of the device. I want to correlate this data with the device name. Well the purpose of asking the question is when I run my application in any other machine I am supposed to detect all the devices connected to the system and their names.
    For this it will of great help if I could get the names of the devices. Currently with the command I am unable to get the name of the device. I also want to have more info. Thanks for the help. Can you provide me more help????
    Out of interest I am asking "Is there any possibility of getting the size of the hard disk from the system without actually performing a read operation?"
Avatar of jituj

ASKER

Hi Khaled,
    We are already using this command but it gives the node and the instance of the device. I want to correlate this data with the device name. Well the purpose of asking the question is when I run my application in any other machine I am supposed to detect all the devices connected to the system and their names.
    For this it will of great help if I could get the names of the devices. Currently with the command I am unable to get the name of the device. I also want to have more info. Thanks for the help. Can you provide me more help????
    Out of interest I am asking "Is there any possibility of getting the size of the hard disk from the system without actually performing a read operation?"
Hi Jituj,

look at the command dmesg it shows you several messages at boot time, so you can grep for Disk, NIC, RAID, Tape,CPU, MEM and whatever you want.

regards

GB
Avatar of jituj

ASKER

Hi Brauner,
    The command is helpful to me. What exactly I am looking for is a system call that can directly give me the answer. In the case of "dmesg" i will have to redirect the output of the command to a file and then parse it. It will take time as well as put more load on the system. I want to reduce this.
    Moreover the command does not give me full information about all the devices in the system. It give the info of CDROM, memory, cpu, N/W card. It does not give the info about floppy and hard disk, RAID, tape.
   Please can u give me more info.
Bye,
 Jitu.
Hi Jituj,

the dmesg command gives you info about hard disk, RAID, tape also.
It depends on your special driver for that, so for the AMI megaraid the drivers calls mega.
If you want special info try the modinfo command.
As far as I know this commands are the only commands to look at your  drivers.
regards
GB
Avatar of jituj

ASKER

Hi Brauner,
    I will reject this answer now as giving an answer will block other users from entering there views and comments. I actually am looking for some system call and not commands. If i don't get any more comments then i will evaluate your answer.
regards,
   jituj
ASKER CERTIFIED SOLUTION
Avatar of sunfire
sunfire

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial