Dealing with flaky optical drives on Linux.
Posted: Sat Jul 16, 2011 3:38 am
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:
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 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?
If my machine were a desktop with a fully motorized CD tray, it appears that putting:
Code: Select all
eject && eject -t
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
Can it be done with existing utilities, or will I have to whip something up in C?