It all started innocently enough. There are a couple of machines that I wanted to play with. One has a trial version of MS Windows 7, and believe me it works well and reliably. And, the other one will not even come up!
I am trying to get my Linux Lab environment back up. Who isn’t these days?
Well once Cent OS is installed, like every other Windows aficionados I started playing around with the GUI and pressed on a wrong button.
Which wrong button, you might ask? Well, the one that states “Safely Remove Drive“.
And, so even though my sure and reliable Memorex DVD Double Layer is still attached, it is no longer visible, as confirmed in the screen shot below:
So how do we get the CD/DVD Back?
List CD / DVD
I tried listing devices, grepping on cdrom
ls -la /dev | grep cdrom
From the output above, our CDs and DVDs are:
Ejected the CD, hoping placing a new one in will result in the OS now seeing it.
sudo eject /dev/ [filename]
sudo eject /dev/cdrom1
List Attached Hardware Devices
Use dmesg to list hardware devices that Kernel recognizes.
In this case, list SCSI related info
dmesg | grep -i SCSI
In this case, list usb related info
dmesg | grep -i usb
Hoping to remount it, using mount … But when I tried to do so, did not get anywhere.
mkdir /mnt/DVD mount -r -t iso9660 /dev/sr1 /mnt/DVD
mount: special device /dev/sr1 does not exist
Reset USB Devices
The one thing that worked, is the one posted by Tamás Tapsonyi
How do I reset a USB Device without unplugging it in linux
# Original by Tamás Tapsonyi # Slightly modified by Daniel Adeniji # resetting USB ports # http://askubuntu.com/questions/645/how-do-you-reset-a-usb-device-from-the-command-line/290519#290519 #http://stackoverflow.com/questions/59838/how-to-check-if-a-directory-exists-in-a-shell-script # if Folder exists /sys/bus/pci/drivers/ehci_hcd/ # resetting USB2 ports if [ -d "/sys/bus/pci/drivers/ehci_hcd/" ]; then echo "Resetting USB2 Ports ..." for i in $(ls /sys/bus/pci/drivers/ehci_hcd/|grep 🙂 do echo $i >/sys/bus/pci/drivers/ehci_hcd/unbind echo $i >/sys/bus/pci/drivers/ehci_hcd/bind done echo "Completed resetting USB2 Ports" else echo "Skipped USB2 Ports" fi # if Folder exists /sys/bus/pci/drivers/xhci_hcd/ if [ -d "/sys/bus/pci/drivers/xhci_hcd/" ]; then echo "Resetting USB3 Ports ..." for i in $(ls /sys/bus/pci/drivers/xhci_hcd/|grep 🙂 do echo $i >/sys/bus/pci/drivers/xhci_hcd/unbind echo $i >/sys/bus/pci/drivers/xhci_hcd/bind done echo "Completed resetting USB3 Ports" else echo "Skipped USB3 Ports" fi
Our CD/DVD now shows up on the GUI and we can also query /var/log/dmesg and see that it is registered as sr1
cat /var/log/dmesg | egrep '(CD|DVD)'
Of course, you can always unplug/re-plug in the USB Device or restart the device if it has its own power switch.
References – CD / DVD
- Debian.Org – CD /DVD
References – CD/DVD Eject
- Eject CD or DVD Media with shell command
References – dmesg
References – USB Device Reset
- How do I reset an USB device without unplugging it in Linux
References – VLC
- Install VLC Media Player in rhel – centos – 22.214.171.124