Under Linux, is there any way to get a yes/no answer to whether or a CD/DVD drive contains a disc which isn't mounted but which can be mounted or written to?


You can use blkid to get the info of a possible mounted block device:


It will output something like:

/dev/sr0: UUID="2013-05-31-23-04-19-00" LABEL="Blah" TYPE="iso9660" PTTYPE="dos"
[root@arch32-vm ~]# echo $?

If empty will output 2.

| improve this answer | |

If there is just one drive, you could call

cdrecord -v -minfo

If there is a medium inside, you get the media information.

If there is no medium inside, you get an error message with no media.

If you have more than one drive, you need to specify the dev= parameter, see man page: http://schilytools.sourceforge.net/man/man1/cdrecord.1.html

| improve this answer | |
  • Is cdrecord standart? – vfbsilva Aug 18 '18 at 5:34
  • My version of wodim (1.1.11) says that -minfo is a bad option. – Matthew Cline Aug 18 '18 at 6:11
  • woidm is a dead fork that is on a state from 2004 and full of wodim-specific bugs, better use the original software. – schily Aug 18 '18 at 6:19
  • cdrecord is available for all platforms, what do you call standard? – schily Aug 18 '18 at 6:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.