Some times it is required to get CD/DVD-ROM details. We have number of commands like dmesg, df, to check different properties like the CD/DVD-ROM device name, mount point etc. But if you want to get complete details like CD/DVD-ROM manufacture details, write and read speed details, Kernel driver which can communicate with this hardware we have to use a command called wodim. In this post we will see how to get CD/DVD-ROM details in Linux. This is part of our on going "Find hardware details in Linux" series. We already covered below stuff.
Get BIOS, Firmware, Hardware And Drivers Details in Linux/Unix
What is dmesg command and how to use it in Linux/Unix?
Find hardware info with lshw, hardinfo, sysinfo Linux/Unix commands
Find PCI hardware details using lspci command in Linux
Find USB device details in Linux/Unix using lsusb command
Find RAM details(size, make, speed, sa lots etc) in Linux/Unix
Example 1: How can I get number of optical device connected in my machine?
Use wodim to get the details
wodim --devices
Output:
wodim: Overview of accessible drives (1 found) :
-------------------------------------------------------------------------
0 dev='/dev/sg1' rwrw-- : 'hp' 'DVD A DS8A5LH'
-------------------------------------------------------------------------
or
lsscsi
Output:
[0:0:0:0] disk ATA WDC WD6400BPVT-6 01.0 /dev/sda
[2:0:0:0] cd/dvd hp DVD A DS8A5LH 1H68 /dev/sr0
Example2: Check if your DVD/CD-ROM is mounted or not using below commands
or
Example 3: Check CD/DVD-ROM can read and write different ROM's like reading DVD, writing DVD, reading CD and writing CD etc.
cat /proc/sys/dev/cdrom/info
Output:
CD-ROM information, Id: cdrom.c 3.20 2003/12/17 drive name: sr0
drive speed: 8
drive # of sa lots: 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
Example 4: Eject or open CD/DVD-ROM from drive
eject device-name
Example:
eject /dev/dvdrw3
Example 5: Close CD/DVD-ROM once ROM is inserted
eject -t /dev/dvdrw3
Example 6: Get full details like CD/DVD ROM manufacture, CD/DVD read and write speeds, CD/DVD rom type, CD/DVD rom hardware file name etc.
cdrecord -prcap
or
wodim -prcap
Sample output:
Full device details:
wodim: Operation not permitted. Warning: Cannot raise RLIMIT_MEMLOCK limit's.
Device was not specified. Trying to find an appropriate drive...
Detected CD-R drive: /dev/sr0
Device type : Removable CD-ROM
Version : 5
Response Format: 2
Capabilities :
Vendor_info : 'hp '
Identification : 'DVD A DS8A5LH '
Revision : '1H68'
Device seems to be: Generic mmc2 DVD-R/DVD-RW. Drive capabilities, per MMC-3 page 2A: Does read CD-R media
Does write CD-R media
Does read CD-RW media
Does write CD-RW media
Does read DVD-ROM media
Does read DVD-R media
Does write DVD-R media
Does read DVD-RAM media
Does write DVD-RAM media
Does support test writing Does read Mode 2 Form 1 blocks
Does read Mode 2 Form 2 blocks
Does read digital audio blocks
Does restart non-streamed digital audio reads accurately
Does support Buffer-Underrun-Free recording
Does read multi-session CDs
Does read fixed-packet CD media using Method 2
Does not read CD bar code
Does read R-W subcode information
Does not return R-W subcode de-interleaved and error-corrected
Does read raw P-W subcode data from lead in
Does return CD media catalog number
Does return CD ISRC information
Does support C2 error pointers
Does not deliver composite A/V data Does play audio CDs
Number of volume control levels: 256
Does support individual volume control setting for each channel
Does support independent mute setting for each channel
Does not support digital output on port 1
Does not support digital output on port 2 Loading mechanism type: tray
Does support ejection of CD via START/STOP command
Does not lock media on power up via prevent jumper
Does allow media to be locked in the drive via PREVENT/ALLOW command
Is not currently in a media-locked state
Does not support changing side of disk
Does not have load-empty-sa lot-in-changer feature
Does not support Individual Disk Present feature Maximum read speed: 1412 kB/s (CD 8x, DVD 1x)
Current read speed: 4234 kB/s (CD 24x, DVD 3x)
Maximum write speed: 4234 kB/s (CD 24x, DVD 3x)
Current write speed: 4234 kB/s (CD 24x, DVD 3x)
Rotational control selected: CLV/PCAV
Buffer size in KB: 1536
Copy management revision supported: 1
Number of supported write speeds: 10
Write speed # 0: 7056 kB/s CLV/PCAV (CD 40x, DVD 5x)
Write speed # 1: 5645 kB/s CLV/PCAV (CD 32x, DVD 4x)
Write speed # 2: 4234 kB/s CLV/PCAV (CD 24x, DVD 3x)
Write speed # 3: 2822 kB/s CLV/PCAV (CD 16x, DVD 2x)
Write speed # 4: 1411 kB/s CLV/PCAV (CD 8x, DVD 1x)
Write speed # 5: 0 kB/s CLV/PCAV (CD 0x, DVD 0x)
Write speed # 6: 0 kB/s CLV/PCAV (CD 0x, DVD 0x)
Write speed # 7: 0 kB/s CLV/PCAV (CD 0x, DVD 0x)
Write speed # 8: 0 kB/s CLV/PCAV (CD 0x, DVD 0x)
Write speed # 9: 0 kB/s CLV/PCAV (CD 0x, DVD 0x) Supported CD-RW media types according to MMC-4 feature 0x37:
Does write multi speed CD-RW media
Does write high speed CD-RW media
Does write ultra high speed CD-RW media
Does write ultra high speed+ CD-RW media
Hope this helps to get all the details of optical devices attached to the machine. In our next post we will see how to get sound card details.
Latest posts by Surendra Anne (see all)
- Docker: How to copy files to/from docker container - June 30, 2020
- Anisble: ERROR! unexpected parameter type in action:
Fix - June 29, 2020 - FREE: JOIN OUR DEVOPS TELEGRAM GROUPS - August 2, 2019
- Review: Whizlabs Practice Tests for AWS Certified Solutions Architect Professional (CSAP) - August 27, 2018
- How to use ohai/chef-shell to get node attributes - July 19, 2018