You can find out the name of the DVD/CD-ROM/Blu-ray writer device in Linux by using the lsblk
command.
Here’s an example:
lsblk | grep -i "cdrom"
Explanation:
lsblk
is the command that lists all the block devices and their properties.grep -i "cdrom"
filters the output oflsblk
to show only the lines that contain the word “cdrom”. The-i
option makes the search case-insensitive.
The output will show the name of the block device that represents the DVD/CD-ROM/Blu-ray writer. The name is usually something like sr0
or sr1
.
Note: If your system has multiple optical drives, you’ll see multiple lines in the output, one for each drive. You can identify the correct drive based on the size, vendor, and model information displayed by the lsblk
command.