[index des documents]

Conception et mise en oeuvre d'un Service d'Archivage

Gravure sur DVD en ligne de Commande

[document en cours de rédaction...]
Ce document montre l'utilisation de différents outils libres permettant la gravure sur DVD sous Linux. Les différents tests réalisés sur ces outils nous permettent de déterminer celui qui est le plus adapté au Service d'Archivage.
  1. Introduction
  2. Cdrecord
  3. Dvdrecord
  4. Growisofs
  5. Conclusion

1- Introduction

Pour graver des DVD de donnes en ligne de commande, il existe plusieurs outils libres :
Il existe également un outil intéressant : Cdrecord-proDVD. Celui-ci est la version officielle de Cdrecord permettant de graver les DVD. Cette version est payante pour un usage autre que l'usage privé, nous la laissons donc de coté.
Nous allons expliquer comment graver le contenu d'un répertoire particulier (/home/archive1) sur un DVD avec les 3 outils cités précédemment. Le graveur est un Pioneer DVD-RW (DVR-106D) et a pour nom de périphérique /dev/dvdrom sous Linux FC2 (noyau 2.6.5-1.358)
On s'assure initialement que la taille du répertoire que l'on veut archiver est inférieure à la capacité DVD :

[root@localhost root]# du -sh /home/archive1/
1,6G /home/archive1

2- Cdrecord

Cdrecord est l'un des outils les plus connus pour graver les CDROM.
On peut télécharger la dernière version (actuellement cdrtools-2.01.tar.gz) :
Il existe des "patchs", pour cet outil, permettant de graver galement les DVD. Nous allons utiliser la version disponible sur les CD d'installation de Linux FC2. Cette version est déjà "patchée" pour pouvoir graver des DVD :
[root@localhost root]# rpm -qa | cdrecord
cdrecord-2.01-0.a27.3
Création de l'ISO (en le nommant sauvegarde.iso):
[root@localhost root]# mkisofs -R -r -J --hide-rr-moved -V "Archive1" -o sauvegarde.iso 
/home/archive1/

Les options de Mkisofs:

Vrification de la cration de l'ISO (en le "montant" sur un rpertoire que l'on cre /mnt/tmp auparavant):
[root@localhost root]# mount -t iso9660 -o loop sauvegarde.iso /mnt/tmp

Si tout va bien, "démontage" de l'ISO du CD :

