Activities

April 2010
M T W T F S S
« Mar   May »
 1234
567891011
12131415161718
19202122232425
2627282930  

How to burn CD’s or DVD’s from commandline

Question,

I need to keep  a critical  daily backup to a CD/DVD.  So I would like to prefer a cronjob for doing this  automatically.

#wget ftp://ftp.berlios.de/pub/cdrecord/alpha/cdrtools-beta.tar.gz
[root@rc-090 ~]# cd cdrtools-2.01.01/
[root@rc-090 ~]# ./Gmake
[root@rc-090 ~]# ./Gmake install
[root@rc-090 ~]# cdrecord –version

Next thing is , we need to create a iso files  using the folders,

[root@rc-090 ~]#mkisofs -J -v -o zend.iso /home/installation/Zend-Studio-5.5/
### Added on May 17th 2013

Here is im going to create ‘Zend-Studio-5.5″ folder to a zend.iso file. Then I need to identify the which system bus is connected to DVD drive.

[root@rc-090 ~]# cdrecord -scanbus
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’).
scsibus1:
1,0,0   100) ‘TSSTcorp’ ‘CDDVDW SH-S203B ‘ ‘SB00’ Removable CD-ROM
1,1,0   101) *
1,2,0   102) *
1,3,0   103) *
1,4,0   104) *
1,5,0   105) *
1,6,0   106) *
1,7,0   107) *

Now I’m going to burn the CD’s using the following commands,
[root@rc-090 ~]# cdrecord -v dev=1,0,0 speed=16 -data zend.iso

Another method [root@rc-090 ~]# cdrecord -v dev= 14,0,0 speed=16 -dao -eject /tmp/temp.iso

Pls note that “dev=1,0,0” is the same value where cdrecord -scanbus shows.

How to burn DVD’s

As I uses Centos.
1. # yum install dvd+rw-tools make sure that cdtools are installed on the server.
2. Create ISO file to write to
[root@rc-090 ~]#mkisofs -r -o /tmp/temp.iso /softwares/apps/vmachines-img/Centos5-test-45
3. Burm iso images to DVD
[root@rc-090 ~]# growisofs -Z /dev/dvd=/tmp/temp.iso
4. Eject/insert drive
[root@rc-090 ~]# eject -T

[root@rc-136 home]# growisofs -Z /dev/dvd=/tmp/temp.iso
dvd1    dvdrw1
[root@rc-136 home]# growisofs -Z /dev/dvdrw1=ubuntu-12.10-desktop-i386.iso
Executing 'builtin_dd if=ubuntu-12.10-desktop-i386.iso of=/dev/dvdrw1 obs=32k seek=0'
/dev/dvdrw1: "Current Write Speed" is 8.2x1352KBps.
   10551296/789884928 ( 1.3%) @2.0x, remaining 7:23 RBU  53.7% UBU   4.7%
   26443776/789884928 ( 3.3%) @3.4x, remaining 4:19 RBU  98.6% UBU 100.0%
   42500096/789884928 ( 5.4%) @3.5x, remaining 3:31 RBU  97.9% UBU 100.0%
   58654720/789884928 ( 7.4%) @3.5x, remaining 3:19 RBU  98.6% UBU 100.0%
   74940416/789884928 ( 9.5%) @3.5x, remaining 3:01 RBU 100.0% UBU  99.9%
   91389952/789884928 (11.6%) @3.6x, remaining 2:48 RBU  87.9% UBU  99.9%
  107937792/789884928 (13.7%) @3.6x, remaining 2:44 RBU  81.2% UBU 100.0%
  124616704/789884928 (15.8%) @3.6x, remaining 2:34 RBU  31.8% UBU 100.0%
  141426688/789884928 (17.9%) @3.6x, remaining 2:26 RBU  99.2% UBU  99.9%

5. How do I create iSO files from cd/DVD’s
We can use diskcopy command to accomplish this.
# dd if=/dev/hdc of=/home/username/cdcopy.iso

[root@rc-090 backup]# dd if=/dev/scd0 of=/backup/win2008.iso
3674752+0 records in
3674752+0 records out
1881473024 bytes (1.9 GB) copied, 156.7 seconds, 12.0 MB/s
[root@rc-090 backup]# du -sh /backup/win2008.iso
1.8G /backup/win2008.iso
[root@rc-090 backup]#

Pls note use -dao while using DVD
ie eg. $cdrecord -v dev=1,0,0 driveropts=burnfree -dao -eject filename.iso . This command will eject the drive once the burning has completed.

Here is the command I used for converting Windows 7 image from DVD to disk image and burn it back to new DVD. Note that my USB DVD drive mounted as /dev/dvdrw1

[root@rc-090 home]# dd if=/dev/dvdrw1 of=/home/windows7_64_bit_Prof.iso
[root@rc-090 home]# eject /dev/dvdrw1
[root@rc-090 home]# cdrecord -scanbus
scsibus9:
        9,0,0   900) 'TSSTcorp' 'CDDVDW SE-S084C ' 'TS01' Removable CD-ROM
        9,1,0   901) *
        9,2,0   902) *
        9,3,0   903) *
        9,4,0   904) *
        9,5,0   905) *
        9,6,0   906) *
        9,7,0   907) *
[root@rc-090 home]# cdrecord -v dev=9,0,0 speed=8 -dao -eject windows7_64_bit_Prof.iso
FIFO size      : 4194304 = 4096 KB
Track 01: data  2976 MB
Total size:     3418 MB (338:39.38) = 1523954 sectors
Lout start:     3418 MB (338:41/29) = 1523954 sectors
Current Secsize: 2048
HINT: use dvd+rw-mediainfo from dvd+rw-tools for information extraction.
Blocks total: 2298496 Blocks current: 2298496 Blocks remaining: 774542
Speed set to 11080 KB/s
Starting to write CD/DVD at speed   8.0 in real SAO mode for single session.
Last chance to quit, starting real write in    0 seconds. Operation starts.
Waiting for reader process to fill input buffer ... input buffer ready.
Performing OPC...
Sending CUE sheet...
Starting new track at sector: 0
Track 01: 2976 of 2976 MB written (fifo 100%) [buf  99%]   7.3x.
Track 01: Total bytes read/written: 3121057792/3121057792 (1523954 sectors).
Writing  time:  477.895s
Average write speed   4.8x.
Min drive buffer fill was 99%
Fixating...
Fixating time:   11.359s
wodim: fifo had 49160 puts and 49160 gets.
wodim: fifo was 0 times empty and 21279 times full, min fill was 81%.
[root@rc-090 home]

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>