Page 1 of 1

Dealing with flaky optical drives on Linux.

Posted: Sat Jul 16, 2011 3:38 am
by linguofreak
I've got a DVD (or DVD drive, or both, I'm not sure which) that's a bit flaky, and it will sometimes take ejecting and reinserting the disk half a dozen times before it's presence is even detected. I've gotten tired of this and am looking for some way to automate the process, but after much Googling and man-ing and apropos-ing haven't had much success.

If my machine were a desktop with a fully motorized CD tray, it appears that putting:

Code: Select all

eject && eject -t
in a while loop in a shell script would do the trick, but unfortunately my CD drive can't retract the tray on its own.

Is there anything, short of physically opening and closing the drive, that will force the system to check for the presence of a disk again? My first instinct was to try mount, but that just returns "mount: no medium found on /dev/sr0". Somebody on another forum suggested

Code: Select all

blockdev -rereadpt
but that also returns "no medium found". They also suggested removing and reinserting the kernel module, but I have optical drive support compiled in directly, so I haven't tried that yet.

Can it be done with existing utilities, or will I have to whip something up in C?

Re: Dealing with flaky optical drives on Linux.

Posted: Sat Jul 16, 2011 3:58 am
by Brendan
Hi,
linguofreak wrote:Can it be done with existing utilities, or will I have to whip something up in C?
You can fix it with a screwdriver and less than $50 of cash. That's the quickest, easiest and most effective option.


Cheers,

Brendan

Re: Dealing with flaky optical drives on Linux.

Posted: Sat Jul 16, 2011 4:28 am
by bluemoon
linguofreak wrote:Can it be done with existing utilities, or will I have to whip something up in C?
There may be dust on the tray sensor, or the drive circuit is simply faults.
But any reason to mess with hacks solution but not just buy a replacement drive?
Oh wait, do you really need to fix something you may never use?
(I never needed that drive, and unplugged it to save power, most OS can be installed even with usb stick/disk, the only use case would be to hold my coffee mug :mrgreen: )

Re: Dealing with flaky optical drives on Linux.

Posted: Sat Jul 16, 2011 1:39 pm
by linguofreak
bluemoon wrote:
linguofreak wrote:Can it be done with existing utilities, or will I have to whip something up in C?
There may be dust on the tray sensor, or the drive circuit is simply faults.
But any reason to mess with hacks solution but not just buy a replacement drive?
Oh wait, do you really need to fix something you may never use?
(I never needed that drive, and unplugged it to save power, most OS can be installed even with usb stick/disk, the only use case would be to hold my coffee mug :mrgreen: )
I said "flaky drives" in the subject line, but as I mentioned in the OP it may very well be a flaky disk, and it's one that I use fairly often. (Believe it or not, there are actually a few proprietary games for Linux that require a CD to run). I suppose the sensible thing to do would be to buy a case of DVD blanks and make a copy of the disk.