Command Line CD Burning
Burning CDs from the command line, yes it can be done, and yes its something thats still needed. Well it is for those of us who date from before it was GUI everything, prefer the command line and who are interested in progressing beyond the GUI.
As for me, I burn this way from time to time, especially when working on a Linux box, and I need a quick backup or ISO, its far faster to burn this way than waste time installing a GUI tool. And yes to those who think that all Linux boxes have a GUI, I am talking about ones that don't, for example servers, not a single one I have ever built had a GUI of any kind, its just not needed.
Anyway I digress, back to this page, it covers burning CDs from the command line, using the excellent cdrtools package, which is installed with most common Linux distributions.
Now before moving on, its time to remind you that in order to use this document you need to be happy working outside of the X Windows graphical environment, so that said if you are not aware of the existence of anything other than the GUI, then stop reading now, as this is not for you. On the other hand if you want to learn and understand that you run the risk of going into the coaster production business with write failures, and they are your fault, then read on.
Requirements
Now assuming you have the drive setup right, have all the right drivers, Kernel settings etc. You need to get the actual software that does the burning, which as I said above is the popular cdrecord (part of cdrtools package) app, which can be downloaded from the following link, assuming that is, that you don't already have it.
While on the subject you are recommend to read all the info on this page, which is why the above is not a direct link to the download tarball. The version you want is 1.9 or later.
Installation
Again this is way outside the scope of this HOWTO, but for those interested, building from source could not be easier, its just make followed by make install. As for the various binary distributions, sorry but you are on your own with that one. From here on its assumed that all the tools that are part of the cdrecord 1.9 or later distribution are in your search path.
What version do I have?
If you have just done the install then you will already know this, and so can skip this section. On the other hand if you are using one of the Linux/UNIX distributions that already has it, you need to make sure that you have the 1.9 or later. The quick way to find out what you have is to run the cdrecord tool like this.
cdrecord --version
Now unlike the other examples, the function of --version does not need explaining right?. Anyway this command should give you something like this.
Cdrecord 1.9 (i686-pc-linux-gnu) Copyright (c) 1995-2000 Jorg Schilling
Finding your drive
Before you can start you need to know which SCSI controller/host/lun your burner is. For this you use the cdrecord tool, running it like this.
cdrecord -scanbus
The results of this are as usual dependent on your system, but my box, it gives the following.
Cdrecord 1.9 (i686-pc-linux-gnu) Copyright (c) 1995-2000 Jorg Schilling
Linux sg driver version: 2.1.36
Using libscg version schily-0.1
scsibus0:
0,0,0 0) unknown device type 0x12
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)
scsibus1:
1,0,0 100) "RICOH CD-R/RW MP7060S 1.5" Removable CD-ROM
1,1,0 101) "PIONEER DVD-ROM DVD-303 1.06" Removable CD-ROM
1,2,0 102) "SONY SDT-5000 3.26" Removable Tape
1,3,0 103)
1,4,0 104)
1,5,0 105)
1,6,0 106)
1,7,0 107)
You will see from the above that the burner is device 1,0,0 Yours may be different, all the following examples use the above settings.
Burning full ISO images
This is the most common use for command line burning, so its a good starting point, its also one of the easiest things to do. Yes just as expected, you use the cdrecord tool for this, running it like this.
cdrecord -v dev=1,0,0 speed=6 iso_file_name
The command line parameters used with this example are: -v verbose which lets you see whats happening. dev=1,0,0 as mentioned above, this is the device ID of the writer, bus1 device0 lun=0. speed=6 Yes as expected this is the speed, and again may be different for you. iso_file_name Again just as expected, its the filename for the iso image you are burning
Doing a test burn
The above example does not do any testing to see if all is well with the world before it starts, maybe your systems not fast enough, it could be having a bad day etc. You can with the addition of yet another option on the cdrecord command line perform a dummy burn which is exactly the same as the final burn, its just done with the laser switched off. The following example is the same as the previous one, just with the addition of the switches needed for the dummy burn.
cdrecord -v dev=1,0,0 speed=6 -dummy iso_file_name
Again this is not rocket science, the addition of the -dummy option does the deed and is the only difference between this and the last example.
Blanking CDRW disks
Not something that most people are going to do often, but as its been requested, its worth covering here, so here is how to blank the whole disk. Again its the cdrecord tool that does the job, run it like this.
cdrecord -v dev=1,0,0 speed=4 blank=all
As with all the examples there are several option used here, the first three are already covered in the above section, so to avoid repeating myself and boring you, here's the new one.
blank=all Yes its just like the name suggests, its the blank command. Now its not quite as simple as that, as there are multiple possible options available. With the above example using "all", which means blank all the disk. The other possibles are as follows
|