![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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!! |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
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. ??? |
|
#4
|
|||
|
|||
|
You do have the driver, it's just clever enough to work out which.
Add --driver generic-mmc |
|
#5
|
|||
|
|||
|
That did the trick. Thanks!!
|
|||
| Google The UNIX and Linux Forums |