Linux: Find Out The Name Of DVD / CD-ROM / Writer / Blu-ray Device

Posted on in Categories , , last updated May 19, 2014

How do I find out what the name of my CD-ROM or DVD device or Blu-ray device is under Linux operating system without using GUI options?

You can type the following command to see current information about installed and detected CDROM or DVD-writers under Linux operating systems:

[a] The dmesg command can be used to check if given hardware or device was identified correctly by the Linux kernel.

[b] /proc/sys/dev/cdrom/info file name.

[c] lsblk command.

dmesg Command

dmesg command is used to examine the Linux kernel ring buffer i.e. display bootup messages on screen. To find out if cdrom was detected or not, run:
$ dmesg | egrep -i --color 'cdrom|dvd|cd/rw|writer'
Sample outputs:

[    5.437164] sr0: scsi3-mmc drive: 24x/24x writer dvd-ram cd/rw xa/form2 cdda tray
[    5.437307] cdrom: Uniform CD-ROM driver Revision: 3.20

In this output sr0 is my cdrom / dvd reader and writer. You can see more detailed information by typing the following command
$ less /proc/sys/dev/cdrom/info
$ more /proc/sys/dev/cdrom/info
Sample outputs:

CD-ROM information, Id: cdrom.c 3.20 2003/12/17
drive name:		sr0
drive speed:		24
drive # of slots:	1
Can close tray:		1
Can open tray:		1
Can lock tray:		1
Can change speed:	1
Can select disk:	0
Can read multisession:	1
Can read MCN:		1
Reports media changed:	1
Can play audio:		1
Can write CD-R:		1
Can write CD-RW:	1
Can read DVD:		1
Can write DVD-R:	1
Can write DVD-RAM:	1
Can read MRW:		1
Can write MRW:		1
Can write RAM:		1

To see CD-ROM drive characteristics information, enter:
$ cd-drive
Sample outputs:


lsblk command

To list all block devices, enter:
# lsblk
Sample outputs:

sda      8:0    1   558G  0 disk 
├─sda1   8:1    1   307M  0 part /boot
├─sda2   8:2    1   250G  0 part /datasql
├─sda3   8:3    1     6G  0 part [SWAP]
├─sda4   8:4    1     1K  0 part 
└─sda5   8:5    1 301.7G  0 part /
sr0     11:0    1  1024M  0 rom  

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

5 comment

  1. lsscsi – the best tool for drives info etc.
    also lsusb for usb devices

    apt-get install lsscsi lsusb

  2. grep should not be case sensitive. I have my cdrom drive in CAPS

    # dmesg |egrep -i ‘cdrom|dvd|cd/rw|writer’
    hdc: VMware Virtual IDE CDROM Drive, ATAPI CD/DVD-ROM drive

  3. Hi,
    How can we remove many “Profile List Feature” without any other external command ?

    thanks a lot

  4. If the /proc/sys/dev/cdrom/info output shows:
    Can close tray: 1

    What command will close the tray and do any specific packages need to be installed to do so?

Comments are closed.