par2 is a program for creating and using PAR2 files to detect damage in data files and repair them if necessary. It can be used with any kind of file.

par2 est une petite application qui permet réparer un(des) fichier(s) qui aurait pu être altérés. Par exemple, je grave un CD de mes sauvegardes et malheureusement, le CD a subit quelques rayures et les fichiers ont été endommagés. je ne peux plus décompresser le fichier. Si j'avais utiliser l'utilitaire par2, j'aurais peut-être pu réparer mes si précieuses sauvegardes.

comment ça marche ? par2 créé simplement quelques fichiers en plus permettant, si le fichier est endommagé, de le réparer. En fait, cest basé sur des calculs de CRC, il me semble avoir étudié ça en IUT ou autre .... :)

Installation (sous debian et dérivé) : apt-get install par2

Créer les fichiers par2 : par2 c fichier.tar (Je prends exemple avec un fichier tar, cela pourrait être autre chose hein ... voirplusieurs fichiers)

Vérifier que le fichier ne soit pas endommagé : par2 v premier_fichier.par2

krusaf@ares:/home/bkp$ ll _etc_20080630_.tar.gz*
-rwx------ 1 root root 3992006 2008-06-30 22:50 _etc_20080630_.tar.gz
-rwx------ 1 root root   40436 2008-06-30 22:50 _etc_20080630_.tar.gz.par2
-rwx------ 1 root root   42500 2008-06-30 22:50 _etc_20080630_.tar.gz.vol000+01.par2
-rwx------ 1 root root   84900 2008-06-30 22:50 _etc_20080630_.tar.gz.vol001+02.par2
-rwx------ 1 root root  129364 2008-06-30 22:50 _etc_20080630_.tar.gz.vol003+04.par2
-rwx------ 1 root root  177956 2008-06-30 22:50 _etc_20080630_.tar.gz.vol007+08.par2
-rwx------ 1 root root  234804 2008-06-30 22:50 _etc_20080630_.tar.gz.vol015+16.par2
-rwx------ 1 root root  308164 2008-06-30 22:50 _etc_20080630_.tar.gz.vol031+32.par2
-rwx------ 1 root root  318484 2008-06-30 22:50 _etc_20080630_.tar.gz.vol063+37.par2
krusaf@ares:/home/bkp$ sudo par2 v _etc_20080630_.tar.gz.par2
par2cmdline version 0.4, Copyright (C) 2003 Peter Brian Clements.

par2cmdline comes with ABSOLUTELY NO WARRANTY.

This is free software, and you are welcome to 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 of the License, or (at your
option) any later version. See COPYING for details.

Loading "_etc_20080630_.tar.gz.par2".
Loaded 4 new packets
Loading "_etc_20080630_.tar.gz.vol063+37.par2".
Loaded 37 new packets including 37 recovery blocks
Loading "_etc_20080630_.tar.gz.vol003+04.par2".
Loaded 4 new packets including 4 recovery blocks
Loading "_etc_20080630_.tar.gz.vol015+16.par2".
Loaded 16 new packets including 16 recovery blocks
Loading "_etc_20080630_.tar.gz.vol001+02.par2".
Loaded 2 new packets including 2 recovery blocks
Loading "_etc_20080630_.tar.gz.vol007+08.par2".
Loaded 8 new packets including 8 recovery blocks
Loading "_etc_20080630_.tar.gz.vol031+32.par2".
Loaded 32 new packets including 32 recovery blocks
Loading "_etc_20080630_.tar.gz.vol000+01.par2".
Loaded 1 new packets including 1 recovery blocks

There are 1 recoverable files and 0 other files.
The block size used was 1996 bytes.
There are a total of 2001 data blocks.
The total size of the data files is 3992006 bytes.

Verifying source files:

Target: "_etc_20080630_.tar.gz" - found.

All files are correct, repair is not required.

Réparer un fichier : par2 r premier_fichier.par2

Et pour les allergiques à la ligne de commande ( Merci schyzo) : pypar2 : http://pypar2.silent-blade.org/ gpar2 : http://sourceforge.net/project/show

Biensûr, ce billet ne remplace par le manuel ;) RTFM : man par2