I need to / want to write ISO’s to CD’s from my Linux server, but since I don’t have an X-Manager like Gnome or KDE running, I need to find a way to write the CD’s from the command line with SSH. Luckely the server is right next to me, and it’s got a CDRW drive. It’s an old 24 speed Samsung CDRW, but that’s fine, it can still do the job well. The only tool I could find that was already installed on my SME 7.3 server (which is based on CentOS 4.6), is cdrecord cdrecord is a command line utility that can write CD’s, erase rewritable (CDRW) cd’s and write DVD’s as well. I’m not going to go into too much about cdrecord, but will outline some basics on how to write a CD from Linux’s commandline. Let’s get started….. First, we need to see where our cdwriter is in the system, with the following command: [shell] cdrecord -scanbus [/shell] This command will scan your PC for CD witers & DVD writers, and tell you on which bus they are. The output could look like this: [/php] scsidev: ‘ATA’ devname: ‘ATA’ scsibus: -2 target: -2 lun: -2 Linux sg driver version: 3.5.27 Using libscg version ’schily-0.8′. cdrecord: Warning: using inofficial libscg transport code version (schily – Red Hat-scsi-linux-sg.c-1.83-RH ‘@(#)scsi-linux-sg.c 1.83 04/05/20 Copyright 1997 J. Schilling’). scsibus0: 0,0,0 0) * 0,1,0 1) ‘SAMSUNG ‘ ‘CD-R/RW SW-224B ‘ ‘R205′ Removable CD-ROM 0,2,0 2) * 0,3,0 3) * 0,4,0 4) * 0,5,0 5) * 0,6,0 6) * 0,7,0 7) * [/php] From this, I can see that my Samsung CD writer is on bus 0, with SCSI id 1 and LUN 0. We’ll need this info later to tell cdrecord which writer to use. If you have more than 1 writer, you’ll need to choose the one with the disk in it. So, to write a CD, I use the following commands: [php] cdrecord -v -dao -speed=24 -eject dev=ATA:0,1,0 centos51.iso [/shell] This will write the file, centos51.iso (for example) to the CD writer at a speed of 24x and then eject it once it’s done. How do I write to a rewritable CD that already has some data on it? Easy. With the blank=fast option
[php] cdrecord blank=fast -v -dao -speed=24 -eject dev=ATA:0,1,0 centos51.iso [/php] And that’s it. If you need to know more about cdrecord, or want todo more advanced stuff, then you could either visit the cdrecord documents page, or you could just check the help options, with cdrecord -h