Adding upstream version 1.15~rc1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
0ff20a5602
commit
6a117924f6
20 changed files with 439 additions and 219 deletions
|
@ -1,10 +1,16 @@
|
||||||
|
2013-07-29 Antonio Diaz Diaz <antonio@gnu.org>
|
||||||
|
|
||||||
|
* Version 1.15-rc1 released.
|
||||||
|
* Minor changes.
|
||||||
|
* Added chapter 'Unzcrash' to the manual.
|
||||||
|
|
||||||
2013-06-17 Antonio Diaz Diaz <antonio@gnu.org>
|
2013-06-17 Antonio Diaz Diaz <antonio@gnu.org>
|
||||||
|
|
||||||
* Version 1.15-pre1 released.
|
* Version 1.15-pre1 released.
|
||||||
* repair.cc: Repair multi-member files with up to one byte error
|
* repair.cc: Repair multi-member files with up to one byte error
|
||||||
per member.
|
per member.
|
||||||
* merge.cc: Merge multi-member files.
|
* merge.cc: Merge multi-member files.
|
||||||
* Added chapters 'Repairing Files' and 'Merging Files' to the manual.
|
* Added chapters 'Repairing files' and 'Merging files' to the manual.
|
||||||
|
|
||||||
2013-05-31 Antonio Diaz Diaz <antonio@gnu.org>
|
2013-05-31 Antonio Diaz Diaz <antonio@gnu.org>
|
||||||
|
|
||||||
|
|
4
INSTALL
4
INSTALL
|
@ -10,9 +10,9 @@ Procedure
|
||||||
---------
|
---------
|
||||||
1. Unpack the archive if you have not done so already:
|
1. Unpack the archive if you have not done so already:
|
||||||
|
|
||||||
lzip -cd lziprecover[version].tar.lz | tar -xf -
|
tar -xf lziprecover[version].tar.lz
|
||||||
or
|
or
|
||||||
gzip -cd lziprecover[version].tar.gz | tar -xf -
|
lzip -cd lziprecover[version].tar.lz | tar -xf -
|
||||||
|
|
||||||
This creates the directory ./lziprecover[version] containing the source
|
This creates the directory ./lziprecover[version] containing the source
|
||||||
from the main archive.
|
from the main archive.
|
||||||
|
|
4
NEWS
4
NEWS
|
@ -6,5 +6,5 @@ per member, without having to split them first.
|
||||||
Lziprecover can now merge multi-member files without having to split
|
Lziprecover can now merge multi-member files without having to split
|
||||||
them first even if some copies have the header and the trailer damaged.
|
them first even if some copies have the header and the trailer damaged.
|
||||||
|
|
||||||
The chapters "Repairing Files" and "Merging Files" have been added to
|
The chapters "Repairing files", "Merging files" and "Unzcrash" have been
|
||||||
the manual.
|
added to the manual.
|
||||||
|
|
51
README
51
README
|
@ -1,16 +1,29 @@
|
||||||
Description
|
Description
|
||||||
|
|
||||||
Lziprecover is a data recovery tool and decompressor for files in the
|
Lziprecover is a data recovery tool and decompressor for files in the
|
||||||
lzip compressed data format (.lz) able to repair slightly damaged files,
|
lzip compressed data format (.lz), able to repair slightly damaged
|
||||||
recover badly damaged files from two or more copies, extract data from
|
files, recover badly damaged files from two or more copies, extract data
|
||||||
damaged files, decompress files and test integrity of files.
|
from damaged files, decompress files and test integrity of files.
|
||||||
|
|
||||||
|
The lzip file format is designed for long-term data archiving. It is
|
||||||
|
clean, provides very safe 4 factor integrity checking, and is backed by
|
||||||
|
the recovery capabilities of lziprecover.
|
||||||
|
|
||||||
Lziprecover is able to recover or decompress files produced by any of
|
Lziprecover is able to recover or decompress files produced by any of
|
||||||
the compressors in the lzip family; lzip, plzip, minilzip/lzlib, clzip
|
the compressors in the lzip family; lzip, plzip, minilzip/lzlib, clzip
|
||||||
and pdlzip. It makes lzip files resistant to bit-flip, one of the most
|
and pdlzip.
|
||||||
common forms of data corruption, and its recovery capabilities
|
|
||||||
contribute to make of the lzip format one of the best options for
|
Lziprecover makes lzip files resistant to bit-flip (one of the most
|
||||||
long-term data archiving.
|
common forms of data corruption), and can safely merge multiple damaged
|
||||||
|
backup copies.
|
||||||
|
|
||||||
|
If the cause of file corruption is damaged media, the combination
|
||||||
|
GNU ddrescue + lziprecover is the best option for recovering data from
|
||||||
|
multiple damaged copies.
|
||||||
|
|
||||||
|
If a file is too damaged for lziprecover to repair it, all the
|
||||||
|
recoverable data in all members of the file can be extracted with the
|
||||||
|
'-D' option.
|
||||||
|
|
||||||
Lziprecover is able to efficiently extract a range of bytes from a
|
Lziprecover is able to efficiently extract a range of bytes from a
|
||||||
multi-member file, because it only decompresses the members containing
|
multi-member file, because it only decompresses the members containing
|
||||||
|
@ -27,24 +40,20 @@ damaged files themselves are never modified.
|
||||||
When decompressing or testing file integrity, lziprecover behaves like
|
When decompressing or testing file integrity, lziprecover behaves like
|
||||||
lzip or lunzip.
|
lzip or lunzip.
|
||||||
|
|
||||||
If the files are too damaged for lziprecover to repair them, data from
|
To give you an idea of its possibilities, when merging two copies, each
|
||||||
damaged members can be partially recovered writing it to stdout.
|
|
||||||
|
|
||||||
To give you an idea of its possibilities, when merging two copies each
|
|
||||||
of them with one damaged area affecting 1 percent of the copy, the
|
of them with one damaged area affecting 1 percent of the copy, the
|
||||||
probability of obtaining a correct file is about 98 percent. With three
|
probability of obtaining a correct file is about 98 percent. With three
|
||||||
such copies the probability rises to 99.97 percent. For large files with
|
such copies the probability rises to 99.97 percent. For large files (a
|
||||||
small errors, the probability approaches 100 percent even with only two
|
few MB) with small errors (one sector damaged per copy), the probability
|
||||||
copies.
|
approaches 100 percent even with only two copies.
|
||||||
|
|
||||||
If the cause of file corruption is damaged media, the combination
|
Lziprecover is not a replacement for regular backups, but a last line of
|
||||||
GNU ddrescue + lziprecover is the best option for recovering data from
|
defense for the case where the backups are also damaged.
|
||||||
multiple damaged copies.
|
|
||||||
|
|
||||||
This package also includes unzcrash, a program written to test
|
The lziprecover package also includes unzcrash, a program written to
|
||||||
robustness to decompression of corrupted data, inspired by unzcrash.c
|
test robustness to decompression of corrupted data, inspired by
|
||||||
from Julian Seward's bzip2. Type 'make unzcrash' in the lziprecover
|
unzcrash.c from Julian Seward's bzip2. Type 'make unzcrash' in the
|
||||||
directory to build it. Then try 'unzcrash --help'.
|
lziprecover source directory to build it. Then try 'unzcrash --help'.
|
||||||
|
|
||||||
|
|
||||||
Copyright (C) 2009, 2010, 2011, 2012, 2013 Antonio Diaz Diaz.
|
Copyright (C) 2009, 2010, 2011, 2012, 2013 Antonio Diaz Diaz.
|
||||||
|
|
8
configure
vendored
8
configure
vendored
|
@ -1,14 +1,14 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# configure script for Lziprecover - Data recovery tool for lzipped files
|
# configure script for Lziprecover - Data recovery tool for lzip files
|
||||||
# Copyright (C) 2009, 2010, 2011, 2012, 2013 Antonio Diaz Diaz.
|
# Copyright (C) 2009, 2010, 2011, 2012, 2013 Antonio Diaz Diaz.
|
||||||
#
|
#
|
||||||
# This configure script is free software: you have unlimited permission
|
# This configure script is free software: you have unlimited permission
|
||||||
# to copy, distribute and modify it.
|
# to copy, distribute and modify it.
|
||||||
|
|
||||||
pkgname=lziprecover
|
pkgname=lziprecover
|
||||||
pkgversion=1.15-pre1
|
pkgversion=1.15-rc1
|
||||||
progname=lziprecover
|
progname=lziprecover
|
||||||
srctrigger=doc/lziprecover.texinfo
|
srctrigger=doc/${pkgname}.texinfo
|
||||||
|
|
||||||
# clear some things potentially inherited from environment.
|
# clear some things potentially inherited from environment.
|
||||||
LC_ALL=C
|
LC_ALL=C
|
||||||
|
@ -164,7 +164,7 @@ echo "CXXFLAGS = ${CXXFLAGS}"
|
||||||
echo "LDFLAGS = ${LDFLAGS}"
|
echo "LDFLAGS = ${LDFLAGS}"
|
||||||
rm -f Makefile
|
rm -f Makefile
|
||||||
cat > Makefile << EOF
|
cat > Makefile << EOF
|
||||||
# Makefile for Lziprecover - Data recovery tool for lzipped files
|
# Makefile for Lziprecover - Data recovery tool for lzip files
|
||||||
# Copyright (C) 2009, 2010, 2011, 2012, 2013 Antonio Diaz Diaz.
|
# Copyright (C) 2009, 2010, 2011, 2012, 2013 Antonio Diaz Diaz.
|
||||||
# This file was generated automatically by configure. Do not edit.
|
# This file was generated automatically by configure. Do not edit.
|
||||||
#
|
#
|
||||||
|
|
16
decoder.cc
16
decoder.cc
|
@ -1,4 +1,4 @@
|
||||||
/* Lziprecover - Data recovery tool for lzipped files
|
/* Lziprecover - Data recovery tool for lzip files
|
||||||
Copyright (C) 2009, 2010, 2011, 2012, 2013 Antonio Diaz Diaz.
|
Copyright (C) 2009, 2010, 2011, 2012, 2013 Antonio Diaz Diaz.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
@ -104,10 +104,10 @@ bool Range_decoder::read_block()
|
||||||
|
|
||||||
void LZ_decoder::flush_data()
|
void LZ_decoder::flush_data()
|
||||||
{
|
{
|
||||||
const int size = pos - stream_pos;
|
if( pos > stream_pos )
|
||||||
if( size > 0 )
|
|
||||||
{
|
{
|
||||||
crc32.update( crc_, buffer + stream_pos, size );
|
const int size = pos - stream_pos;
|
||||||
|
crc32.update_buf( crc_, buffer + stream_pos, size );
|
||||||
if( outfd >= 0 )
|
if( outfd >= 0 )
|
||||||
{
|
{
|
||||||
const unsigned long long sp = stream_position();
|
const unsigned long long sp = stream_position();
|
||||||
|
@ -207,7 +207,6 @@ int LZ_decoder::decode_member( const Pretty_print & pp )
|
||||||
Bit_model bm_align[dis_align_size];
|
Bit_model bm_align[dis_align_size];
|
||||||
Len_model match_len_model;
|
Len_model match_len_model;
|
||||||
Len_model rep_len_model;
|
Len_model rep_len_model;
|
||||||
|
|
||||||
unsigned rep0 = 0; // rep[0-3] latest four distances
|
unsigned rep0 = 0; // rep[0-3] latest four distances
|
||||||
unsigned rep1 = 0; // used for efficient coding of
|
unsigned rep1 = 0; // used for efficient coding of
|
||||||
unsigned rep2 = 0; // repeated distances
|
unsigned rep2 = 0; // repeated distances
|
||||||
|
@ -222,11 +221,16 @@ int LZ_decoder::decode_member( const Pretty_print & pp )
|
||||||
{
|
{
|
||||||
const uint8_t prev_byte = get_prev_byte();
|
const uint8_t prev_byte = get_prev_byte();
|
||||||
if( state.is_char() )
|
if( state.is_char() )
|
||||||
|
{
|
||||||
|
state.set_char1();
|
||||||
put_byte( rdec.decode_tree( bm_literal[get_lit_state(prev_byte)], 8 ) );
|
put_byte( rdec.decode_tree( bm_literal[get_lit_state(prev_byte)], 8 ) );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
state.set_char2();
|
||||||
put_byte( rdec.decode_matched( bm_literal[get_lit_state(prev_byte)],
|
put_byte( rdec.decode_matched( bm_literal[get_lit_state(prev_byte)],
|
||||||
get_byte( rep0 ) ) );
|
get_byte( rep0 ) ) );
|
||||||
state.set_char();
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Lziprecover - Data recovery tool for lzipped files
|
/* Lziprecover - Data recovery tool for lzip files
|
||||||
Copyright (C) 2009, 2010, 2011, 2012, 2013 Antonio Diaz Diaz.
|
Copyright (C) 2009, 2010, 2011, 2012, 2013 Antonio Diaz Diaz.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
@ -278,7 +278,6 @@ public:
|
||||||
~LZ_decoder() { delete[] buffer; }
|
~LZ_decoder() { delete[] buffer; }
|
||||||
|
|
||||||
unsigned crc() const { return crc_ ^ 0xFFFFFFFFU; }
|
unsigned crc() const { return crc_ ^ 0xFFFFFFFFU; }
|
||||||
|
|
||||||
unsigned long long data_position() const { return partial_data_pos + pos; }
|
unsigned long long data_position() const { return partial_data_pos + pos; }
|
||||||
|
|
||||||
int decode_member( const Pretty_print & pp );
|
int decode_member( const Pretty_print & pp );
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1.
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1.
|
||||||
.TH LZIPRECOVER "1" "June 2013" "Lziprecover 1.15-pre1" "User Commands"
|
.TH LZIPRECOVER "1" "July 2013" "Lziprecover 1.15-rc1" "User Commands"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
Lziprecover \- recovers data from damaged lzip files
|
Lziprecover \- recovers data from damaged lzip files
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B lziprecover
|
.B lziprecover
|
||||||
[\fIoptions\fR] [\fIfiles\fR]
|
[\fIoptions\fR] [\fIfiles\fR]
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
Lziprecover \- Data recovery tool and decompressor for lzipped files.
|
Lziprecover \- Data recovery tool and decompressor for lzip files.
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.TP
|
.TP
|
||||||
\fB\-h\fR, \fB\-\-help\fR
|
\fB\-h\fR, \fB\-\-help\fR
|
||||||
|
|
|
@ -3,7 +3,7 @@ lziprecover.texinfo.
|
||||||
|
|
||||||
INFO-DIR-SECTION Data Compression
|
INFO-DIR-SECTION Data Compression
|
||||||
START-INFO-DIR-ENTRY
|
START-INFO-DIR-ENTRY
|
||||||
* Lziprecover: (lziprecover). Data recovery tool for lzipped files
|
* Lziprecover: (lziprecover). Data recovery tool for lzip files
|
||||||
END-INFO-DIR-ENTRY
|
END-INFO-DIR-ENTRY
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,18 +12,19 @@ File: lziprecover.info, Node: Top, Next: Introduction, Up: (dir)
|
||||||
Lziprecover Manual
|
Lziprecover Manual
|
||||||
******************
|
******************
|
||||||
|
|
||||||
This manual is for Lziprecover (version 1.15-pre1, 17 June 2013).
|
This manual is for Lziprecover (version 1.15-rc1, 29 July 2013).
|
||||||
|
|
||||||
* Menu:
|
* Menu:
|
||||||
|
|
||||||
* Introduction:: Purpose and features of lziprecover
|
* Introduction:: Purpose and features of lziprecover
|
||||||
* Invoking Lziprecover:: Command line interface
|
* Invoking lziprecover:: Command line interface
|
||||||
* Repairing Files:: Fixing bit-flip and similar errors
|
* Repairing files:: Fixing bit-flip and similar errors
|
||||||
* Merging Files:: Fixing several damaged copies
|
* Merging files:: Fixing several damaged copies
|
||||||
* File Format:: Detailed format of the compressed file
|
* File format:: Detailed format of the compressed file
|
||||||
* Examples:: A small tutorial with examples
|
* Examples:: A small tutorial with examples
|
||||||
|
* Unzcrash:: Testing the robustness of decompressors
|
||||||
* Problems:: Reporting bugs
|
* Problems:: Reporting bugs
|
||||||
* Concept Index:: Index of concepts
|
* Concept index:: Index of concepts
|
||||||
|
|
||||||
|
|
||||||
Copyright (C) 2009, 2010, 2011, 2012, 2013 Antonio Diaz Diaz.
|
Copyright (C) 2009, 2010, 2011, 2012, 2013 Antonio Diaz Diaz.
|
||||||
|
@ -32,22 +33,38 @@ This manual is for Lziprecover (version 1.15-pre1, 17 June 2013).
|
||||||
copy, distribute and modify it.
|
copy, distribute and modify it.
|
||||||
|
|
||||||
|
|
||||||
File: lziprecover.info, Node: Introduction, Next: Invoking Lziprecover, Prev: Top, Up: Top
|
File: lziprecover.info, Node: Introduction, Next: Invoking lziprecover, Prev: Top, Up: Top
|
||||||
|
|
||||||
1 Introduction
|
1 Introduction
|
||||||
**************
|
**************
|
||||||
|
|
||||||
Lziprecover is a data recovery tool and decompressor for files in the
|
Lziprecover is a data recovery tool and decompressor for files in the
|
||||||
lzip compressed data format (.lz) able to repair slightly damaged files,
|
lzip compressed data format (.lz), able to repair slightly damaged
|
||||||
recover badly damaged files from two or more copies, extract data from
|
files, recover badly damaged files from two or more copies, extract data
|
||||||
damaged files, decompress files and test integrity of files.
|
from damaged files, decompress files and test integrity of files.
|
||||||
|
|
||||||
|
The lzip file format is designed for long-term data archiving. It is
|
||||||
|
clean, provides very safe 4 factor integrity checking, and is backed by
|
||||||
|
the recovery capabilities of lziprecover.
|
||||||
|
|
||||||
Lziprecover is able to recover or decompress files produced by any of
|
Lziprecover is able to recover or decompress files produced by any of
|
||||||
the compressors in the lzip family; lzip, plzip, minilzip/lzlib, clzip
|
the compressors in the lzip family; lzip, plzip, minilzip/lzlib, clzip
|
||||||
and pdlzip. It makes lzip files resistant to bit-flip, one of the most
|
and pdlzip.
|
||||||
common forms of data corruption, and its recovery capabilities
|
|
||||||
contribute to make of the lzip format one of the best options for
|
Lziprecover makes lzip files resistant to bit-flip (one of the most
|
||||||
long-term data archiving.
|
common forms of data corruption), and can safely merge multiple damaged
|
||||||
|
backup copies.
|
||||||
|
|
||||||
|
If the cause of file corruption is damaged media, the combination
|
||||||
|
GNU ddrescue + lziprecover is the best option for recovering data from
|
||||||
|
multiple damaged copies. *Note ddrescue-example::, for an example.
|
||||||
|
|
||||||
|
If a file is too damaged for lziprecover to repair it, all the
|
||||||
|
recoverable data in all members of the file can be extracted with the
|
||||||
|
following command (the resulting file may contain errors and some
|
||||||
|
garbage data may be produced at the end of each member):
|
||||||
|
|
||||||
|
lziprecover -D0 -i -o file -q file.lz
|
||||||
|
|
||||||
Lziprecover is able to efficiently extract a range of bytes from a
|
Lziprecover is able to efficiently extract a range of bytes from a
|
||||||
multi-member file, because it only decompresses the members containing
|
multi-member file, because it only decompresses the members containing
|
||||||
|
@ -64,24 +81,13 @@ damaged files themselves are never modified.
|
||||||
When decompressing or testing file integrity, lziprecover behaves
|
When decompressing or testing file integrity, lziprecover behaves
|
||||||
like lzip or lunzip.
|
like lzip or lunzip.
|
||||||
|
|
||||||
If a file is too damaged for lziprecover to repair it, all the
|
|
||||||
recoverable data in all members of the file can be extracted with the
|
|
||||||
following command (the resulting file may contain errors and some
|
|
||||||
garbage data may be produced at the end of each member):
|
|
||||||
|
|
||||||
lziprecover -D0 -i -o file -q file.lz
|
|
||||||
|
|
||||||
If the cause of file corruption is damaged media, the combination
|
|
||||||
GNU ddrescue + lziprecover is the best option for recovering data from
|
|
||||||
multiple damaged copies. *Note ddrescue-example::, for an example.
|
|
||||||
|
|
||||||
Lziprecover is not a replacement for regular backups, but a last
|
Lziprecover is not a replacement for regular backups, but a last
|
||||||
line of defense for the case where the backups are also damaged.
|
line of defense for the case where the backups are also damaged.
|
||||||
|
|
||||||
|
|
||||||
File: lziprecover.info, Node: Invoking Lziprecover, Next: Repairing Files, Prev: Introduction, Up: Top
|
File: lziprecover.info, Node: Invoking lziprecover, Next: Repairing files, Prev: Introduction, Up: Top
|
||||||
|
|
||||||
2 Invoking Lziprecover
|
2 Invoking lziprecover
|
||||||
**********************
|
**********************
|
||||||
|
|
||||||
The format for running lziprecover is:
|
The format for running lziprecover is:
|
||||||
|
@ -149,8 +155,8 @@ The format for running lziprecover is:
|
||||||
Try to produce a correct file merging the good parts of two or more
|
Try to produce a correct file merging the good parts of two or more
|
||||||
damaged copies. If successful, a repaired copy is written to the
|
damaged copies. If successful, a repaired copy is written to the
|
||||||
file `FILE_fixed.lz'. The exit status is 0 if a correct file could
|
file `FILE_fixed.lz'. The exit status is 0 if a correct file could
|
||||||
be produced, 2 otherwise. See the chapter Merging Files (*note
|
be produced, 2 otherwise. See the chapter `Merging files' (*note
|
||||||
Merging Files::) for a complete description of the merge mode.
|
Merging files::) for a complete description of the merge mode.
|
||||||
|
|
||||||
`-o FILE'
|
`-o FILE'
|
||||||
`--output=FILE'
|
`--output=FILE'
|
||||||
|
@ -167,10 +173,10 @@ The format for running lziprecover is:
|
||||||
`-R'
|
`-R'
|
||||||
`--repair'
|
`--repair'
|
||||||
Try to repair a file with small errors (up to one byte error per
|
Try to repair a file with small errors (up to one byte error per
|
||||||
member). If successful, a repaired copy is written to the file
|
member). If successful, a repaired copy is written to the file
|
||||||
`FILE_fixed.lz'. `FILE' is not modified at all. The exit status
|
`FILE_fixed.lz'. `FILE' is not modified at all. The exit status
|
||||||
is 0 if the file could be repaired, 2 otherwise. See the chapter
|
is 0 if the file could be repaired, 2 otherwise. See the chapter
|
||||||
Repairing Files (*note Repairing Files::) for a complete
|
`Repairing files' (*note Repairing files::) for a complete
|
||||||
description of the repair mode.
|
description of the repair mode.
|
||||||
|
|
||||||
`-s'
|
`-s'
|
||||||
|
@ -199,12 +205,11 @@ The format for running lziprecover is:
|
||||||
`--verbose'
|
`--verbose'
|
||||||
Verbose mode.
|
Verbose mode.
|
||||||
When decompressing or testing, further -v's (up to 4) increase the
|
When decompressing or testing, further -v's (up to 4) increase the
|
||||||
verbosity level, showing status, dictionary size, compression
|
verbosity level, showing status, compression ratio, dictionary
|
||||||
ratio, trailer contents (CRC, data size, member size), and up to 6
|
size, trailer contents (CRC, data size, member size), and up to 6
|
||||||
bytes of trailing garbage (if any).
|
bytes of trailing garbage (if any).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Numbers given as arguments to options may be followed by a multiplier
|
Numbers given as arguments to options may be followed by a multiplier
|
||||||
and an optional `B' for "byte".
|
and an optional `B' for "byte".
|
||||||
|
|
||||||
|
@ -227,9 +232,9 @@ invalid input file, 3 for an internal consistency error (eg, bug) which
|
||||||
caused lziprecover to panic.
|
caused lziprecover to panic.
|
||||||
|
|
||||||
|
|
||||||
File: lziprecover.info, Node: Repairing Files, Next: Merging Files, Prev: Invoking Lziprecover, Up: Top
|
File: lziprecover.info, Node: Repairing files, Next: Merging files, Prev: Invoking lziprecover, Up: Top
|
||||||
|
|
||||||
3 Repairing Files
|
3 Repairing files
|
||||||
*****************
|
*****************
|
||||||
|
|
||||||
Lziprecover is able to repair files with small errors (up to one byte
|
Lziprecover is able to repair files with small errors (up to one byte
|
||||||
|
@ -244,13 +249,13 @@ vice versa. It may be caused by bad RAM or even by natural radiation. I
|
||||||
have seen a case of bit-flip in a file stored in an USB flash drive.
|
have seen a case of bit-flip in a file stored in an USB flash drive.
|
||||||
|
|
||||||
|
|
||||||
File: lziprecover.info, Node: Merging Files, Next: File Format, Prev: Repairing Files, Up: Top
|
File: lziprecover.info, Node: Merging files, Next: File format, Prev: Repairing files, Up: Top
|
||||||
|
|
||||||
4 Merging Files
|
4 Merging files
|
||||||
***************
|
***************
|
||||||
|
|
||||||
If you have several copies of a file but all of them are too damaged to
|
If you have several copies of a file but all of them are too damaged to
|
||||||
repair them (*note Repairing Files::), lziprecover can try to produce a
|
repair them (*note Repairing files::), lziprecover can try to produce a
|
||||||
correct file merging the good parts of the damaged copies.
|
correct file merging the good parts of the damaged copies.
|
||||||
|
|
||||||
The merge may succeed even if some copies of the file have all the
|
The merge may succeed even if some copies of the file have all the
|
||||||
|
@ -262,17 +267,31 @@ the file.
|
||||||
is damaged in all copies), or are adjacent and the boundary can't be
|
is damaged in all copies), or are adjacent and the boundary can't be
|
||||||
determined, or if the copies have too many damaged areas.
|
determined, or if the copies have too many damaged areas.
|
||||||
|
|
||||||
To give you an idea of its possibilities, when merging two copies
|
All the copies must have the same size. If some of them have been
|
||||||
|
truncated and are therefore smaller than they should, you can extend
|
||||||
|
them to the correct size with the following command before merging them
|
||||||
|
with the other copies:
|
||||||
|
|
||||||
|
ddrescue --extend-outfile=<correct_size> small_file.lz extended_file.lz
|
||||||
|
|
||||||
|
If some of the copies have got garbage data at the end and are
|
||||||
|
therefore larger than they should, you can reduce their sizes to the
|
||||||
|
correct value with the following command before merging them with the
|
||||||
|
other copies:
|
||||||
|
|
||||||
|
ddrescue --size=<correct_size> large_file.lz reduced_file.lz
|
||||||
|
|
||||||
|
To give you an idea of its possibilities, when merging two copies,
|
||||||
each of them with one damaged area affecting 1 percent of the copy, the
|
each of them with one damaged area affecting 1 percent of the copy, the
|
||||||
probability of obtaining a correct file is about 98 percent. With three
|
probability of obtaining a correct file is about 98 percent. With three
|
||||||
such copies the probability rises to 99.97 percent. For large files with
|
such copies the probability rises to 99.97 percent. For large files (a
|
||||||
small errors, the probability approaches 100 percent even with only two
|
few MB) with small errors (one sector damaged per copy), the probability
|
||||||
copies.
|
approaches 100 percent even with only two copies.
|
||||||
|
|
||||||
|
|
||||||
File: lziprecover.info, Node: File Format, Next: Examples, Prev: Merging Files, Up: Top
|
File: lziprecover.info, Node: File format, Next: Examples, Prev: Merging files, Up: Top
|
||||||
|
|
||||||
5 File Format
|
5 File format
|
||||||
*************
|
*************
|
||||||
|
|
||||||
Perfection is reached, not when there is no longer anything to add, but
|
Perfection is reached, not when there is no longer anything to add, but
|
||||||
|
@ -343,7 +362,7 @@ additional information before, between, or after them.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
File: lziprecover.info, Node: Examples, Next: Problems, Prev: File Format, Up: Top
|
File: lziprecover.info, Node: Examples, Next: Unzcrash, Prev: File format, Up: Top
|
||||||
|
|
||||||
6 A small tutorial with examples
|
6 A small tutorial with examples
|
||||||
********************************
|
********************************
|
||||||
|
@ -381,8 +400,8 @@ are abridged diagnostic messages from lziprecover).
|
||||||
|
|
||||||
|
|
||||||
Example 6: Split the multi-member file `file.lz' and write each member
|
Example 6: Split the multi-member file `file.lz' and write each member
|
||||||
in its own `recXXXXXfile.lz' file. Then use `lziprecover -t' to test
|
in its own `recXXXfile.lz' file. Then use `lziprecover -t' to test the
|
||||||
the integrity of the resulting files.
|
integrity of the resulting files.
|
||||||
|
|
||||||
lziprecover -s file.lz
|
lziprecover -s file.lz
|
||||||
lziprecover -tv rec*file.lz
|
lziprecover -tv rec*file.lz
|
||||||
|
@ -401,7 +420,7 @@ error-checked merging of copies (*Note GNU ddrescue manual:
|
||||||
mount -t iso9660 -o loop,ro cdimage2 /mnt/cdimage
|
mount -t iso9660 -o loop,ro cdimage2 /mnt/cdimage
|
||||||
cp /mnt/cdimage/backup.tar.lz rescued2.tar.lz
|
cp /mnt/cdimage/backup.tar.lz rescued2.tar.lz
|
||||||
umount /mnt/cdimage
|
umount /mnt/cdimage
|
||||||
lziprecover -m -v -o rescued.tar.lz rescued1.tar.lz rescued2.tar.lz
|
lziprecover -m -v -o backup.tar.lz rescued1.tar.lz rescued2.tar.lz
|
||||||
|
|
||||||
|
|
||||||
Example 8: Recover the first volume of those created with the command
|
Example 8: Recover the first volume of those created with the command
|
||||||
|
@ -414,9 +433,80 @@ correct file produced is saved in `big_db_00001.lz'.
|
||||||
Input files merged successfully
|
Input files merged successfully
|
||||||
|
|
||||||
|
|
||||||
File: lziprecover.info, Node: Problems, Next: Concept Index, Prev: Examples, Up: Top
|
File: lziprecover.info, Node: Unzcrash, Next: Problems, Prev: Examples, Up: Top
|
||||||
|
|
||||||
7 Reporting Bugs
|
7 Testing the robustness of decompressors
|
||||||
|
*****************************************
|
||||||
|
|
||||||
|
The lziprecover package also includes unzcrash, a program written to
|
||||||
|
test robustness to decompression of corrupted data, inspired by
|
||||||
|
unzcrash.c from Julian Seward's bzip2. Type `make unzcrash' in the
|
||||||
|
lziprecover source directory to build it.
|
||||||
|
|
||||||
|
Unzcrash reads the specified file and then repeatedly decompresses
|
||||||
|
it, increasing 256 times each byte of the compressed data, so as to
|
||||||
|
test all possible one-byte errors. This should not cause any invalid
|
||||||
|
memory accesses. If it does, please, report it as a bug.
|
||||||
|
|
||||||
|
Unzcrash really executes as a subprocess the shell command specified
|
||||||
|
in the first non-option argument, and then writes the file specified in
|
||||||
|
the second non-option argument to the standard input of the subprocess,
|
||||||
|
modifying the corresponding byte each time. Therefore you can use
|
||||||
|
unzcrash to test any decompressor (not only lzip), or even other decoder
|
||||||
|
programs with a suitable command line syntax.
|
||||||
|
|
||||||
|
The format for running unzcrash is:
|
||||||
|
|
||||||
|
unzcrash [OPTIONS] "lzip -tv" FILENAME.lz
|
||||||
|
|
||||||
|
Unzcrash supports the following options:
|
||||||
|
|
||||||
|
`-h'
|
||||||
|
`--help'
|
||||||
|
Print an informative help message describing the options and exit.
|
||||||
|
|
||||||
|
`-V'
|
||||||
|
`--version'
|
||||||
|
Print the version number of lziprecover on the standard output and
|
||||||
|
exit.
|
||||||
|
|
||||||
|
`-b RANGE'
|
||||||
|
`--bits=RANGE'
|
||||||
|
Test N-bit errors only, instead of testing all the 255 wrong
|
||||||
|
values for each byte. `N-bit error' means any value differing from
|
||||||
|
the original value in N bit positions, not a value differing from
|
||||||
|
the original value in the bit position N.
|
||||||
|
The number of N-bit errors per byte (N = 1 to 8) is: 8 28 56 70 56
|
||||||
|
28 8 1
|
||||||
|
Examples of RANGE: 1 1,2,3 1-4 1,3-5,8 1-3,5-8
|
||||||
|
|
||||||
|
`-p BYTES'
|
||||||
|
`--position=BYTES'
|
||||||
|
First byte position to test in the file. Defaults to 0.
|
||||||
|
|
||||||
|
`-q'
|
||||||
|
`--quiet'
|
||||||
|
Quiet operation. Suppress all messages.
|
||||||
|
|
||||||
|
`-s BYTES'
|
||||||
|
`--size=BYTES'
|
||||||
|
Number of byte positions to test. If not specified, the whole file
|
||||||
|
is tested.
|
||||||
|
|
||||||
|
`-v'
|
||||||
|
`--verbose'
|
||||||
|
Verbose mode.
|
||||||
|
|
||||||
|
|
||||||
|
Exit status: 0 for a normal exit, 1 for environmental problems (file
|
||||||
|
not found, invalid flags, I/O errors, etc), 2 to indicate a corrupt or
|
||||||
|
invalid input file, 3 for an internal consistency error (eg, bug) which
|
||||||
|
caused unzcrash to panic.
|
||||||
|
|
||||||
|
|
||||||
|
File: lziprecover.info, Node: Problems, Next: Concept index, Prev: Unzcrash, Up: Top
|
||||||
|
|
||||||
|
8 Reporting bugs
|
||||||
****************
|
****************
|
||||||
|
|
||||||
There are probably bugs in lziprecover. There are certainly errors and
|
There are probably bugs in lziprecover. There are certainly errors and
|
||||||
|
@ -429,9 +519,9 @@ for all eternity, if not longer.
|
||||||
by running `lziprecover --version'.
|
by running `lziprecover --version'.
|
||||||
|
|
||||||
|
|
||||||
File: lziprecover.info, Node: Concept Index, Prev: Problems, Up: Top
|
File: lziprecover.info, Node: Concept index, Prev: Problems, Up: Top
|
||||||
|
|
||||||
Concept Index
|
Concept index
|
||||||
*************
|
*************
|
||||||
|
|
||||||
|