[root@localhost root]# umount /mnt/tmp
Gravure du CD :
[root@localhost root]# cdrecord -v -dao dev=/dev/dvdrom -data sauvegarde.iso
Cdrecord-Clone 2.01a27-dvd (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jörg 
Schilling
Note: This version is an unofficial (modified) version with DVD support
Note: and therefore may have bugs that are not present in the original.
Note: Please send bug reports or support requests to <warly@mandrakesoft.com>.
Note: The author of cdrecord should not be bothered with problems in this version.
TOC Type: 1 = CD-ROM
scsidev: '/dev/scd0'
devname: '/dev/scd0'
scsibus: -2 target: -2 lun: -2
Warning: Open by 'devname' is unintentional and not supported.
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.80-RH '@(#)scsi-linux-sg.c 1.80 04/03/08 Copyright 

1997 J. Schilling').
SCSI buffer size: 64512
atapi: 1
Device type : Removable CD-ROM
Version : 2
Response Format: 2
Capabilities :
Vendor_info : 'PIONEER '
Identifikation : 'DVD-RW DVR-106D'
Revision : '1.05'
Device seems to be: Generic mmc2 DVD-R/DVD-RW.
Current: 0x0014
Profile: 0x001B
Profile: 0x001A
Profile: 0x0014 (current)
Profile: 0x0013 (current)
Profile: 0x0011 (current)
Profile: 0x0010
Profile: 0x000A
Profile: 0x0009
Profile: 0x0008
cdrecord: Found DVD media: using cdr_mdvd.
Using generic SCSI-3/mmc DVD-R(W) driver (mmc_mdvd).
Driver flags : SWABAUDIO BURNFREE
Supported modes: PACKET SAO
Drive buf size : 1605632 = 1568 KB
FIFO size : 4194304 = 4096 KB
Track 01: data 1276 MB
Total size: 1466 MB (145:16.16) = 653712 sectors
Lout start: 1466 MB (145:18/12) = 653712 sectors
Current Secsize: 2048
ATIP start of lead in: -150 (00:00/00)
Disk type: unknown dye (reserved id code)
Manuf. index: -1
Manufacturer: unknown (not in table)
Blocks total: 2298496 Blocks current: 2298496 Blocks remaining: 1644784
Starting to write CD/DVD at speed 2.0 in real SAO 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
BURN-Free is OFF.
Performing OPC...
Sending CUE sheet...
cdrecord: WARNING: Drive returns wrong startsec (0) using -150
Starting new track at sector: 0
Track 01: 1276 of 1276 MB written (fifo 100%) [buf 93%] 2.7x.
Track 01: Total bytes read/written: 1338802176/1338802176 (653712 sectors).
Writing time: 518.942s
Average write speed 2.0x.
Min drive buffer fill was 33%
Fixating...
Fixating time: 45.889s
cdrecord: fifo had 21088 puts and 21088 gets.
cdrecord: fifo was 14 times empty and 6493 times full, min fill was 0%.
-dao indique la gravure en mode disc-at-once (sans silence entre les pistes)
Comme indiqu aprs le lancement de la commande ("This version is an unofficial (modified) version with DVD support"), cette version de cdrecord n'est pas une version "officielle", nanmoins, elle permet la gravure de DVD.
Gravure " la vole" avec ejection du disque (-eject) :
[root@localhost root]# mkisofs -R -r -J --hide-rr-moved -V "Archive1" 
/home/archive1/ | cdrecord -v -eject dev=/dev/dvdrom -data -

3- Dvdrecord

Les commandes de Dvdrecord sont identiques à celles de cdrecord. En fait, Dvdrecord est basé sur Cdrecord v1.11a15. La dernière version de Dvdrecord est la v0.2.1 elle est d'ailleurs fournit avec les CD d'installation de Linux FC2.
Effacement d'un DVD RW :
[root@localhost root]# dvdrecord -eject -blank=fast dev=/dev/dvdrom
dvdrtools v0.2.1
Portions (C) 2002-2005 Ark Linux <bero@arklinux.org>
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with
this program; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
Based on:
Cdrecord 1.11a15 (i686-pc-linux-gnu) Copyright (C) 1995-2001 J%Gïâ¿â¿%@rg

Schilling
scsidev: '/dev/scd0'
devname: '/dev/scd0'
scsibus: -2 target: -2 lun: -2
Scanning device, b=4294967295
Linux sg driver version: 3.5.27
Using libscg version 'bero-0.5a'
dvdrecord: Warning: using inofficial version of libscg (bero-0.5a '@(#)scsitransp.c
1.81 01/04/20 Copyright 1988,1995,2000 J. Schilling').
Device type : Removable CD-ROM
Version : 2
Response Format: 2
Capabilities :
Vendor_info : 'PIONEER '
Identifikation : 'DVD-RW DVR-106D'
Revision : '1.05'
Device seems to be: Generic mmc2 DVD.
Using generic SCSI-3/mmc DVD-R(W) driver (mmc_mdvd).
Driver flags : SWABAUDIO BURNFREE
Supported modes: PACKET SAO
Starting to write CD/DVD at speed 1 in write mode for single session.
Last chance to quit, starting real write in 0 seconds. Operation starts.
Gravure de l'image sauvegarde.iso :
[root@localhost root]# dvdrecord -v -dao dev=/dev/dvdrom -data sauvegarde.iso
dvdrtools v0.2.1
Portions (C) 2002-2005 Ark Linux <bero@arklinux.org>
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT 
ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with
this program; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
Based on:
Cdrecord 1.11a15 (i686-pc-linux-gnu) Copyright (C) 1995-2001 J%Gïâ¿â¿%@rg
Schilling
TOC Type: 1 = CD-ROM
scsidev: '/dev/scd0'
devname: '/dev/scd0'
scsibus: -2 target: -2 lun: -2
Scanning device, b=4294967295
Linux sg driver version: 3.5.27
Using libscg version 'bero-0.5a'
dvdrecord: Warning: using inofficial version of libscg (bero-0.5a '@(#)scsitransp.c
1.81 01/04/20 Copyright 1988,1995,2000 J. Schilling').
atapi: 1
Device type : Removable CD-ROM
Version : 2
Response Format: 2
Capabilities :
Vendor_info : 'PIONEER '
Identifikation : 'DVD-RW DVR-106D'
Revision : '1.05'
Device seems to be: Generic mmc2 DVD.
Using generic SCSI-3/mmc DVD-R(W) driver (mmc_mdvd).
Driver flags : SWABAUDIO BURNFREE
Supported modes: PACKET SAO
Drive buf size : 1605632 = 1568 KB
FIFO size : 4194304 = 4096 KB
Track 01: data 1276 MB
Total size: 1466 MB (145:16.16) = 653712 sectors
Lout start: 1466 MB (145:18/12) = 653712 sectors
Current Secsize: 2048
ATIP start of lead in: -150 (00:00/00)
Disk type: unknown dye (reserved id code)
Manuf. index: -1
Manufacturer: unknown (not in table)
Blocks total: 2298496 Blocks current: 2298496 Blocks remaining: 1644784
Starting to write CD/DVD at speed 1 in write 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.
trackno=0
BURN-Free is ON.
Performing OPC...
Sending CUE sheet...
dvdrecord: WARNING: Drive returns wrong startsec (0) using -150
Starting new track at sector: 0
Track 01: 1276 of 1276 MB written (fifo 100%).
Track 01: Total bytes read/written: 1338802176/1338802176 (653712 sectors).
Writing time: 953.128s
Fixating...
Fixating time: 90.501s
dvdrecord: fifo had 21088 puts and 21088 gets.
dvdrecord: fifo was 0 times empty and 10638 times full, min fill was 84%.
Comme pour Cdrecord, Dvdrecord combin Mkisofs (avec un pipe) peut tre utilis pour graver la vole. La commande est la mme qu'avec Cdrecord.

4- Growisofs

Tlchargement de Growisofs : http://fy.chalmers.se/~appro/linux/DVD+RW/ (version actuelle 5.21) ...
Growisofs s'installe avec un ensemble de de binaire, notamment :
Effacement d'un DVD RW :
[root@localhost root]# dvd+rw-format -f /dev/dvdrom
Gravure "à la volée":
[root@localhost root]# growisofs -Z /dev/dvdrom -R -J /home/archive1
WARNING: /dev/dvdrom already carries isofs!
About to execute 'mkisofs -R -J /home/archive1 | builtin_dd of=/dev/dvdrom obs=32k
seek=0'
/dev/dvdrom: "Current Write Speed" is 2.0x1385KBps.
0.38%
...
98.29% done, estimate finish Fri Apr 1 15:02:28 2005
98.67% done, estimate finish Fri Apr 1 15:02:28 2005
99.05% done, estimate finish Fri Apr 1 15:02:28 2005
99.43% done, estimate finish Fri Apr 1 15:02:28 2005
99.81% done, estimate finish Fri Apr 1 15:02:28 2005
Total translation table size: 0
Total rockridge attributes bytes: 710
Total directory bytes: 0
Path table size(bytes): 10
Max brk space used 21000
1307424 extents written (2553 Mb)
builtin_dd: 1307424*2KB out
/dev/scd0: flushing cache
/dev/scd0: writing lead-out
/dev/scd0: reloading tray
les options -J et -R sont celles de Mkisofs dcrites prcdemment et -Z indique que si le disque contient des donnes, il sera formater avant la gravure.

5- Conclusion

Ce dernier outil, c'est dire Growisofs, est le plus adapt nos besoins. Lors d'une srie de tests, il a t le plus rapide et n'a engendr aucun "plantage". De plus, la version de Cdrecord utilise n'est pas "officielle" et comporte quelques bugs tout comme Dvdrecord qui utilise une version assez ancienne de cdrecord. Pour la gravure de DVD, nous utiliserons Growisofs.

Maj le 16-04-2005