The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-29-2004
Registered User
 

Join Date: Sep 2002
Posts: 67
cd-r vs. cd-rw question

I'm trying to put together a script that will burn some data to a cd....is there a way to tell from the command line whether the cd in the drive is a cd-r or a cd-rw? I'd like to blank the cd 1st if it's a cd-rw, but I want to automate this instead of asking for user input.

Thanks!!
Reply With Quote
Forum Sponsor
  #2  
Old 07-29-2004
Tux Tux is offline
Registered User
 

Join Date: May 2003
Location: UK, Up North
Posts: 113
eg.

cdrdao disk-info --device ATAPI:1,0,0 2>/dev/null | grep RW| cut -d':' -f 2|tr -d ' '

This pipe would spit out 'yes' is a CD-RW was present and 'no' if you had a CD-R. You just need to modify the cdrdao bit so that it is pointing to the correct SCSI or ATAPI device on your machine. Based on the output of this you can get your script to do the nessesary actions.
Reply With Quote
  #3  
Old 07-29-2004
Registered User
 

Join Date: Sep 2002
Posts: 67
OK...the following command:

cdrdao disk-info --device 0,6,0


gave me the following error output:

Cdrdao version 1.1.3 - (C) Andreas Mueller <mueller@daneb.ping.de>
SCSI interface library - (C) Joerg Schilling
L-EC encoding library - (C) Heiko Eissfeldt
Paranoia DAE library - (C) Monty

0,6,0: SONY CD-RW CRX145S Rev: 1.0b
ERROR: No driver found for 'SONY CD-RW CRX145S', available drivers:
cdd2600
generic-mmc
generic-mmc-raw
plextor
plextor-scan
ricoh-mp6200
sony-cdu920
sony-cdu948
taiyo-yuden
teac-cdr55
yamaha-cdr10x
ERROR: Cannot setup device 0,6,0.


I use "cdrecord" to write the cd's so I don't know why there's an error about missing drivers. ???
Reply With Quote
  #4  
Old 07-29-2004
Tux Tux is offline
Registered User
 

Join Date: May 2003
Location: UK, Up North
Posts: 113
You do have the driver, it's just clever enough to work out which.
Add --driver generic-mmc
Reply With Quote
  #5  
Old 07-29-2004
Registered User
 

Join Date: Sep 2002
Posts: 67
That did the trick. Thanks!!
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 02:53 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0