Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux? |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
08-15-2005, 06:43 AM
|
#1
|
Member
Registered: Jun 2002
Location: Nova Scotia
Distribution: Debian (home), Kubuntu 7.04 (work)
Posts: 265
Rep:
|
Disabling CD-ROM drive eject button
When a CD is mounted, the eject button on the CD-ROM drive is disabled (usually). Which is nice (or not, according to personal taste). So...
Q: How can I disable the eject button on my CD-ROM drive when there's NO disc in the drive?
The first person to come up with a simple software solution gets to smack my head and say "Doh!"
|
|
|
08-15-2005, 08:16 PM
|
#2
|
Senior Member
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794
Rep:
|
There are several possibilities:
* have the optical device mount via fstab and restrict umount to root
* rename, remove, or restrict to root the "eject" command
* some optical drives have a jumper which prevent ejection of media
* remove the eject switch from the drive itself
None of these methods will prevent ejection by a paperclip. To prevent that put a plastic or steel plate in front of the drive in question.
|
|
|
08-16-2005, 04:11 AM
|
#3
|
Member
Registered: Jun 2002
Location: Nova Scotia
Distribution: Debian (home), Kubuntu 7.04 (work)
Posts: 265
Original Poster
Rep:
|
Well, I was thinking that since Linux can disable the eject button when a CD is mounted, the availability of the eject button must be under software control.
I've tried a few utilities (such as setcd and cdctrl) with no luck. Next on the list is cdctl, whose --lockdoor option looks promising...
|
|
|
08-16-2005, 11:07 PM
|
#4
|
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211
Rep: 
|
KimVette:
* have the optical device mount via fstab and restrict umount to root
as you know: you cannot mount an optical drive, only a file system on the optical media inserted into the drive. This suggestion will prevent removal of media - but the question asks for disabling the eject button when there is no media present.
* rename, remove, or restrict to root the "eject" command
this will prevent soft ejection - but the eject button will still work
* some optical drives have a jumper which prevent ejection of media
this is hardware control of the eject button for security purposes. This would dsable the eject button while still allowing eject from software - nice but a software locking was wanted. (This may actually acheive the original aim though...)
* remove the eject switch from the drive itself
I think I'd be interested in how the various apps disable the eject button.
If a fs is mounted, then the eject button don't work - presumably it is possible to do this without mounting. So - how does mount disable/lock the cd-drive hard eject?
|
|
|
08-17-2005, 08:18 PM
|
#5
|
Senior Member
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794
Rep:
|
Quote:
Originally posted by Simon Bridge
as you know: you cannot mount an optical drive, only a file system on the optical media inserted into the drive. This suggestion will prevent removal of media - but the question asks for disabling the eject button when there is no media present.
|
There's always a semantics-nazi isn't there. . .
Quote:
* rename, remove, or restrict to root the "eject" command
this will prevent soft ejection - but the eject button will still work
|
Not if the filesystem is mounted (well, automounting aside)
Quote:
* some optical drives have a jumper which prevent ejection of media
this is hardware control of the eject button for security purposes. This would dsable the eject button while still allowing eject from software - nice but a software locking was wanted. (This may actually acheive the original aim though...)
|
Again: chmod, etc.
|
|
|
08-18-2005, 04:04 AM
|
#6
|
Member
Registered: Jun 2002
Location: Nova Scotia
Distribution: Debian (home), Kubuntu 7.04 (work)
Posts: 265
Original Poster
Rep:
|
Quote:
Originally posted by Simon Bridge
I think I'd be interested in how the various apps disable the eject button.
|
I can now report that cdctl's --lockdoor option works, i.e. it locks the eject button even when no CD is present (and therefore no filesystem is mounted). Download the source code and take a look!
Quote:
If a fs is mounted, then the eject button don't work - presumably it is possible to do this without mounting. So - how does mount disable/lock the cd-drive hard eject?
|
setcd can (supposedly) do the opposite and enable the eject button even when a CD is mounted. Could be useful for ex-Windows users. 
|
|
|
08-18-2005, 04:14 AM
|
#7
|
Senior Member
Registered: Oct 2004
Posts: 1,272
Rep: 
|
It doesn't prevent people opening the door with the override - that little hole you stick a paperclip down
|
|
|
08-18-2005, 04:15 AM
|
#8
|
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211
Rep: 
|
Quote:
from KimVette
There's always a semantics-nazi isn't there. . .
|
 There is a final solution for poor semantics ... just a quick shower? :>
