LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: 0
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
 
Old 09-20-2006, 05:10 AM   #2
zulfilee
Member
 
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.
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.
 
  


Reply


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 06:09 PM
Debian not detecting my hard drives. brynjarh Debian 2 10-21-2004 08:48 PM
Detecting window drives inRedHat9 satish427 Linux - Newbie 2 09-08-2004 05:13 AM
BIOS now not detecting Hard drives thalon Linux - Newbie 10 03-20-2004 12:07 PM
mandrake 9.2 detecting new cdrom drives at startup lynnsbomb Mandriva 5 01-27-2004 09:21 PM


All times are GMT -5. The time now is 10:48 AM.

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