Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am a bit behind the power curve when comes to all the various types of media. So please excuse my ignornace. Aren't CD's (even CD/RW CD's) only write once? I mean even if I could figure out how to write to a CD a second time or delete data from a CD wouldn't the capacity of the CD be diminished.
How can I write to this CD ...
Here's a df -H. It shows that I have a cd mounted. I previously wrote the 2nd volumn of a mkCDrec full backup to it.
bash-2.05b$ ls -l /mnt/cdrom
total 108202
-r--r--r-- 1 root root 0 Jun 29 12:41 CDrec-29.06.2004_2
-r--r--r-- 1 root root 199 Jun 29 12:41 Checksums.md5
-r--r--r-- 1 root root 639265 Jun 29 12:41 hda2._.log.gz
-r--r--r-- 1 root root 110158740 Jun 29 12:41 hda2._.tar.gz
-r--r--r-- 1 root root 0 Jun 29 12:41 LAST_CD
I will attempt to write some more data to this CD. I'll create ISO 9660 filesystem file and
then attempt to write it to the CD with cdrecord.
[root@localhost dogfacemonkey]# mkisofs -o notes.iso -R -A -V NOTES
Using MKCDR000.HTM;1 for NOTES/MKCDREC/mkCDrec_RH9_restore_test.html (mkCDrec_RH9_install.html)
Using MKCDR001.HTM;1 for NOTES/MKCDREC/mkCDrec_RH9_install.html (mkCDrec_RH9_backup.html)
Using MKCDR000.XML;1 for NOTES/MKCDREC/mkCDrec_RH9_restore_test.xml (mkCDrec_RH9_install.xml)
Using MKCDR001.XML;1 for NOTES/MKCDREC/mkCDrec_RH9_install.xml (mkCDrec_RH9_backup.xml)
Total translation table size: 0
Total rockridge attributes bytes: 7860
Total directory bytes: 30720
Path table size(bytes): 214
Max brk space used e024
272 extents written (0 Mb)
[root@localhost dogfacemonkey]# cdrecord -v -eject dev=0,0,0 notes.iso
Cdrecord 2.0 (i686-pc-linux-gnu) Copyright (C) 1995-2002 J?rg Schilling
TOC Type: 1 = CD-ROM
scsidev: '0,0,0'
scsibus: 0 target: 0 lun: 0
Linux sg driver version: 3.1.24
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
bailing out..
It doesn't work. Why?
Maybe I need to "blank" the CD ...
[root@localhost dogfacemonkey]# cdrecord blank=all
Cdrecord 2.0 (i686-pc-linux-gnu) Copyright (C) 1995-2002 J?rg Schilling
scsidev: '1,5,0'
scsibus: 1 target: 5 lun: 0
Linux sg driver version: 3.1.24
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
bailing out..
[root@localhost dogfacemonkey]# cdrecord dev=0,0,0 blank=all
Cdrecord 2.0 (i686-pc-linux-gnu) Copyright (C) 1995-2002 J?rg Schilling
scsidev: '0,0,0'
scsibus: 0 target: 0 lun: 0
Linux sg driver version: 3.1.24
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
Error trying to open /dev/scd0 exclusively ... retrying in 1 second.
bailing out..
Well that didn't work either!
What the story with CD/RW. Is it still a write once world?
A blank CD-R is "write once, read many times", while in contrast a blank CD-RW can be written to multiple times. And No, subsequent overwriting of a CD-RW will not diminish its storage capacity.
In short, if you are interested in being able to erase and rewrite data on a CD, you need to be using a CD-RW. Personally, when it comes to CD-RW's, I think you get what you pay for, and therefore I would advise going with a well known brand (such as TDK, Maxell, etc) rather than a no-name generic brand. -- J.W.
Okay so I overwrite data on a CD-RW. How do I do it?
I think I have a CD-RW drive ....
bash-2.05b$ cdrecord dev=0,0,0 --scanbus
Cdrecord 2.0 (i686-pc-linux-gnu) Copyright (C) 1995-2002 J?rg Schilling
scsidev: '0,0,0'
scsibus: 0 target: 0 lun: 0
Linux sg driver version: 3.1.24
Using libscg version 'schily-0.7'
cdrecord: Warning: using inofficial libscg transport code version (schily - Red Hat-scsi-linux-sg.c-1.75-RH '@(#)scsi-linux-sg.c 1.75 02/10/21 Copyright 1997 J. Schilling').
scsibus0:
0,0,0 0) 'SONY ' 'CD-RW CRX216E ' 'PD01' Removable CD-ROM
0,1,0 1) *
0,2,0 2) *
0,3,0 3) *
0,4,0 4) *
0,5,0 5) *
0,6,0 6) *
0,7,0 7) *
... and my media says "CD-ReWritable" on it. So I should be able to add files to the CD right? If so how do I do that? Can I use cdrecord? Can I add ISO 9660 filesystem files to the CD?
Distribution: LFS 5.0, building 6.3, win98se, multiboot
Posts: 288
Rep:
Just to clarify. With CD-RW media, you record it like you would a cd-r until it gets full. Then if in the future you don't need the data, you erase the _entire_ disk. Return it to the original blank state. I don't know how you do that on the command though I'm sure it's possible. Most gui cd burning software has an erase util.
With cd-r's dirt cheap in bulk, I don't see the point myself. But in theory you can save money.
According to your system listing, Yes, you've got a Sony CD-RW, so you should be able to do this pretty easily. And just to add one comment to what synapse posted: naturally the speed parameter and device name may need to be adjusted to fit your specific machine. -- J.W.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.