--- safecopy-1.6.orig/configure.in +++ safecopy-1.6/configure.in @@ -1,7 +1,7 @@ #Process this file with autoconf to produce a configure script. AC_INIT(configure.in) -AM_INIT_AUTOMAKE(safecopy, 1.5) +AM_INIT_AUTOMAKE(safecopy, 1.6) AC_PREREQ(2.5) #AC_ISC_POSIX --- safecopy-1.6.orig/configure +++ safecopy-1.6/configure @@ -2118,7 +2118,7 @@ # Define the identity of the package. PACKAGE=safecopy - VERSION=1.5 + VERSION=1.6 cat >>confdefs.h <<_ACEOF --- safecopy-1.6.orig/ChangeLog +++ safecopy-1.6/ChangeLog @@ -59,3 +59,6 @@ - Added documentation for simulation benchmark creation. - Moved test library in source tree and renamed to "simulator". - Added benchmarking subproject. + +2009.09.09 +- Fixed a bug with badblock include file handling ( ID: 2854324 ) --- safecopy-1.6.orig/src/safecopy.c +++ safecopy-1.6/src/safecopy.c @@ -1148,12 +1148,12 @@ // if so, proceed as usual, // otherwise seek to the next badblock in input tmp_pos=(readposition+startoffset)/iblocksize; - if (tmp_pos>lastsourceblock) { - tmp=NULL; - do { + if (tmp_pos!=lastsourceblock) { + tmp=textbuffer; + while (tmp!=NULL && lastsourceblock +Download: http://safecopy.sourceforge.net/ + +Files: * +Copyright: (C) 2005 Corvus Corax +License: GPL-2 + 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; version 2 + of the License. + . + 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; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + . + On Debian systems, the complete text of the GNU General Public License + can be found in /usr/share/common-licenses/GPL-2 file. + +Files: debian/* +Copyright: + (C) 2008-2009 Juan Angulo Moreno + (C) 2008-2009 Daniel Baumann +License: GPL-3+ + 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 3 of the License, 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. If not, see . + . + On Debian systems, the complete text of the GNU General Public License + can be found in /usr/share/common-licenses/GPL-3 file. --- safecopy-1.6.orig/debian/compat +++ safecopy-1.6/debian/compat @@ -0,0 +1 @@ +7 --- safecopy-1.6.orig/debian/control +++ safecopy-1.6/debian/control @@ -0,0 +1,19 @@ +Source: safecopy +Section: admin +Priority: optional +Maintainer: Debian Forensics +Uploaders: Juan Angulo Moreno +Build-Depends: debhelper (>= 7.0.50~), autotools-dev +Standards-Version: 3.8.3 +Homepage: http://safecopy.sourceforge.net +Vcs-Browser: http://git.debian.org/?p=forensics/safecopy.git +Vcs-Git: git://git.debian.org/forensics/safecopy.git + +Package: safecopy +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Copy utility ignoring errors + Safecopy is a data recovery tool which tries to extract as much data as + possible from a seekable, but problematic (i.e. damaged sectors) source - like + floppy drives, harddisk partitions, CDs, ..., where other tools like dd would + fail due to I/O errors. --- safecopy-1.6.orig/debian/watch +++ safecopy-1.6/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://sf.net/safecopy/safecopy-(.*)\.tar\.gz --- safecopy-1.6.orig/debian/changelog +++ safecopy-1.6/debian/changelog @@ -0,0 +1,72 @@ +safecopy (1.6-1build1) precise; urgency=low + + * No-change rebuild to drop spurious libsfgcc1 dependency on armhf. + + -- Adam Conrad Fri, 02 Dec 2011 21:19:12 -0700 + +safecopy (1.6-1) unstable; urgency=low + + [ Christophe Monniez ] + * Merging upstream version 1.6. + + -- Michael Prokop Thu, 05 Nov 2009 00:40:59 +0100 + +safecopy (1.5-1) unstable; urgency=low + + [ Daniel Baumann ] + * Minimizing rules file. + * Adding stuff in rules that doesn't get done by dh automatically. + + [ Christophe Monniez ] + * Merging upstream version 1.5. + * Filling out the man page (Closes: #541339). + + [ Michael Prokop ] + * Update to Standards-Version 3.8.3 (no further changes). + * Update VCS-* headers (moved to alioth). + * Bump build dependency on debhelper to >= 7.0.50~. + + -- Michael Prokop Fri, 25 Sep 2009 01:18:18 +0200 + +safecopy (1.3-2) unstable; urgency=low + + * Updating package to standards version 3.8.2. + * Adding lintian overrides. + + -- Daniel Baumann Thu, 09 Jul 2009 12:35:49 +0200 + +safecopy (1.3-1) unstable; urgency=low + + * Merging upstream version 1.3. + + -- Daniel Baumann Thu, 28 May 2009 23:21:36 +0200 + +safecopy (0.2-2) unstable; urgency=low + + * Adding myself to copyright. + * Improving description, thanks to Loic Minier + (Closes: #520096, #520208). + * Tidy rules file. + * Updating to standards 3.8.1. + + -- Daniel Baumann Thu, 28 May 2009 22:27:36 +0200 + +safecopy (0.2-1) unstable; urgency=low + + [ Juan Angulo Moreno ] + * Initial release (Closes: #512208). + + [ Daniel Baumann ] + * Removing useless whitespaces at EOF and EOL. + * Updating vcs fields in control. + * Rewrapping package long description to 80 chars a line in control. + * Crorrecting copyright file. + * Removing useless dirs debhelper file. + * Removing AUTHORS from docs, doesn't contain new information over copyright + file. + * Removing NEWS from docs, doesn't contain new information over ChangeLog. + * Reordering rules file. + * Moving out manpage of debian directory to subdirectory. + * Prefixing debhelper files with package name. + + -- Daniel Baumann Tue, 20 Jan 2009 21:22:26 +0100 --- safecopy-1.6.orig/debian/safecopy.docs +++ safecopy-1.6/debian/safecopy.docs @@ -0,0 +1 @@ +README --- safecopy-1.6.orig/debian/rules +++ safecopy-1.6/debian/rules @@ -0,0 +1,15 @@ +#!/usr/bin/make -f + +%: + dh ${@} + +override_dh_auto_clean: + dh_auto_clean + + rm -f config.guess config.sub + +override_dh_auto_configure: + [ -r /usr/share/misc/config.guess ] && cp -f /usr/share/misc/config.guess config.guess + [ -r /usr/share/misc/config.sub ] && cp -f /usr/share/misc/config.sub config.sub + + dh_auto_configure -- LDFLAGS="-Wl,-z,defs" --- safecopy-1.6.orig/debian/manpages/safecopy.1 +++ safecopy-1.6/debian/manpages/safecopy.1 @@ -0,0 +1,266 @@ +.TH "SAFECOPY" "1" "August 2009" "" "" +.SH "NAME" +SAFECOPY \- A data recovery tool +.SH "SYNOPSIS" +.B SAFECOPY +.RB [OPTIONS] +.RB SOURCE +.RB TARGET +.SH "DESCRIPTION" +A data recovery tool. +.PP +.PP +Safecopy is a data recovery tool which tries to extract as much data as +possible from a seekable, but problematic (i.e. damaged sectors) +source \- like floppy drives, harddisk partitions, CDs, ..., where +other tools like dd would fail doe to I/O errors. +.PP +Safecopy tries to get as much data from the source as possible without +device dependent tricks. For example to get an ISO image from a copy +protected or otherwise damaged CD\-ROM, cdrdao and bin2iso would possibly +do a better and faster job. +.PP +Safecopy comes with preset options (named stages) to ease its use. +These presets can be overridden by individual options. +.SH "OPTIONS" +Usage: safecopy [options] +.TP +.B \-b +Blocksize, also used for skipping offset when searching for the end of a +bad area. Set this to physical sectorsize of your media. +.br +Default: 1* +.br +If is an integer, then the unit is in bytes. +.br +If is followed by the percentage sign, it +express a percentage of the whole file/device size. +.br +If is followed by a star sign, it means +a number of times the block size reported by the operating system. +.TP +.B \-f +Size when skipping over badblocks. +Higher values put less strain on dammaged hardware, +but on the other hand, you might miss good areas +in between two bad ones. +.br +Default value is 16*. +.br +If is an integer, then the unit is in bytes. +.br +If is followed by the percentage sign, it +express a percentage of the whole file/device size. +.br +If is followed by a star sign, it means +a number of times the block size. See option \-b. +.TP +.B \-r +Resolution when searching for the exact beginning or end of a bad area +Bigger values increase performace at potential cost of valid data +close to damaged areas. +.br +Default: 1* +.br +If is an integer, then the unit is in bytes. +.br +If is followed by the percentage sign, it +express a percentage of the whole file/device size. +.br +If is followed by a star sign, it means +a number of times the block size. See option \-b. +.TP +.B \-R +Number of read attempts on the first bad block of a damaged area +with minimum resolution. More retries can sometimes recover a weak sector, +but at the cost of additional strain. +.br +Default: 3 +.TP +.B \-Z +On each error, force seek the read head from start to +end of the source device as often as specified. +That takes times, create additional strain and might not be supported +by all devices or drivers. +.br +Default: 1 +.TP +.B \-L +Use low level device calls as specified by the mode number. +.br +Where mode number can be: +.br +0: Do not use low level device calls. +.br +1: Attempt low level device calls for error recovery only. +.br +2: Always use low level device calls if available. +.br +Default: 1 +.TP +.B \-\-sync +.br +Use synchronized read calls (disable driver buffering). +Safecopy will use O_DIRECT if supported by the operating system and +O_SYNC otherwise. +.br +Default: Asynchronous read buffering. +.TP +.B \-s +Start position where to start reading. Will correspond +to position 0 in the destination file. +.br +Default: block 0 +.TP +.B \-l +Length of data to be read. +.br +Default: size of input file. +.TP +.B \-I +Incremental mode. Assume the target file already exists and has holes +specified in the badblockfile. +.br +It will attempt to retrieve more data from the listed blocks or from +beyond the file size of the target file only. +.br +WARNING: Without this option, the destination file will be emptied prior +to writing. +.br +Use \-I /dev/null if you want to continue a previous run of safecopy +without a badblock list file. +.br +Default: None +.TP +.B \-i +Blocksize to interpret the badblockfile given with \-I. +.br +Default: Blocksize as specified by \-b. +.TP +.B \-X +Exclusion mode. If used together with \-I, excluded blocks override +included ones. Safecopy will not read or write any data from areas covered +by excluded blocks. +.br +Default: None +.TP +.B \-x +Blocksize to interpret the badblockfile given with \-X. +.br +Default: blocksize as specified by \-b +.TP +.B \-o +Write a badblocks/e2fsck compatible bad block file. +.br +Default: None +.TP +.B \-S +Use an external script foir seeking in input file. This might be useful for +tape devices or similar. +.br +Seekscript must be an executable that takes the number of blocks to be skipped +as argv1 (1-64) the blocksize in bytes as argv2 and the current position as +argv3. +.br +Return values needs to be the number of blocks successfully skipped, or 0 to +indicate seek failure. The external seekscript will only be used if lseek() +fails and we need to skip over data. +.br +Default: None +.TP +.B \-M +Mark unrecovered data with this string instead of skipping it. This helps in +later on rescued file system images. +.br +The default behavior is to zero the unreadable data on creation of the output +files, and leaving the data as it is on any later run. +.br +WARNING: when used in combination with incremental mode (\-I), this may +overwrite data in any block specified in the badblockfile. +Blocks not in the badblockfile, or covered by those specified in the \-X file +are safe from being overwritten. +.br +Default: None +.TP +.B \-\-debug +Enable debug output. Level is a bit field, add values together for more +informations as follow: +.br +1 program flow +.br +2 IO control +.br +4 badblock marking +.br +8 seeking +.br +16 incremental mode +.br +32 exclude mode +.br +Use 255 for all debug output. +.br +Default: 0 +.TP +.B \-T +Write sector read timing information into this file for later analysis. +.br +Default: None +.TP +.B \-h | \-\-help +Show a maybe more detailed help. +.SH "PRESETS OPTIONS" +.TP +.B \-\-stage1 +Preset to rescue most of the data fast, using no retries and avoiding bad +areas. +.br +Presets: \-f 10% \-r 10% \-R 1 \-Z 0 \-L 2 \-M BaDbloCk \-o stage1.badblocks +.TP +.B \-\-stage2 +Preset to rescue more data, using no retries but searching for exact ends +of bad areas. +.br +Presets: \-f 128* \-r 1* \-R 1 \-Z 0 \-L 2 \-I stage1.badblocks +\-o stage2.badblocks +.TP +.B \-\-stage3 +Preset to rescue everything that can be rescued using maximum retries, +head realignment tricks and low level access. +.br +Presets: \-f 1* \-r 1* \-R 4 \-Z 1 \-L 2 \-I stage2.badblocks +\-o stage3.badblocks +.SH "DESCRIPTION OF OUTPUT" +.TP +.B . : +Between 1 and 1024 blocks successfully read. +.TP +.B _ : +Read was incomplete. (possibly end of file) blocksize is reduced to +read the rest. +.TP +.B > : +Read failed, reducing blocksize to read partial data. +.TP +.B [xx](+yy) : +current block and number of blocks (or bytes) continuously read +successfully up to this point. +.TP +.B X : +Read failed on block with minimum blocksize and is skipped. Unrecoverable +error, destination file is padded with zeros. Data is now skipped until +end of the unreadable area is reached. +.TP +.B < : +Successfull read\- test after the end of a bad area causes backtracking to +search for the first readable data. +.TP +.B [xx](+yy) : +Current block and number of blocks (or bytes) of recent continuous +unreadable data. +.SH "AUTHOR" +safecopy was written by Corvus Corax (corvuscorax@cybertrench.com) +.PP +This manual page was originally written by Juan Angulo Moreno + for the Debian project (but may be used by others). +It was filled out by Christophe Monniez .