Announcement

Collapse
No announcement yet.

Is there a way too force hardware to fail, instead of interminable retries?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [Hardware] Is there a way too force hardware to fail, instead of interminable retries?

    I've been recovering mostly pictures from old CD-ROMs, using an old (about twenty years) DVD drive.

    My problem is that when CDs can't be read, the device keeps retrying, and the only way to stop it is to shutdown. Even a reboot can fail to stop the drive retrying endlessly.

    Is there a way to force an error on the device? The shutdown sequence does so.
    Regards, John Little

    #2
    Maybe?

    AI Overview

    To force-stop a Linux kernel or user process from continuously trying to read a bad or stuck CD-ROM without rebooting, unmount the filesystem, kill the blocking process, and delete the device node from the SCSI/kernel layer if necessary.

    Immediate Steps to Stop Reads
    • Find the active process: Run sudo fuser -v /dev/sr0 or sudo lsof /dev/sr0 to see what program or mount point is locked onto the disc.
    • Kill the process: Terminate the stuck application using sudo kill -9 <PID>. If the process is stuck in an uninterruptible D state waiting for hardware I/O, killing it directly won't work until the device interaction clears.
    • Force unmount: Run sudo umount -f /dev/sr0 or use sudo eject -m /dev/sr0 to override a busy flag and spin down the tray.

    Disabling the Optical Drive Subsystem

    If the kernel keeps polling or hanging on the damaged disc media, you can detach the device dynamically from the SCSI subsystem:
    • Delete the SCSI device: Run echo 1 | sudo tee /sys/block/sr0/device/delete to safely remove the device interface from the running kernel without a reboot.
    • Rescan to restore later: Once you clear or eject the media physically (using a paperclip in the emergency eject hole if the tray won't open), you can rescan the host bus to bring the optical drive back: bash


      echo "- - -" | sudo tee /sys/class/scsi_host/host0/scan


      (Note: Replace host0 with your actual SCSI host number found under /sys/class/scsi_host/).



















    Windows no longer obstruct my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      I've had the same issue issue, but my DVD is a USB model so I can unplug it.

      I don't suppose your drive has a physical eject hole? My has one - it's about right size to insert a straightened paperclip into. This forces the tray to open. Sometimes, I have to grab it and physically pull it open all the way. This seems to kill the process and hasn't appeared to damage the drive. I suppose you could strip plastic gears that way.

      Other than that, I assume you've tried force killing the process?

      Please Read Me

      Comment


        #4
        Originally posted by Snowhog View Post
        ... kill the blocking process...
        That generally did not work, some process, often a kioworker process, is
        stuck in an uninterruptible D state waiting for hardware I/O, killing it directly won't work until the device interaction clears.
        Run sudo umount -f /dev/sr0 or use sudo eject -m /dev/sr0 to override a busy flag and spin down the tray.

        sudo umount -f
        said
        umount: /mnt/sr0: target is busy.

        but sudo eject -m does the trick, ejecting not instantly but within 20 s or so, and the stuck processes get errors nicely.

        Thank you.
        Regards, John Little

        Comment


          #5
          Originally posted by oshunluvr View Post
          I don't suppose your drive has a physical eject hole?
          It does, but seems to require more force than I've been willing to apply.

          Regards, John Little

          Comment

          Users Viewing This Topic

          Collapse

          There are 0 users viewing this topic.

          Working...
          X