How to find device name for CDROM/DVD in Linux

by Eddy on

In Linux some time it’s tricky to find what’s the device name used for CDROM/DVD drive, on HP ,IBM , DELL or CISCO UCS blades or any other hardware you can run this simple command to find out the device name for the DVD/CD drive. First thing you would need is to¬† connect to machine running Linux OS either using the system console or by connecting to machine using ssh

In the ls output command listed here for /sys/block/*/device , the output clearly shows the disk drivers on systems as /dev/sda and /dev/sdb , the third device is not the disk drive and most likely a DVD and CDROM

[root@safari ~]# ls -l /sys/block/*/device
lrwxrwxrwx. 1 root root 0 Mar 20 06:22 /sys/block/sda/device -> ../../../2:0:0:0
lrwxrwxrwx. 1 root root 0 Mar 20 06:22 /sys/block/sdb/device -> ../../../2:0:1:0
lrwxrwxrwx. 1 root root 0 Mar 20 06:22 /sys/block/sr0/device -> ../../../1:0:0:0

You can further confirm by doing an ls on /dev/sr0 :

[root@safari ~]# ls -l /dev/sr0
brw-rw----+ 1 root cdrom 11, 0 Mar 20 06:22 /dev/sr0

News Tags:

Leave a Comment

Previous post:

Next post: