LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   detecting cd drives (https://www.linuxquestions.org/questions/linux-newbie-8/detecting-cd-drives-484581/)

cmur8594 09-18-2006 05:59 AM

detecting cd drives
 
hi

i am writing a program in java that uses the cd drives. i was wondering if there is a command in linux which can tell me if there is more than one cd drive installed and what type it is. Or if anyone knows if there is a java command which will achieve this

thanks

zulfilee 09-20-2006 04:10 AM

Welcome to LQ.

What distibution are you using?

To detect CD drive on the system ,you can try this

Check for directory /proc/ide/hda,hdb,hdc,hdd

If directory present , look for file 'media' inside directory.
Ex:
$ cat /proc/ide/hda/media

This will tell you what type of device that ide is.[It will have cdrom for a Cddrive]

A scan on all four ide`s media files [hda.hdb,hdc,hdd] can find out the number of cddrives in the system.
Also see the 'model' file for the Modelname of the media.

If you need a command to check for media try

$ hdparm -i /dev/hda [or hdb,hdc,hdd ]

This gives information about the ide.


All times are GMT -5. The time now is 02:21 AM.