Welcome to the most active Linux Forum on the web.
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 07-17-2008, 01:46 AM   #1
Registered: Oct 2007
Posts: 101

Rep: Reputation: 15
Exclamation How to detect CD/DVD in linux

hi all

How can I detect CD/DVD in my drive? Or How can I detect tray open/close?

Thanks & Regards
Old 07-17-2008, 01:58 AM   #2
Senior Member
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
well, mount will tell you if theres nothing in the drive when you try it, if there isnt.
Old 07-17-2008, 01:59 AM   #3
Senior Member
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,629

Rep: Reputation: Disabled
Can you please brief a little bit more about what you need to know?
Also it will help if you mention what distro you are using.
Old 07-17-2008, 02:16 AM   #4
Registered: Oct 2007
Posts: 101

Original Poster
Rep: Reputation: 15

Originally Posted by resetreset View Post
well, mount will tell you if theres nothing in the drive when you try it, if there isnt.
I did it. But problem is that whenever I try to put CD/DVD in tray it will automatically closed because of it continues try to mount the disk. I used "sleep 20" in script to keep stop the tray but it is not the proper solution.

I want to write a script whenever CD/DVD is inserted in rom in detect the CD/DVD and mount that.

with regards

Last edited by kkpal; 07-17-2008 at 02:23 AM.


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
Need help getting Wine to detect dvd-drive SWnerd525 Linux - Hardware 5 07-05-2007 02:09 AM
How can I detect a blank DVD fudam Linux - General 3 08-15-2006 08:23 PM
How to detect CD/DVD drives on Linux nibl Programming 7 08-15-2006 07:36 PM
DVD decrypter can not detect dvd drive through Wine lnthai2002 Linux - Software 2 01-15-2006 08:36 PM
Can't detect DVD-RW drive dualith Linux - Hardware 5 11-30-2004 04:44 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:37 PM.

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