[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

How to tell if mounted media is CD-R, CD-RW or CD-ROM?



I'm using linux 2.4.

I need to know what kind of media is in a CD/DVD drive from a shell script.

First I use 
	dvd+rw-mediainfo /dev/cdrom
which, if DVD media is in the drive, will tell me what kind (DVD-R, DVD-RAM,
...); if it fails saying that what's in the drive is not a DVD I then use
	cdrecord -atip dev=<devid>
and scan cdrecord output for
	"Is erasable" -> CD-RW
	"Is not erasable" -> CD-R
	no "erasable" string -> CD-ROM

However, recently I found that in some cases cdrecord, maybe due to the
drive not returning all the info it needs, will not print the "erasable"
string even if the media is CD-RW (cdrecord can succesfully burn it).

So, do you know of any definitive method to get the media type?

Thanks
-- 
giulioo@pobox.com



Reply to: