Grabar CD/DVD en Consola con Mkisofs y Cdrecord

Este pequeño tutorial fue probado en CentOS 5 pero funciona para cualquier versión de Linux, al final la consola es igual para todos.

Para quemar en consola, necesitamos contar con una quemadora de CD/DVD, Bastantes CD/DVD donde quemar, lo que queremos quemar y los siguiente programas que instalamos a continuación.

# yum -y install mkisofs cdrecord

Necesitamos crear una .ISO de lo que deseamos quemar. para esto utilizamos el comando mkisofs

# mkisofs -r -l -o imagen_que_quiero_crear.iso /home/data_que_quiero_quemar

Mas o menos nos saldrá la siguiente información

INFO: UTF-8 character encoding detected by locale settings.
Assuming UTF-8 encoded filenames on source filesystem,
use -input-charset to override.
1.98% done, estimate finish Thu Jul 3 10:28:10 2008
3.96% done, estimate finish Thu Jul 3 10:28:10 2008
5.94% done, estimate finish Thu Jul 3 10:28:10 2008
7.92% done, estimate finish Thu Jul 3 10:28:10 2008
9.89% done, estimate finish Thu Jul 3 10:28:10 2008
11.87% done, estimate finish Thu Jul 3 10:28:10 2008
13.85% done, estimate finish Thu Jul 3 10:28:10 2008
15.83% done, estimate finish Thu Jul 3 10:28:10 2008
17.80% done, estimate finish Thu Jul 3 10:28:10 2008
19.79% done, estimate finish Thu Jul 3 10:28:10 2008
21.76% done, estimate finish Thu Jul 3 10:28:10 2008
23.74% done, estimate finish Thu Jul 3 10:28:10 2008
25.72% done, estimate finish Thu Jul 3 10:28:10 2008
27.70% done, estimate finish Thu Jul 3 10:28:10 2008
29.67% done, estimate finish Thu Jul 3 10:28:10 2008
31.66% done, estimate finish Thu Jul 3 10:28:10 2008
33.63% done, estimate finish Thu Jul 3 10:28:10 2008
35.61% done, estimate finish Thu Jul 3 10:28:10 2008
37.59% done, estimate finish Thu Jul 3 10:28:10 2008
39.57% done, estimate finish Thu Jul 3 10:28:10 2008
41.54% done, estimate finish Thu Jul 3 10:28:10 2008
43.52% done, estimate finish Thu Jul 3 10:28:10 2008
45.50% done, estimate finish Thu Jul 3 10:28:10 2008
47.48% done, estimate finish Thu Jul 3 10:28:10 2008
49.46% done, estimate finish Thu Jul 3 10:28:10 2008
51.44% done, estimate finish Thu Jul 3 10:28:10 2008
53.41% done, estimate finish Thu Jul 3 10:28:10 2008
55.39% done, estimate finish Thu Jul 3 10:28:10 2008
57.37% done, estimate finish Thu Jul 3 10:28:10 2008
59.35% done, estimate finish Thu Jul 3 10:28:11 2008
61.33% done, estimate finish Thu Jul 3 10:28:11 2008
63.31% done, estimate finish Thu Jul 3 10:28:11 2008
65.28% done, estimate finish Thu Jul 3 10:28:11 2008
67.26% done, estimate finish Thu Jul 3 10:28:11 2008
69.24% done, estimate finish Thu Jul 3 10:28:11 2008
71.22% done, estimate finish Thu Jul 3 10:28:11 2008
73.20% done, estimate finish Thu Jul 3 10:28:11 2008
75.18% done, estimate finish Thu Jul 3 10:28:11 2008
77.15% done, estimate finish Thu Jul 3 10:28:11 2008
79.13% done, estimate finish Thu Jul 3 10:28:11 2008
81.11% done, estimate finish Thu Jul 3 10:28:11 2008
83.09% done, estimate finish Thu Jul 3 10:28:11 2008
85.06% done, estimate finish Thu Jul 3 10:28:11 2008
87.05% done, estimate finish Thu Jul 3 10:28:11 2008
89.02% done, estimate finish Thu Jul 3 10:28:11 2008
91.00% done, estimate finish Thu Jul 3 10:28:11 2008
92.98% done, estimate finish Thu Jul 3 10:28:11 2008
94.96% done, estimate finish Thu Jul 3 10:28:11 2008
96.93% done, estimate finish Thu Jul 3 10:28:11 2008
98.92% done, estimate finish Thu Jul 3 10:28:11 2008
Total translation table size: 0
Total rockridge attributes bytes: 264
Total directory bytes: 0
Path table size(bytes): 10
Max brk space used 0
252750 extents written (493 MB)

No indica que se ha creado una imagen de 493 MB

Antes de proceder a quemar primero necesitamos identificar el dispositivo (en este caso la quemadora) entonces escaneamos el dispositivo

# cdrecord -scanbus

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’).
scsibus4:
4,0,0 400) ‘HL-DT-ST’ ‘DVD-RAM GSA-H55N’ ‘1.02’ Removable CD-ROM
4,1,0 401) *
4,2,0 402) *
4,3,0 403) *
4,4,0 404) *
4,5,0 405) *
4,6,0 406) *
4,7,0 407) *

Con esto podemos notar que nuestra quemadora esta identificada en 4,0,0 400) ‘HL-DT-ST’ ‘DVD-RAM GSA-H55N’ ‘1.02’ Removable CD-ROM

Procedemos al quemamos, donde en la opción dev=xxx devemos indicar en identificador de nuestra quemadora, que en el paso anterior salio.

# cdrecord -v dev=4,0,0 speed=10 imagen_que_quiero_crear.iso

Using generic SCSI-3/mmc CD-R/CD-RW driver (mmc_cdr).
Driver flags : MMC-3 SWABAUDIO BURNFREE
Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R16 RAW/R96P RAW/R96R
Drive buf size : 1114112 = 1088 KB
Drive DMA Speed: 129024 kB/s 733x CD 93x DVD
FIFO size : 4194304 = 4096 KB
Track 01: data 493 MB
Total size: 566 MB (56:10.02) = 252752 sectors
Lout start: 567 MB (56:12/02) = 252752 sectors
Current Secsize: 2048
ATIP info from disk:
Indicated writing power: 7
Is not unrestricted
Is not erasable
ATIP start of lead in: -11597 (97:27/28)
ATIP start of lead out: 359849 (79:59/74)
Disk type: Short strategy type (Phthalocyanine or similar)
Manuf. index: 20
Manufacturer: Princo Corporation
Blocks total: 359849 Blocks current: 359849 Blocks remaining: 107097
Starting to write CD/DVD at speed 16 in real TAO mode for single session.
Last chance to quit, starting real write 0 seconds. Operation starts.
Waiting for reader process to fill input buffer … input buffer ready.
trackno=0
BURN-Free is ON.
Turning BURN-Free off
Performing OPC…
Starting new track at sector: 0
Track 01: 493 of 493 MB written (fifo 100%) [buf 93%] 16.4x.
Track 01: Total bytes read/written: 517632000/517632000 (252750 sectors).
Writing time: 224.775s
Average write speed 15.0x.
Min drive buffer fill was 90%
Fixating…
Fixating time: 18.114s
cdrecord: fifo had 8154 puts and 8154 gets.
cdrecord: fifo was 0 times empty and 8011 times full, min fill was

Esto es todo, expulsamos nuestro cd con eject y listo.

Nota: no es necesario ser root para hacer todo estos pasos.