... but there were two parts to that - which is to point out that original question...
Quote:
from nobber
Q: How can I disable the eject button on my CD-ROM drive when there's NO disc in the drive?
|
... specified that no CD-ROM be present.  but the proposed solution required a CD-ROM to be present. A newbie coming upon this thread may not spot this since you specified mounting the "drive" where nobber specified mounting the "CD".
The last of your suggestions would actually have had the desired effect though. So this would be a neat workaround for someone who wanted to be security conscious.
I do find it difficult to think of some circumstance where a software solution would be better than this ... (say if you wanted to be able turn the lock on and off without a soldering iron? But why? The only circumstances I can think of are already taken care of?). There is always the never-ending quest for abstract knowledge of course - and it is desirable to understand ones machines lest they take over... they're multiplying you know... they are getting smarter... we must keep an eye on them... bad semantics is the first sign of impending moral collapse into the machine state!!!!! <gibber>
OK I'm better now.
I suppose the secret would be to set the drive status to "busy" - this would lock the drawer regardless of the content of the drive (as if a filesystem on media were mounted, right?)
So - where is the drive status stored? How would one go about changing drive status from within, say, a bash shell or a perl script?
Last edited by Simon Bridge; 08-18-2005 at 04:21 AM.
|
|
|
08-18-2005, 04:26 AM
|
#9
|
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211
Rep: 
|
phil.d.g: surely the only way of disabling that (the override hole) would be to plug it up?
|
|
|
08-18-2005, 04:59 AM
|
#10
|
Senior Member
Registered: Oct 2004
Posts: 1,272
Rep: 
|
yep, my point was a simple software solution is not possible.
I would expect the best thing to do is disable the manual override either by blocking it up or removing the mechanism and use software to disable the button.
Or if you do not need the CD drive and its obvious you don't want others using it, then just whip it out the computer - you don't have to disable something thats not there 
|
|
|
08-18-2005, 08:01 AM
|
#11
|
Member
Registered: Jun 2002
Location: Nova Scotia
Distribution: Debian (home), Kubuntu 7.04 (work)
Posts: 265
Original Poster
Rep:
|
OK, let's clear things up a bit here by explaining my motives for seeking this solution!
My system case rests on the floor, which means buttons not flush with the case are an easy target for my 18-month-old son. Until recently he'd have great fun powering my computer on (and more annoyingly, off) and opening and closing the DVD-ROM drawer - but not any more! A switching power supply and ACPI handling takes care of the power button (unless he keeps it pressed in for several seconds, but there's not much I can do about that), and now cdctl makes the DVD-ROM eject button useless. Hurrah!
Thankfully, my son hasn't yet figured out how to use a paperclip and the little hole. I hope I can trust all present here not to tell him about it...
|
|
|
08-18-2005, 06:56 PM
|
#12
|
Senior Member
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794
Rep:
|
Nobber>
In your case, get an antec or chieftec dragon or supermicro case with a locking door over the external 5.25" bays.
Simon Bridge>
*grin* great reply! 
|
|
|
08-18-2005, 07:15 PM
|
#13
|
Senior Member
Registered: Mar 2005
Location: Las Vegas, NV
Distribution: Mandriva Slackware FreeBSD
Posts: 1,468
Rep:
|
Quote:
Originally posted by KimVette
Nobber>
In your case, get an antec or chieftec dragon or supermicro case with a locking door over the external 5.25" bays.
Simon Bridge>
*grin* great reply!
|
I agree with Kim, There is no software solution for toddlers... I have a 4yr old boy and he has filled my car stereo with peanut shell... I am teaching him to be respectfull or our CDROMS and DVD's but It's a hit a miss prop...
I agree... Just lock it out and make it unavailble... That is your only option... Kids will find a way...
KC
|
|
|
08-19-2005, 05:45 PM
|
#14
|
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211
Rep: 
|
Hah! My box is behind a playpen-side out of reach. I'm luck tho - little Corwin (2.33) has learned to "be gentle" 
|
|
|
08-20-2005, 04:17 AM
|
#15
|
Member
Registered: Mar 2005
Location: Utah, USA
Distribution: Slackware 11
Posts: 816
Rep:
|
I keep my tower off the floor, so only our notebooks are in (imminent) danger from our 9-month-old. Our older two (7 and 4) have always been surprisingly respectful of our computers.
|
|
|
All times are GMT -5. The time now is 02:57 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|