LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-28-2003, 10:14 AM   #1
cosiek
LQ Newbie
 
Registered: Aug 2003
Location: Poland
Distribution: COLD Linux
Posts: 28

Rep: Reputation: 15
[Shell Script] Detecting CDROM drives


I need a bash/sh shell script that will detect every cdrom drive in a system, not just only the first one it finds. Should provide the make and model of all drives and save the data in a easy-to-read-by-scripts place. A similar script is in the Devil Linux CD-distro, but it only detects the first drive it finds. Does anyone have something like this?
 
Old 09-28-2003, 10:38 AM   #2
eric.r.turner
Member
 
Registered: Aug 2003
Location: Planet Earth
Distribution: Linux Mint
Posts: 216

Rep: Reputation: 31
Could you get that info from dmesg? Maybe something like:

Code:
dmesg | grep -i ".*:.*rom" > cdroms.txt
 
Old 09-28-2003, 02:57 PM   #3
kolargol
Member
 
Registered: Jan 2003
Posts: 56

Rep: Reputation: 3
for ide devices

have a look in /proc/ide directory
for each ide device connected there is a directory created(hda,hdb...)
the file named media in each of those directory tells you
the type of device it is (disk, cdrom)
other files in the directory gives other info on the device

you should be able to find what you want in there

Last edited by kolargol; 09-28-2003 at 03:01 PM.
 
  


Reply



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
Detecting window drives inRedHat9 satish427 Linux - Newbie 2 09-08-2004 04:13 AM
Give user permission to mount/use cdrom drives or usb drives zwyrbla Linux - Newbie 2 08-23-2004 04:30 PM
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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:32 PM.

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
Open Source Consulting | Domain Registration