![](https://seccdn.libravatar.org/avatar/41ed85ec60b719fa1654d12375dd9bd6.jpg?s=120&d=mm&r=g)
On Fri, 2005-03-11 at 18:09, Paul W. Abrahams wrote:
I've written a small shell script for doing backup that uses mkisofs and cdrecord. I haven't been able to construct the script as a pipe because cdrecord, it seems, needs to know the length of the track it's writing (for a DVD, at least). So if there's no DVD in the drive, mkisofs will spend some time creating an image and then cdrecord will bomb out.
I'm looking for a command-line method of testing if a drive has a blank DVD in it. I can check if the drive is mounted using a combination of "mount" and "grep", but you can mount a drive even if there's no media in it, and that method doesn't distinguish between a blank DVD in the drive (good) and no DVD in the drive (bad). As far as I can tell, cdrecord itself has no way of testing for the presence of a blank DVD without actually attempting to write it.
So does anyone know a command that I can put into a shell-script test to see if the drive does or does not have a blank DVD?
Paul
A quick check of cdrecord --help shows a couple of options -atip is one for retrieving info from the disk. As I recall there is a way to retrieve the disk and manufacturer info from a blank. You could use that to test whether a disk is in the drive. -- Ken Schneider UNIX since 1989, linux since 1994, SuSE since 1998 * Only reply to the list please* "The day Microsoft makes something that doesn't suck is probably the day they start making vacuum cleaners." -Ernst Jan Plugge