Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-18-2006, 05:59 AM   #1
LQ Newbie
Registered: Sep 2006
Posts: 3

Rep: Reputation: 0
detecting cd drives


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

Old 09-20-2006, 04:10 AM   #2
Registered: Apr 2004
Location: India
Distribution: Redhat,Fedora
Posts: 430

Rep: Reputation: 39
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.
$ 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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
not detecting hard drives... jnev Debian 9 05-24-2005 05:09 PM
Debian not detecting my hard drives. brynjarh Debian 2 10-21-2004 07:48 PM
Detecting window drives inRedHat9 satish427 Linux - Newbie 2 09-08-2004 04:13 AM
BIOS now not detecting Hard drives thalon Linux - Newbie 10 03-20-2004 11:07 AM
mandrake 9.2 detecting new cdrom drives at startup lynnsbomb Mandriva 5 01-27-2004 08:21 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:30 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration