diff --git a/AUTHORS b/AUTHORS index c02d11d..74d2272 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,6 +1,6 @@ GNU ddrescue was written by Antonio Diaz Diaz. -Thanks to Dave Burton for his ideas about the logfile format, the raw +Thanks to Dave Burton for his ideas about the mapfile format, the raw devices, and more. Thanks also to the many people who have contributed useful ideas, testing, diff --git a/ChangeLog b/ChangeLog index 3c316b4..1fa15c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,20 +1,18 @@ -2019-12-17 Antonio Diaz Diaz +2020-02-21 Antonio Diaz Diaz - * Version 1.25-rc1 released. + * Version 1.25 released. + * block.h: Add default constructors to classes Block and Sblock. + (Reported by Rosen Penev). + * check.sh: Quote all file name variables to allow names with spaces. + (Reported by David Morrison). * In rescue mode, join non-finished subsectors read from mapfile. (Reported by David Burton). * mapbook.cc (update_mapfile): Exclude writing time from intervals. (Reported by David Burton). + * rescuebook.cc (extend_outfile_size): Use ftruncate if it works. * Print large numbers in groups of 3 digits separated by underscores. * main.cc: Set a valid invocation_name even if argc == 0. -2019-04-12 Antonio Diaz Diaz - - * Version 1.25-pre1 released. - * rescuebook.cc (extend_outfile_size): Use ftruncate if it works. - * block.h: Add default constructors to classes Block and Sblock. - (Reported by Rosen Penev). - 2019-02-24 Antonio Diaz Diaz * Version 1.24 released. @@ -213,7 +211,7 @@ (whichever is smaller), rounded to the next multiple of sector size. * Set current_pos to end of block when reading backwards. - * The '-E, --max-error-rate' option now checks the rate of + * The option '-E, --max-error-rate' now checks the rate of actually failed reads, not the growth of error size. * The option '-v, --verbose' now increases verbosity if repeated. * Changed quote characters in messages as advised by GNU Standards. @@ -267,7 +265,7 @@ * main.cc: Outfile is now created with mode 0666 if umask allows it. * main.cc: New constant 'o_binary'. * Makefile.in: Added quotes to directory names. - * Makefile.in: Added '--name' option to help2man invocation. + * Makefile.in: Added option '--name' to help2man invocation. * check.sh: Use 'test1' instead of 'COPYING' for testing. * Use 'time_t' instead of 'long' for time variables. @@ -336,7 +334,7 @@ * An interrupted retry pass is now resumed instead of reinitiated. * Perfect resumability if interrupted during trimming or splitting. * ddrescue.cc (set_signals): Handle also SIGHUP and SIGTERM. - * '--quiet' option also quiets error messages. + * Option '--quiet' now also quiets error messages. * Print a more informative error message when reading an old logfile. * Added note to ddrescue.texinfo about old logfiles. * Added some consistency checks. @@ -445,7 +443,7 @@ * Version 0.1 released. -Copyright (C) 2004-2019 Antonio Diaz Diaz. +Copyright (C) 2004-2020 Antonio Diaz Diaz. This file is a collection of facts, and thus it is not copyrightable, but just in case, you have unlimited permission to copy, distribute, and diff --git a/INSTALL b/INSTALL index 4f03883..8f28e17 100644 --- a/INSTALL +++ b/INSTALL @@ -44,8 +44,8 @@ the main archive. Another way ----------- You can also compile ddrescue into a separate directory. -To do this, you must use a version of 'make' that supports the 'VPATH' -variable, such as GNU 'make'. 'cd' to the directory where you want the +To do this, you must use a version of 'make' that supports the variable +'VPATH', such as GNU 'make'. 'cd' to the directory where you want the object files and executables to go and run the 'configure' script. 'configure' automatically checks for the source code in '.', in '..', and in the directory that 'configure' is in. @@ -58,7 +58,7 @@ After running 'configure', you can run 'make' and 'make install' as explained above. -Copyright (C) 2004-2019 Antonio Diaz Diaz. +Copyright (C) 2004-2020 Antonio Diaz Diaz. This file is free documentation: you have unlimited permission to copy, distribute, and modify it. diff --git a/NEWS b/NEWS index 9aead85..c27902b 100644 --- a/NEWS +++ b/NEWS @@ -1,21 +1,24 @@ Changes in version 1.25: +Default constructors have been added to classes Block and Sblock. +(Reported by Rosen Penev). + +A failure in 'make check', happening when testing under a directory with +spaces in the name, has been fixed. (Reported by David Morrison). + In rescue mode, any non-finished subsector that is now found during the initial read of the mapfile will be joined to its corresponding sector (if it is also not finished), marking the whole sector with the less processed state, so as to make sure that sub-sector data will not be discarded from a -succesful read during the rescue. (A subsector is a block smaller than +successful read during the rescue. (A subsector is a block smaller than sector size). (Reported by David Burton). The time needed to write the mapfile is now excluded from the mapfile save and sync intervals. (It seems that some mapfiles take 7 seconds to write). (Reported by David Burton). -Large numbers in messages (like device sizes) are now printed in groups of 3 -digits separated by underscore '_' characters to make them more readable. - Ddrescue now extends the output file using 'ftruncate' if it works, because it is slightly more efficient. -Default constructors have been added to classes Block and Sblock. -(Reported by Rosen Penev). +Large numbers in messages (like device sizes) are now printed in groups of 3 +digits separated by underscore '_' characters to make them more readable. diff --git a/README b/README index 7f86eff..5d0e4cb 100644 --- a/README +++ b/README @@ -75,7 +75,7 @@ so can be used for any kind of device supported by your kernel (ATA, SATA, SCSI, old MFM drives, floppy discs, or even flash media cards like SD). -Copyright (C) 2004-2019 Antonio Diaz Diaz. +Copyright (C) 2004-2020 Antonio Diaz Diaz. This file is free documentation: you have unlimited permission to copy, distribute, and modify it. diff --git a/arg_parser.cc b/arg_parser.cc index 1a06617..6cc1d17 100644 --- a/arg_parser.cc +++ b/arg_parser.cc @@ -1,5 +1,5 @@ /* Arg_parser - POSIX/GNU command line argument parser. (C++ version) - Copyright (C) 2006-2019 Antonio Diaz Diaz. + Copyright (C) 2006-2020 Antonio Diaz Diaz. This library is free software. Redistribution and use in source and binary forms, with or without modification, are permitted provided diff --git a/arg_parser.h b/arg_parser.h index e927913..367f317 100644 --- a/arg_parser.h +++ b/arg_parser.h @@ -1,5 +1,5 @@ /* Arg_parser - POSIX/GNU command line argument parser. (C++ version) - Copyright (C) 2006-2019 Antonio Diaz Diaz. + Copyright (C) 2006-2020 Antonio Diaz Diaz. This library is free software. Redistribution and use in source and binary forms, with or without modification, are permitted provided diff --git a/block.cc b/block.cc index 415478d..314ea47 100644 --- a/block.cc +++ b/block.cc @@ -1,5 +1,5 @@ /* GNU ddrescue - Data recovery tool - Copyright (C) 2004-2019 Antonio Diaz Diaz. + Copyright (C) 2004-2020 Antonio Diaz Diaz. 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 diff --git a/block.h b/block.h index 44086f3..69bd633 100644 --- a/block.h +++ b/block.h @@ -1,5 +1,5 @@ /* GNU ddrescue - Data recovery tool - Copyright (C) 2004-2019 Antonio Diaz Diaz. + Copyright (C) 2004-2020 Antonio Diaz Diaz. 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 diff --git a/command_mode.cc b/command_mode.cc index 42a45b8..90748f7 100644 --- a/command_mode.cc +++ b/command_mode.cc @@ -1,5 +1,5 @@ /* GNU ddrescue - Data recovery tool - Copyright (C) 2004-2019 Antonio Diaz Diaz. + Copyright (C) 2004-2020 Antonio Diaz Diaz. 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 diff --git a/configure b/configure index c356b12..070f317 100755 --- a/configure +++ b/configure @@ -1,12 +1,12 @@ #! /bin/sh # configure script for GNU ddrescue - Data recovery tool -# Copyright (C) 2004-2019 Antonio Diaz Diaz. +# Copyright (C) 2004-2020 Antonio Diaz Diaz. # # This configure script is free software: you have unlimited permission # to copy, distribute, and modify it. pkgname=ddrescue -pkgversion=1.25-rc1 +pkgversion=1.25 progname=ddrescue use_non_posix= srctrigger=doc/${pkgname}.texi @@ -174,7 +174,7 @@ echo "LDFLAGS = ${LDFLAGS}" rm -f Makefile cat > Makefile << EOF # Makefile for GNU ddrescue - Data recovery tool -# Copyright (C) 2004-2019 Antonio Diaz Diaz. +# Copyright (C) 2004-2020 Antonio Diaz Diaz. # This file was generated automatically by configure. Don't edit. # # This Makefile is free software: you have unlimited permission diff --git a/ddrescuelog.cc b/ddrescuelog.cc index 8c08932..d46c614 100644 --- a/ddrescuelog.cc +++ b/ddrescuelog.cc @@ -1,5 +1,5 @@ /* GNU ddrescuelog - Tool for ddrescue mapfiles - Copyright (C) 2011-2019 Antonio Diaz Diaz. + Copyright (C) 2011-2020 Antonio Diaz Diaz. 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 @@ -53,6 +53,9 @@ void show_help( const int hardbs ) "rescue status, and can delete a mapfile if the rescue is done. Ddrescuelog\n" "operations can be restricted to one or several parts of the mapfile if the\n" "domain setting options are used.\n" + "\nUse '-' as mapfile to read the mapfile from standard input\n" + "(also in the options taking a mapfile argument) or to write the mapfile\n" + "created by '--create-mapfile' to standard output.\n" "\nNOTE: In versions of ddrescue prior to 1.20 the mapfile was called\n" "'logfile'. The format is the same; only the name has changed.\n" "\nUsage: %s [options] mapfile\n", invocation_name ); @@ -84,9 +87,7 @@ void show_help( const int hardbs ) " -y, --and-mapfile= AND the finished blocks in file with mapfile\n" " -z, --or-mapfile= OR the finished blocks in file with mapfile\n" " --shift shift all block positions by (opos - ipos)\n" - "\nUse '-' to read a mapfile from standard input or to write the mapfile\n" - "created by '--create-mapfile' to standard output.\n" - "Numbers may be in decimal, hexadecimal, or octal, and may be followed by a\n" + "\nNumbers may be in decimal, hexadecimal, or octal, and may be followed by a\n" "multiplier: s = sectors, k = 1000, Ki = 1024, M = 10^6, Mi = 2^20, etc...\n" "\nExit status: 0 for a normal exit, 1 for environmental problems (file\n" "not found, invalid flags, I/O errors, etc), 2 to indicate a corrupt or\n" @@ -120,7 +121,7 @@ void parse_types( const std::string & arg, if( types1.empty() || types2.empty() ) error = true; if( error ) { - show_error( "Invalid type for 'change-types' option.", 0, true ); + show_error( "Invalid type for option 'change-types'.", 0, true ); std::exit( 1 ); } if( types1.size() > types2.size() ) @@ -135,7 +136,7 @@ void parse_2types( const std::string & arg, if( arg.size() != 2 || arg[0] == arg[1] || !Sblock::isstatus( arg[0] ) || !Sblock::isstatus( arg[1] ) ) { - show_error( "Invalid type for 'create-mapfile' option.", 0, true ); + show_error( "Invalid type for option 'create-mapfile'.", 0, true ); std::exit( 1 ); } type1 = Sblock::Status( arg[0] ); @@ -148,7 +149,7 @@ void parse_type( const std::string & arg, Sblock::Status & complete_type ) if( arg.empty() ) return; if( arg.size() != 1 || !Sblock::isstatus( arg[0] ) ) { - show_error( "Invalid type for 'complete-mapfile' option.", 0, true ); + show_error( "Invalid type for option 'complete-mapfile'.", 0, true ); std::exit( 1 ); } complete_type = Sblock::Status( arg[0] ); diff --git a/doc/ddrescue.1 b/doc/ddrescue.1 index 6f1003d..4f7e9a3 100644 --- a/doc/ddrescue.1 +++ b/doc/ddrescue.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.46.1. -.TH DDRESCUE "1" "December 2019" "ddrescue 1.25-rc1" "User Commands" +.TH DDRESCUE "1" "February 2020" "ddrescue 1.25" "User Commands" .SH NAME ddrescue \- data recovery tool .SH SYNOPSIS @@ -10,8 +10,10 @@ GNU ddrescue is a data recovery tool. It copies data from one file or block device (hard disc, cdrom, etc) to another, trying to rescue the good parts first in case of read errors. .PP -Always use a mapfile unless you know you won't need it. Without a -mapfile, ddrescue can't resume a rescue, only reinitiate it. +Always use a mapfile unless you know you won't need it. Without a mapfile, +ddrescue can't resume a rescue, only reinitiate it. Be careful to not +specify by mistake an old mapfile from an unrelated rescue. +.PP NOTE: In versions of ddrescue prior to 1.20 the mapfile was called \&'logfile'. The format is the same; only the name has changed. .PP @@ -202,7 +204,7 @@ Ddrescue home page: http://www.gnu.org/software/ddrescue/ddrescue.html .br General help using GNU software: http://www.gnu.org/gethelp .SH COPYRIGHT -Copyright \(co 2019 Antonio Diaz Diaz. +Copyright \(co 2020 Antonio Diaz Diaz. License GPLv2+: GNU GPL version 2 or later .br This is free software: you are free to change and redistribute it. diff --git a/doc/ddrescue.info b/doc/ddrescue.info index 6eca477..33c11ea 100644 --- a/doc/ddrescue.info +++ b/doc/ddrescue.info @@ -12,7 +12,7 @@ File: ddrescue.info, Node: Top, Next: Introduction, Up: (dir) GNU ddrescue Manual ******************* -This manual is for GNU ddrescue (version 1.25-rc1, 17 December 2019). +This manual is for GNU ddrescue (version 1.25, 21 February 2020). * Menu: @@ -36,7 +36,7 @@ This manual is for GNU ddrescue (version 1.25-rc1, 17 December 2019). * Concept index:: Index of concepts - Copyright (C) 2004-2019 Antonio Diaz Diaz. + Copyright (C) 2004-2020 Antonio Diaz Diaz. This manual is free documentation: you have unlimited permission to copy, distribute, and modify it. @@ -196,6 +196,11 @@ another. The key difference is that ddrescue uses a sophisticated algorithm to copy data from failing drives causing them as little additional damage as possible. + Versions of ddrescue prior to 1.19 used a divide-and-conquer +strategy to rescue the difficult parts of the drive. But that caused a +lot of head movement, which is bad for the drive. Therefore, newer +versions try to minimize head movement to minimize drive damage. + Ddrescue manages efficiently the status of the rescue in progress and tries to rescue the good parts first, scheduling reads inside bad (or slow) areas for later. This maximizes the amount of data that can be @@ -304,7 +309,7 @@ File: ddrescue.info, Node: Output, Next: Invoking ddrescue, Prev: Algorithm, The output of ddrescue looks like this: - GNU ddrescue 1.25-rc1 + GNU ddrescue 1.25 Press Ctrl-C to interrupt Initial status (read from mapfile) rescued: 1665 MB, tried: 0 B, bad-sector: 0 B, bad areas: 0 @@ -420,7 +425,8 @@ The format for running ddrescue is: INFILE and OUTFILE may be files, devices, or partitions. MAPFILE is a regular file and must be placed in an existing directory. If MAPFILE -does not exist, ddrescue will create it. +does not exist, ddrescue will create it. Be careful to not specify by +mistake an old MAPFILE from an unrelated rescue. Ddrescue tries to create a backup copy of the mapfile, with the name MAPFILE.bak, every time it is going to overwrite a fsynced MAPFILE. @@ -469,7 +475,7 @@ mapfile, ddrescue can't resume a rescue, only reinitiate it. the initial read of the mapfile will be joined to its corresponding sector (if it is also not finished), marking the whole sector with the less processed state, so as to make sure - that sub-sector data will not be discarded from a succesful read + that sub-sector data will not be discarded from a successful read during the rescue. (A subsector is a block smaller than sector size). Subsector joining is performed in all the mapfile, not only in the rescue domain. @@ -493,14 +499,14 @@ mapfile, ddrescue can't resume a rescue, only reinitiate it. from devices of undefined size (like raw devices), when the drive returns an incorrect size, or when reading from a partial copy. It can only be used after a first rescue attempt, possibly limited - with the '--size' option, has produced a complete MAPFILE. + with the option '--size', has produced a complete MAPFILE. '-d' '--idirect' Use direct disc access (*note Direct disc access::) to read from - INFILE, bypassing the kernel cache. (Opens the file with the - O_DIRECT flag). Sector size must be correctly set for this to - work. Not all systems support this. + INFILE, bypassing the kernel cache. (Opens the file with the flag + 'O_DIRECT'). Sector size must be correctly set for this to work. + Not all systems support this. If your system does not support direct disc access, ddrescue will warn you. If the sector size is not correctly set, an unaligned @@ -509,8 +515,8 @@ mapfile, ddrescue can't resume a rescue, only reinitiate it. '-D' '--odirect' Use direct disc access to write to OUTFILE, bypassing the kernel - cache. (Opens the file with the O_DIRECT flag). Sector size must be - correctly set for this to work. Not all systems support this. + cache. (Opens the file with the flag 'O_DIRECT'). Sector size must + be correctly set for this to work. Not all systems support this. If your system does not support direct disc access, ddrescue will warn you. If the sector size is not correctly set, a write error @@ -575,7 +581,7 @@ mapfile, ddrescue can't resume a rescue, only reinitiate it. '--input-position=BYTES' Starting position of the rescue domain in INFILE, in bytes. Defaults to 0. This is not the point from which ddrescue starts - copying. (For example, if you pass the '--reverse' option to + copying. (For example, if you pass the option '--reverse' to ddrescue, it starts copying from the end of the rescue domain). In fill mode it refers to a position in the INFILE of the original rescue run. See the chapter Fill mode (*note Fill mode::) for @@ -683,12 +689,12 @@ mapfile, ddrescue can't resume a rescue, only reinitiate it. '-p' '--preallocate' - Preallocate space on disc for OUTFILE. Only space for regular - files can be preallocated. If preallocation succeeds, rescue will - not fail due to lack of free space on disc. If ddrescue can't + Preallocate space on disc for OUTFILE. Only space for regular files + can be preallocated. If preallocation succeeds, rescue will not + fail due to lack of free space on disc. If ddrescue can't determine the size to preallocate, you may need to specify it with - some combination of the '--input-position', '--output-position', - '--size', and '--domain-mapfile' options. + some combination of the options '--input-position', + '--output-position', '--size', and '--domain-mapfile'. '-P[LINES]' '--data-preview[=LINES]' @@ -1020,7 +1026,7 @@ Character Meaning And here is an example mapfile: - # Mapfile. Created by GNU ddrescue version 1.25-rc1 + # Mapfile. Created by GNU ddrescue version 1.25 # Command line: ddrescue -d -c18 /dev/fd0 fdimage mapfile # Start time: 2015-07-21 09:37:44 # Current time: 2015-07-21 09:38:19 @@ -1065,7 +1071,7 @@ make room for the mapfile, and press to retry. to try an emergency save and exit. Ddrescue will try to write the mapfile to the file 'ddrescue.map' in the current directory or, if this fails, to '$HOME/ddrescue.map'. If the mapfile is written -succesfully, ddrescue will exit with status 1. Else it will print the +successfully, ddrescue will exit with status 1. Else it will print the above message again. Or you may press followed by to quit and exit with @@ -1304,14 +1310,14 @@ accesses and grouping them. In this case you may want to use direct disc access for INFILE, or read from a raw device, to bypass the kernel cache and rescue more of your data. - NOTE! Sector size must be correctly set with the '--sector-size' -option for direct disc access to work. + NOTE! Sector size must be correctly set with the option +'--sector-size' for direct disc access to work. NOTE: Direct disc access can copy arbitrary domains by reading whole sectors and then writing only the requested part. This is the only case where ddrescue will try to read data outside of the rescue domain. - Try the '--idirect' option first. If direct disc access is not + Try the option '--idirect' first. If direct disc access is not available in your system, try raw devices. Read your system documentation to find how to bind a raw device to a regular block device. Some OSs provide raw access through especial device names, like @@ -1364,7 +1370,7 @@ failed command (for example because of wrong arguments), and "error: ERROR MESSAGE\n" for serious or fatal errors like write errors. If end-of-file is detected on standard input, ddrescue discards any -partial command being read and executes a 'f' command. +partial command being read and executes the 'f' (finish) command. All ddrescue commands are single characters, though some require additonal parameters separated by spaces. Only one command is allowed @@ -1408,18 +1414,18 @@ File: ddrescue.info, Node: Fill mode, Next: Generate mode, Prev: Command mode 13 Fill mode ************ -When ddrescue is invoked with the '--fill-mode' option it operates in +When ddrescue is invoked with the option '--fill-mode' it operates in "fill mode", which is different from the default "rescue mode". That -is, if you use the '--fill-mode' option, ddrescue does not rescue -anything. It only fills with data read from INFILE the blocks of -OUTFILE whose status character from MAPFILE coincides with one of the -type characters specified as argument to the '--fill-mode' option. +is, in "fill mode" ddrescue does not rescue anything. It only fills +with data read from INFILE the blocks of OUTFILE whose status character +from MAPFILE coincides with one of the type characters specified in the +argument to '--fill-mode'. - If the argument of the '--fill-mode' option contains an 'l', -ddrescue will write location data (position, sector number, and status) -into each sector filled. With bad sectors filled in this way, it should -be possible to retry the recovery of important files, as location of the -error is known by looking into the unfinished copy of the file. + If the argument to '--fill-mode' contains an 'l', ddrescue will +write location data (position, sector number, and status) into each +sector filled. With bad sectors filled in this way, it should be +possible to retry the recovery of important files, as the location of +the error is known by looking into the unfinished copy of the file. In fill mode INFILE does not need to be seekable and it may be of any size. If it is too small, the data will be duplicated as many times @@ -1437,7 +1443,7 @@ you should not set '--output-position', whereas when filling the OUTFILE of the original rescue run you should keep the original offset between '--input-position' and '--output-position'. - The '--fill-mode' option implies the '--complete-only' option. + The option '--fill-mode' implies '--complete-only'. In fill mode MAPFILE is updated to allow resumability when interrupted or in case of a crash, but as nothing is being rescued @@ -1523,15 +1529,15 @@ File: ddrescue.info, Node: Generate mode, Next: Ddrescuelog, Prev: Fill mode, 14 Generate mode **************** -When ddrescue is invoked with the '--generate-mode' option it operates +When ddrescue is invoked with the option '--generate-mode' it operates in "generate mode", which is different from the default "rescue mode". -That is, if you use the '--generate-mode' option, ddrescue does not -rescue anything. It only tries to generate a MAPFILE for later use. +That is, in "generate mode" ddrescue does not rescue anything. It only +tries to generate a MAPFILE for later use. - So you didn't read the manual and started ddrescue without a -MAPFILE. Now, two days later, your computer crashed and you can't know -how much data ddrescue managed to save. And even worse, you can't -resume the rescue; you have to restart it from the very beginning. + So you didn't read the manual and started ddrescue without a MAPFILE. +Now, two days later, your computer crashed and you can't know how much +data ddrescue managed to save. And even worse, you can't resume the +rescue; you have to restart it from the very beginning. Or maybe you started copying a drive with 'dd conv=noerror,sync' and are now in the same situation described above. In this case, note that @@ -1647,7 +1653,7 @@ by '--create-mapfile' to standard output. '--change-types=OLD_TYPES,NEW_TYPES' Change the status of every block in the rescue domain from one type in OLD_TYPES to the corresponding type in NEW_TYPES, much like - the 'tr' command does, and write the resulting mapfile to standard + the command 'tr' does, and write the resulting mapfile to standard output. OLD_TYPES and NEW_TYPES are strings of block status characters as defined in the chapter Mapfile structure (*note Mapfile structure::). Blocks whose status is not in OLD_TYPES are @@ -1752,7 +1758,7 @@ by '--create-mapfile' to standard output. '-o BYTES' '--output-position=BYTES' Starting position of the image of the rescue domain in the original - OUTFILE, in bytes. Is used by the '--list-blocks' option. + OUTFILE, in bytes. Is used by the option '--list-blocks'. Defaults to '--input-position'. '-p FILE' @@ -1877,30 +1883,30 @@ Concept index  Tag Table: Node: Top201 -Node: Introduction1572 -Node: Basic concepts4279 -Node: Important advice6537 -Node: Algorithm7614 -Node: Output13114 -Node: Invoking ddrescue17409 -Ref: --min-read-rate18413 -Ref: --max-bad-areas21843 -Ref: --max-error-rate22102 -Ref: --domain-mapfile27406 -Ref: --mapfile-interval37610 -Node: Mapfile structure41811 -Node: Emergency save44996 -Node: Optical media46452 -Ref: lziprecover-example49659 -Node: Examples50436 -Node: Direct disc access56044 -Node: Command mode58270 -Node: Fill mode60679 -Node: Generate mode65750 -Node: Ddrescuelog67690 -Node: Invoking ddrescuelog69984 -Node: Problems77918 -Node: Concept index78475 +Node: Introduction1568 +Node: Basic concepts4275 +Node: Important advice6533 +Node: Algorithm7610 +Node: Output13378 +Node: Invoking ddrescue17669 +Ref: --min-read-rate18751 +Ref: --max-bad-areas22186 +Ref: --max-error-rate22445 +Ref: --domain-mapfile27749 +Ref: --mapfile-interval37953 +Node: Mapfile structure42154 +Node: Emergency save45335 +Node: Optical media46792 +Ref: lziprecover-example49999 +Node: Examples50776 +Node: Direct disc access56384 +Node: Command mode58610 +Node: Fill mode61030 +Node: Generate mode66054 +Node: Ddrescuelog67972 +Node: Invoking ddrescuelog70266 +Node: Problems78200 +Node: Concept index78757  End Tag Table diff --git a/doc/ddrescue.texi b/doc/ddrescue.texi index ec27097..d659a19 100644 --- a/doc/ddrescue.texi +++ b/doc/ddrescue.texi @@ -6,8 +6,8 @@ @finalout @c %**end of header -@set UPDATED 17 December 2019 -@set VERSION 1.25-rc1 +@set UPDATED 21 February 2020 +@set VERSION 1.25 @dircategory GNU Packages @direntry @@ -56,7 +56,7 @@ This manual is for GNU ddrescue (version @value{VERSION}, @value{UPDATED}). @end menu @sp 1 -Copyright @copyright{} 2004-2019 Antonio Diaz Diaz. +Copyright @copyright{} 2004-2020 Antonio Diaz Diaz. This manual is free documentation: you have unlimited permission to copy, distribute, and modify it. @@ -209,6 +209,11 @@ another. The key difference is that ddrescue uses a sophisticated algorithm to copy data from failing drives causing them as little additional damage as possible. +Versions of ddrescue prior to 1.19 used a divide-and-conquer strategy to +rescue the difficult parts of the drive. But that caused a lot of head +movement, which is bad for the drive. Therefore, newer versions try to +minimize head movement to minimize drive damage. + Ddrescue manages efficiently the status of the rescue in progress and tries to rescue the good parts first, scheduling reads inside bad (or slow) areas for later. This maximizes the amount of data that can be @@ -441,7 +446,8 @@ ddrescue [@var{options}] @var{infile} @var{outfile} [@var{mapfile}] @var{infile} and @var{outfile} may be files, devices, or partitions. @var{mapfile} is a regular file and must be placed in an existing directory. -If @var{mapfile} does not exist, ddrescue will create it. +If @var{mapfile} does not exist, ddrescue will create it. Be careful to not +specify by mistake an old @var{mapfile} from an unrelated rescue. Ddrescue tries to create a backup copy of the mapfile, with the name @var{mapfile}.bak, every time it is going to overwrite a fsynced @@ -492,7 +498,7 @@ In rescue mode, any non-finished subsector that is found during the initial read of the mapfile will be joined to its corresponding sector (if it is also not finished), marking the whole sector with the less processed state, so as to make sure that sub-sector data will not be discarded from a -succesful read during the rescue. (A subsector is a block smaller than +successful read during the rescue. (A subsector is a block smaller than sector size). Subsector joining is performed in all the mapfile, not only in the rescue domain. @@ -514,13 +520,13 @@ read new data beyond @var{mapfile} limits. This is useful when reading from devices of undefined size (like raw devices), when the drive returns an incorrect size, or when reading from a partial copy. It can only be used after a first rescue attempt, possibly limited with the -@samp{--size} option, has produced a complete @var{mapfile}. +option @samp{--size}, has produced a complete @var{mapfile}. @item -d @itemx --idirect Use direct disc access (@pxref{Direct disc access}) to read from -@var{infile}, bypassing the kernel cache. (Opens the file with the -O_DIRECT flag). Sector size must be correctly set for this to work. Not +@var{infile}, bypassing the kernel cache. (Opens the file with the flag +@samp{O_DIRECT}). Sector size must be correctly set for this to work. Not all systems support this. If your system does not support direct disc access, ddrescue will warn @@ -530,7 +536,7 @@ will result and ddrescue will exit with status 1. @item -D @itemx --odirect Use direct disc access to write to @var{outfile}, bypassing the kernel -cache. (Opens the file with the O_DIRECT flag). Sector size must be +cache. (Opens the file with the flag @samp{O_DIRECT}). Sector size must be correctly set for this to work. Not all systems support this. If your system does not support direct disc access, ddrescue will warn @@ -598,7 +604,7 @@ from standard input. @itemx --input-position=@var{bytes} Starting position of the rescue domain in @var{infile}, in bytes. Defaults to 0. This is not the point from which ddrescue starts copying. -(For example, if you pass the @samp{--reverse} option to ddrescue, it +(For example, if you pass the option @samp{--reverse} to ddrescue, it starts copying from the end of the rescue domain). In fill mode it refers to a position in the @var{infile} of the original rescue run. See the chapter Fill mode (@pxref{Fill mode}) for details. @@ -706,12 +712,12 @@ reading data from the device. @item -p @itemx --preallocate -Preallocate space on disc for @var{outfile}. Only space for regular -files can be preallocated. If preallocation succeeds, rescue will not -fail due to lack of free space on disc. If ddrescue can't determine the -size to preallocate, you may need to specify it with some combination of -the @samp{--input-position}, @samp{--output-position}, @samp{--size}, -and @samp{--domain-mapfile} options. +Preallocate space on disc for @var{outfile}. Only space for regular files +can be preallocated. If preallocation succeeds, rescue will not fail due to +lack of free space on disc. If ddrescue can't determine the size to +preallocate, you may need to specify it with some combination of the options +@samp{--input-position}, @samp{--output-position}, @samp{--size}, and +@samp{--domain-mapfile}. @item -P[@var{lines}] @itemx --data-preview[=@var{lines}] @@ -1096,7 +1102,7 @@ If the problem can't be fixed, you may press @key{e} followed by @key{Return} to try an emergency save and exit. Ddrescue will try to write the mapfile to the file @file{ddrescue.map} in the current directory or, if this fails, to @file{$HOME/ddrescue.map}. If the -mapfile is written succesfully, ddrescue will exit with status 1. Else +mapfile is written successfully, ddrescue will exit with status 1. Else it will print the above message again. Or you may press @key{q} followed by @key{Return} to quit and exit with @@ -1380,14 +1386,14 @@ accesses and grouping them. In this case you may want to use direct disc access for @var{infile}, or read from a raw device, to bypass the kernel cache and rescue more of your data. -NOTE! Sector size must be correctly set with the @samp{--sector-size} -option for direct disc access to work. +NOTE! Sector size must be correctly set with the option @samp{--sector-size} +for direct disc access to work. NOTE: Direct disc access can copy arbitrary domains by reading whole sectors and then writing only the requested part. This is the only case where ddrescue will try to read data outside of the rescue domain. -Try the @samp{--idirect} option first. If direct disc access is not +Try the option @samp{--idirect} first. If direct disc access is not available in your system, try raw devices. Read your system documentation to find how to bind a raw device to a regular block device. Some OSs provide raw access through especial device names, like @@ -1448,7 +1454,7 @@ a failed command (for example because of wrong arguments), and errors. If end-of-file is detected on standard input, ddrescue discards any partial -command being read and executes a @samp{f} command. +command being read and executes the @samp{f} (finish) command. All ddrescue commands are single characters, though some require additonal parameters separated by spaces. Only one command is allowed per line. @@ -1492,19 +1498,18 @@ make room for @var{mapfile}, before trying to update it again. @chapter Fill mode @cindex fill Mode -When ddrescue is invoked with the @samp{--fill-mode} option it operates -in "fill mode", which is different from the default "rescue mode". That -is, if you use the @samp{--fill-mode} option, ddrescue does not rescue -anything. It only fills with data read from @var{infile} the blocks of -@var{outfile} whose status character from @var{mapfile} coincides with -one of the type characters specified as argument to the -@samp{--fill-mode} option. +When ddrescue is invoked with the option @samp{--fill-mode} it operates in +"fill mode", which is different from the default "rescue mode". That is, in +"fill mode" ddrescue does not rescue anything. It only fills with data read +from @var{infile} the blocks of @var{outfile} whose status character from +@var{mapfile} coincides with one of the type characters specified in the +argument to @samp{--fill-mode}. -If the argument of the @samp{--fill-mode} option contains an @samp{l}, -ddrescue will write location data (position, sector number, and status) -into each sector filled. With bad sectors filled in this way, it should -be possible to retry the recovery of important files, as location of the -error is known by looking into the unfinished copy of the file. +If the argument to @samp{--fill-mode} contains an @samp{l}, ddrescue will +write location data (position, sector number, and status) into each sector +filled. With bad sectors filled in this way, it should be possible to retry +the recovery of important files, as the location of the error is known by +looking into the unfinished copy of the file. In fill mode @var{infile} does not need to be seekable and it may be of any size. If it is too small, the data will be duplicated as many times @@ -1522,7 +1527,7 @@ you should not set @samp{--output-position}, whereas when filling the @var{outfile} of the original rescue run you should keep the original offset between @samp{--input-position} and @samp{--output-position}. -The @samp{--fill-mode} option implies the @samp{--complete-only} option. +The option @samp{--fill-mode} implies @samp{--complete-only}. In fill mode @var{mapfile} is updated to allow resumability when interrupted or in case of a crash, but as nothing is being rescued @@ -1621,16 +1626,15 @@ cp -a /mnt/cdimage/my_thesis.txt /safe/place/my_thesis.txt @chapter Generate mode @cindex generate Mode -When ddrescue is invoked with the @samp{--generate-mode} option it -operates in "generate mode", which is different from the default "rescue -mode". That is, if you use the @samp{--generate-mode} option, ddrescue -does not rescue anything. It only tries to generate a @var{mapfile} for -later use. +When ddrescue is invoked with the option @samp{--generate-mode} it operates +in "generate mode", which is different from the default "rescue mode". That +is, in "generate mode" ddrescue does not rescue anything. It only tries to +generate a @var{mapfile} for later use. -So you didn't read the manual and started ddrescue without a -@var{mapfile}. Now, two days later, your computer crashed and you can't -know how much data ddrescue managed to save. And even worse, you can't -resume the rescue; you have to restart it from the very beginning. +So you didn't read the manual and started ddrescue without a @var{mapfile}. +Now, two days later, your computer crashed and you can't know how much data +ddrescue managed to save. And even worse, you can't resume the rescue; you +have to restart it from the very beginning. Or maybe you started copying a drive with @w{@samp{dd conv=noerror,sync}} and are now in the same situation described above. In this case, note that @@ -1638,17 +1642,16 @@ you can't use a copy made by dd unless it was invoked with the @samp{sync} conversion argument. Don't despair (yet). Ddrescue can in some cases generate an approximate -@var{mapfile}, from @var{infile} and the (partial) copy in -@var{outfile}, that is almost as good as an exact @var{mapfile}. It -makes this by simply assuming that sectors containing all zeros were not -rescued. - -However, if the destination of the copy was a drive or a partition, (or -an existing regular file and truncation was not requested), most -probably you will need to restart ddrescue from the very beginning. -(This time with a @var{mapfile}, of course). The reason is that old data -may be present in the drive that have not been overwritten yet, and may -be thus non-tried but non-zero. +@var{mapfile}, from @var{infile} and the (partial) copy in @var{outfile}, +that is almost as good as an exact @var{mapfile}. It makes this by simply +assuming that sectors containing all zeros were not rescued. + +However, if the destination of the copy was a drive or a partition, (or an +existing regular file and truncation was not requested), most probably you +will need to restart ddrescue from the very beginning. (This time with a +@var{mapfile}, of course). The reason is that old data may be present in the +drive that have not been overwritten yet, and may be thus non-tried but +non-zero. For example, if you first tried one of these commands: @example @@ -1762,7 +1765,7 @@ This version number should be included in all bug reports. @itemx --change-types=@var{old_types},@var{new_types} Change the status of every block in the rescue domain from one type in @var{old_types} to the corresponding type in @var{new_types}, much like -the @samp{tr} command does, and write the resulting mapfile to standard +the command @samp{tr} does, and write the resulting mapfile to standard output. @var{old_types} and @var{new_types} are strings of block status characters as defined in the chapter Mapfile structure (@pxref{Mapfile structure}). Blocks whose status is not in @var{old_types} are left @@ -1865,7 +1868,7 @@ equivalent to @samp{--change-types=?*/-+,++++-} @item -o @var{bytes} @itemx --output-position=@var{bytes} Starting position of the image of the rescue domain in the original -@var{outfile}, in bytes. Is used by the @samp{--list-blocks} option. +@var{outfile}, in bytes. Is used by the option @samp{--list-blocks}. Defaults to @samp{--input-position}. @item -p @var{file} diff --git a/doc/ddrescuelog.1 b/doc/ddrescuelog.1 index c0a745c..1eaf301 100644 --- a/doc/ddrescuelog.1 +++ b/doc/ddrescuelog.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.46.1. -.TH DDRESCUELOG "1" "December 2019" "ddrescuelog 1.25-rc1" "User Commands" +.TH DDRESCUELOG "1" "February 2020" "ddrescuelog 1.25" "User Commands" .SH NAME ddrescuelog \- tool for ddrescue mapfiles .SH SYNOPSIS @@ -12,6 +12,10 @@ rescue status, and can delete a mapfile if the rescue is done. Ddrescuelog operations can be restricted to one or several parts of the mapfile if the domain setting options are used. .PP +Use '\-' as mapfile to read the mapfile from standard input +(also in the options taking a mapfile argument) or to write the mapfile +created by '\-\-create\-mapfile' to standard output. +.PP NOTE: In versions of ddrescue prior to 1.20 the mapfile was called \&'logfile'. The format is the same; only the name has changed. .SH OPTIONS @@ -97,8 +101,6 @@ OR the finished blocks in file with mapfile \fB\-\-shift\fR shift all block positions by (opos \- ipos) .PP -Use '\-' to read a mapfile from standard input or to write the mapfile -created by '\-\-create\-mapfile' to standard output. Numbers may be in decimal, hexadecimal, or octal, and may be followed by a multiplier: s = sectors, k = 1000, Ki = 1024, M = 10^6, Mi = 2^20, etc... .PP @@ -113,7 +115,7 @@ Ddrescue home page: http://www.gnu.org/software/ddrescue/ddrescue.html .br General help using GNU software: http://www.gnu.org/gethelp .SH COPYRIGHT -Copyright \(co 2019 Antonio Diaz Diaz. +Copyright \(co 2020 Antonio Diaz Diaz. License GPLv2+: GNU GPL version 2 or later .br This is free software: you are free to change and redistribute it. diff --git a/fillbook.cc b/fillbook.cc index 8745269..944afba 100644 --- a/fillbook.cc +++ b/fillbook.cc @@ -1,5 +1,5 @@ /* GNU ddrescue - Data recovery tool - Copyright (C) 2004-2019 Antonio Diaz Diaz. + Copyright (C) 2004-2020 Antonio Diaz Diaz. 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 diff --git a/genbook.cc b/genbook.cc index f818bf4..1cb0652 100644 --- a/genbook.cc +++ b/genbook.cc @@ -1,5 +1,5 @@ /* GNU ddrescue - Data recovery tool - Copyright (C) 2004-2019 Antonio Diaz Diaz. + Copyright (C) 2004-2020 Antonio Diaz Diaz. 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 diff --git a/io.cc b/io.cc index d58f507..e620ee3 100644 --- a/io.cc +++ b/io.cc @@ -1,5 +1,5 @@ /* GNU ddrescue - Data recovery tool - Copyright (C) 2004-2019 Antonio Diaz Diaz. + Copyright (C) 2004-2020 Antonio Diaz Diaz. 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 diff --git a/loggers.cc b/loggers.cc index 6e75ec2..3346f88 100644 --- a/loggers.cc +++ b/loggers.cc @@ -1,5 +1,5 @@ /* GNU ddrescue - Data recovery tool - Copyright (C) 2013-2019 Antonio Diaz Diaz. + Copyright (C) 2013-2020 Antonio Diaz Diaz. 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 diff --git a/loggers.h b/loggers.h index 0acf276..e5dd837 100644 --- a/loggers.h +++ b/loggers.h @@ -1,5 +1,5 @@ /* GNU ddrescue - Data recovery tool - Copyright (C) 2013-2019 Antonio Diaz Diaz. + Copyright (C) 2013-2020 Antonio Diaz Diaz. 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 diff --git a/main.cc b/main.cc index 8275d45..5a0b316 100644 --- a/main.cc +++ b/main.cc @@ -1,5 +1,5 @@ /* GNU ddrescue - Data recovery tool - Copyright (C) 2004-2019 Antonio Diaz Diaz. + Copyright (C) 2004-2020 Antonio Diaz Diaz. 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 @@ -70,9 +70,10 @@ void show_help( const int cluster, const int hardbs ) std::printf( "GNU ddrescue is a data recovery tool. It copies data from one file or block\n" "device (hard disc, cdrom, etc) to another, trying to rescue the good parts\n" "first in case of read errors.\n" - "\nAlways use a mapfile unless you know you won't need it. Without a\n" - "mapfile, ddrescue can't resume a rescue, only reinitiate it.\n" - "NOTE: In versions of ddrescue prior to 1.20 the mapfile was called\n" + "\nAlways use a mapfile unless you know you won't need it. Without a mapfile,\n" + "ddrescue can't resume a rescue, only reinitiate it. Be careful to not\n" + "specify by mistake an old mapfile from an unrelated rescue.\n" + "\nNOTE: In versions of ddrescue prior to 1.20 the mapfile was called\n" "'logfile'. The format is the same; only the name has changed.\n" "\nIf you reboot, check the device names before restarting ddrescue.\n" "Don't use options '-F' or '-G' without reading the manual first.\n" diff --git a/main_common.cc b/main_common.cc index 7bfac82..a050e5d 100644 --- a/main_common.cc +++ b/main_common.cc @@ -1,5 +1,5 @@ /* GNU ddrescue - Data recovery tool - Copyright (C) 2004-2019 Antonio Diaz Diaz. + Copyright (C) 2004-2020 Antonio Diaz Diaz. 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 @@ -19,7 +19,7 @@ int verbosity = 0; namespace { -const char * const program_year = "2019"; +const char * const program_year = "2020"; std::string command_line; @@ -117,7 +117,7 @@ bool check_types( std::string & types, const char * const opt_name, if( types.empty() || error ) { char buf[80]; - snprintf( buf, sizeof buf, "Invalid type for '%s' option.", opt_name ); + snprintf( buf, sizeof buf, "Invalid type for option '%s'.", opt_name ); show_error( buf, 0, true ); std::exit( 1 ); } diff --git a/mapbook.cc b/mapbook.cc index 45c261f..f60bc93 100644 --- a/mapbook.cc +++ b/mapbook.cc @@ -1,5 +1,5 @@ /* GNU ddrescue - Data recovery tool - Copyright (C) 2004-2019 Antonio Diaz Diaz. + Copyright (C) 2004-2020 Antonio Diaz Diaz. 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 diff --git a/mapbook.h b/mapbook.h index 73f34aa..fc15aa7 100644 --- a/mapbook.h +++ b/mapbook.h @@ -1,5 +1,5 @@ /* GNU ddrescue - Data recovery tool - Copyright (C) 2004-2019 Antonio Diaz Diaz. + Copyright (C) 2004-2020 Antonio Diaz Diaz. 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 diff --git a/mapfile.cc b/mapfile.cc index 4c4fec5..308c755 100644 --- a/mapfile.cc +++ b/mapfile.cc @@ -1,5 +1,5 @@ /* GNU ddrescue - Data recovery tool - Copyright (C) 2004-2019 Antonio Diaz Diaz. + Copyright (C) 2004-2020 Antonio Diaz Diaz. 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 diff --git a/non_posix.cc b/non_posix.cc index c515868..54c25cf 100644 --- a/non_posix.cc +++ b/non_posix.cc @@ -1,5 +1,5 @@ /* GNU ddrescue - Data recovery tool - Copyright (C) 2014-2019 Antonio Diaz Diaz. + Copyright (C) 2014-2020 Antonio Diaz Diaz. 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 diff --git a/non_posix.h b/non_posix.h index 90756fe..395ee90 100644 --- a/non_posix.h +++ b/non_posix.h @@ -1,5 +1,5 @@ /* GNU ddrescue - Data recovery tool - Copyright (C) 2014-2019 Antonio Diaz Diaz. + Copyright (C) 2014-2020 Antonio Diaz Diaz. 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 diff --git a/rational.cc b/rational.cc index a83f5ef..c1c2697 100644 --- a/rational.cc +++ b/rational.cc @@ -1,5 +1,5 @@ /* Rational - Rational number class with overflow detection - Copyright (C) 2005-2019 Antonio Diaz Diaz. + Copyright (C) 2005-2020 Antonio Diaz Diaz. This library is free software. Redistribution and use in source and binary forms, with or without modification, are permitted provided diff --git a/rational.h b/rational.h index 1bdef37..ca3f6de 100644 --- a/rational.h +++ b/rational.h @@ -1,5 +1,5 @@ /* Rational - Rational number class with overflow detection - Copyright (C) 2005-2019 Antonio Diaz Diaz. + Copyright (C) 2005-2020 Antonio Diaz Diaz. This library is free software. Redistribution and use in source and binary forms, with or without modification, are permitted provided @@ -23,7 +23,7 @@ // Maximum resolution is 1 / INT_MAX. // In case of domain error or overflow, den is set to 0 and num is set // to >0, <0, or 0, meaning +INF, -INF, and NAN respectively. This error -// condition can be tested with the 'error' function, and can only be +// condition can be tested with the function 'error', and can only be // cleared assigning a new value to the Rational. // While in error state, arithmetic operators become no ops and // relational operators return false, except !=, which returns true. diff --git a/rescuebook.cc b/rescuebook.cc index c446ec6..fbbab3e 100644 --- a/rescuebook.cc +++ b/rescuebook.cc @@ -1,5 +1,5 @@ /* GNU ddrescue - Data recovery tool - Copyright (C) 2004-2019 Antonio Diaz Diaz. + Copyright (C) 2004-2020 Antonio Diaz Diaz. 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 diff --git a/rescuebook.h b/rescuebook.h index 193b466..35f4543 100644 --- a/rescuebook.h +++ b/rescuebook.h @@ -1,5 +1,5 @@ /* GNU ddrescue - Data recovery tool - Copyright (C) 2004-2019 Antonio Diaz Diaz. + Copyright (C) 2004-2020 Antonio Diaz Diaz. 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 diff --git a/testsuite/check.sh b/testsuite/check.sh index e5ceb60..bf05a8c 100755 --- a/testsuite/check.sh +++ b/testsuite/check.sh @@ -1,6 +1,6 @@ #! /bin/sh # check script for GNU ddrescue - Data recovery tool -# Copyright (C) 2009-2019 Antonio Diaz Diaz. +# Copyright (C) 2009-2020 Antonio Diaz Diaz. # # This script is free software: you have unlimited permission # to copy, distribute, and modify it. @@ -56,304 +56,278 @@ test_failed() { fail=1 ; printf " $1" ; [ -z "$2" ] || printf "($2)" ; } printf "testing ddrescue-%s..." "$2" -"${DDRESCUE}" -q ${in} +"${DDRESCUE}" -q "${in}" [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q ${in} out mapfile extra +"${DDRESCUE}" -q "${in}" out mapfile extra [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q ${in} ${in} mapfile +"${DDRESCUE}" -q "${in}" "${in}" mapfile [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q ${in} out ${in} +"${DDRESCUE}" -q "${in}" out "${in}" [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q ${in}.bak out ${in} +"${DDRESCUE}" -q "${in}".bak out "${in}" [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q ${in} out out +"${DDRESCUE}" -q "${in}" out out [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q ${in} out.bak out +"${DDRESCUE}" -q "${in}" out.bak out [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -a 1ki ${in} out -[ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -a 1K ${in} out -[ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -a 1BB ${in} out -[ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -a 1Bi ${in} out -[ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -a 1Bk ${in} out -[ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -a 1Bs ${in} out -[ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -a 1iB ${in} out -[ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -a 1ii ${in} out -[ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -a 1ik ${in} out -[ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -a 1is ${in} out -[ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -a 1kk ${in} out -[ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -a 1sB ${in} out -[ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -a 1si ${in} out -[ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -a 1sk ${in} out -[ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -a 1ss ${in} out -[ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -F- ${in} out +for i in 1ki 1K 1BB 1Bi 1Bk 1Bs 1iB 1ii 1ik 1is 1kk 1sB 1si 1sk 1ss ; do + "${DDRESCUE}" -q -a $i "${in}" out + [ $? = 1 ] || test_failed $LINENO $i +done +"${DDRESCUE}" -q -F- "${in}" out [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -F ${in} out mapfile +"${DDRESCUE}" -q -F "${in}" out mapfile [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -F- --ask ${in} out mapfile +"${DDRESCUE}" -q -F- --ask "${in}" out mapfile [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -F- --same-file ${in} out mapfile +"${DDRESCUE}" -q -F- --same-file "${in}" out mapfile [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -G --ask ${in} out mapfile +"${DDRESCUE}" -q -G --ask "${in}" out mapfile [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -G ${in} out +"${DDRESCUE}" -q -G "${in}" out [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -F- -G ${in} out mapfile +"${DDRESCUE}" -q -F- -G "${in}" out mapfile [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -G --command-mode ${in} out mapfile +"${DDRESCUE}" -q -G --command-mode "${in}" out mapfile [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -H ${map2i} ${in} out mapfile +"${DDRESCUE}" -q -H "${map2i}" "${in}" out mapfile [ $? = 2 ] || test_failed $LINENO -"${DDRESCUE}" -q -K ${in} out +"${DDRESCUE}" -q -K "${in}" out [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -K, ${in} out +"${DDRESCUE}" -q -K, "${in}" out [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -K0, ${in} out +"${DDRESCUE}" -q -K0, "${in}" out [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -K0,65535 ${in} out +"${DDRESCUE}" -q -K0,65535 "${in}" out [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -K0,65536, ${in} out +"${DDRESCUE}" -q -K0,65536, "${in}" out [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -i 0, ${in} out +"${DDRESCUE}" -q -i 0, "${in}" out [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -i -1 ${in} out +"${DDRESCUE}" -q -i -1 "${in}" out [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -m ${map1} -m ${map2} ${in} out mapfile +"${DDRESCUE}" -q -m "${map1}" -m "${map2}" "${in}" out mapfile [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q -m ${map2i} ${in} out mapfile +"${DDRESCUE}" -q -m "${map2i}" "${in}" out mapfile [ $? = 2 ] || test_failed $LINENO -"${DDRESCUE}" -q -w ${in} out mapfile +"${DDRESCUE}" -q -w "${in}" out mapfile [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q --cpass=1, ${in} out +"${DDRESCUE}" -q --cpass=1, "${in}" out [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q --cpass=1- ${in} out +"${DDRESCUE}" -q --cpass=1- "${in}" out [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q --cpass=6 ${in} out +"${DDRESCUE}" -q --cpass=6 "${in}" out [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q --mapfile-interval=-2 ${in} out +"${DDRESCUE}" -q --mapfile-interval=-2 "${in}" out [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q --mapfile-interval=30, ${in} out +"${DDRESCUE}" -q --mapfile-interval=30, "${in}" out [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q --mapfile-interval=,4s ${in} out +"${DDRESCUE}" -q --mapfile-interval=,4s "${in}" out [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q --mapfile-interval=3,4s ${in} out +"${DDRESCUE}" -q --mapfile-interval=3,4s "${in}" out [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q --mapfile-interval=30,10 ${in} out +"${DDRESCUE}" -q --mapfile-interval=30,10 "${in}" out [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q --mapfile-interval=30,60, ${in} out +"${DDRESCUE}" -q --mapfile-interval=30,60, "${in}" out [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q --mapfile-interval=30,60s, ${in} out +"${DDRESCUE}" -q --mapfile-interval=30,60s, "${in}" out [ $? = 1 ] || test_failed $LINENO -"${DDRESCUE}" -q --same-file -t ${in} out +"${DDRESCUE}" -q --same-file -t "${in}" out [ $? = 1 ] || test_failed $LINENO rm -f mapfile || framework_failure -"${DDRESCUE}" -q -t -p -J -b1024 -i15kB ${in} out mapfile || test_failed $LINENO -"${DDRESCUE}" -q -A -y -e0 -f -n -s15k ${in} out mapfile || test_failed $LINENO -cmp ${in} out || test_failed $LINENO +"${DDRESCUE}" -q -t -p -J -b1024 -i15kB "${in}" out mapfile || test_failed $LINENO +"${DDRESCUE}" -q -A -y -e0 -f -n -s15k "${in}" out mapfile || test_failed $LINENO +cmp "${in}" out || test_failed $LINENO rm -f out mapfile || framework_failure -"${DDRESCUE}" -q -R -i15000 -a 1ks -E 1Kis ${in} out mapfile || +"${DDRESCUE}" -q -R -i15000 -a 1ks -E 1Kis "${in}" out mapfile || test_failed $LINENO -"${DDRESCUE}" -q -R -s15000 --cpass=5 ${in} out mapfile || test_failed $LINENO -cmp ${in} out || test_failed $LINENO +"${DDRESCUE}" -q -R -s15000 --cpass=5 "${in}" out mapfile || test_failed $LINENO +cmp "${in}" out || test_failed $LINENO rm -f out || framework_failure -"${DDRESCUE}" -q -F+ -o15000 -c143 ${in} out2 mapfile || test_failed $LINENO +"${DDRESCUE}" -q -F+ -o15000 -c143 "${in}" out2 mapfile || test_failed $LINENO "${DDRESCUE}" -q -R -S -i15000 -o0 -u -Z1Mis out2 out || test_failed $LINENO -cmp ${in} out || test_failed $LINENO +cmp "${in}" out || test_failed $LINENO printf "garbage" >> out || framework_failure "${DDRESCUE}" -q -N -R -t -i15000 -o0 --pause-on-pass=0 out2 out || test_failed $LINENO -cmp ${in} out || test_failed $LINENO +cmp "${in}" out || test_failed $LINENO rm -f out || framework_failure -"${DDRESCUE}" -q -O -r1 -H - --pause-on-error=s0 ${in} out < ${map1} || +"${DDRESCUE}" -q -O -r1 -H - --pause-on-error=s0 "${in}" out < "${map1}" || test_failed $LINENO -cmp ${in1} out || test_failed $LINENO -"${DDRESCUE}" -q -L -K0 -c1 -H ${map2i} --pause-on-error=0 ${in2} out || +cmp "${in1}" out || test_failed $LINENO +"${DDRESCUE}" -q -L -K0 -c1 -H "${map2i}" --pause-on-error=0 "${in2}" out || test_failed $LINENO -cmp ${in} out || test_failed $LINENO +cmp "${in}" out || test_failed $LINENO rm -f out mapfile || framework_failure -"${DDRESCUE}" -q -c1 -H ${map3} --delay-slow=0 ${in3} out mapfile || +"${DDRESCUE}" -q -c1 -H "${map3}" --delay-slow=0 "${in3}" out mapfile || test_failed $LINENO -"${DDRESCUE}" -q -c1 -M -H ${map4} ${in4} out mapfile || test_failed $LINENO -"${DDRESCUE}" -q -c1 -A -M --cpass=0 -H ${map5} ${in5} out mapfile || +"${DDRESCUE}" -q -c1 -M -H "${map4}" "${in4}" out mapfile || test_failed $LINENO +"${DDRESCUE}" -q -c1 -A -M --cpass=0 -H "${map5}" "${in5}" out mapfile || test_failed $LINENO -cmp -s ${in} out && test_failed $LINENO -"${DDRESCUE}" -q -c1 -n -N -H ${map5} ${in5} out mapfile || test_failed $LINENO -cmp ${in} out || test_failed $LINENO +cmp -s "${in}" out && test_failed $LINENO +"${DDRESCUE}" -q -c1 -n -N -H "${map5}" "${in5}" out mapfile || test_failed $LINENO +cmp "${in}" out || test_failed $LINENO rm -f out || framework_failure -"${DDRESCUE}" -q -X0 -m - ${in} out < ${map1} || test_failed $LINENO -cmp ${in1} out || test_failed $LINENO -"${DDRESCUE}" -q -X0 -L -K0,64Ki -m ${map2i} ${in2} out || test_failed $LINENO -cmp ${in} out || test_failed $LINENO +"${DDRESCUE}" -q -X0 -m - "${in}" out < "${map1}" || test_failed $LINENO +cmp "${in1}" out || test_failed $LINENO +"${DDRESCUE}" -q -X0 -L -K0,64Ki -m "${map2i}" "${in2}" out || test_failed $LINENO +cmp "${in}" out || test_failed $LINENO rm -f out || framework_failure -"${DDRESCUE}" -q -R -B -K,64KiB -m ${map2} ${in} out || test_failed $LINENO -cmp ${in2} out || test_failed $LINENO -"${DDRESCUE}" -q -R -K65536,65536 -m ${map1} ${in1} out || test_failed $LINENO -cmp ${in} out || test_failed $LINENO +"${DDRESCUE}" -q -R -B -K,64KiB -m "${map2}" "${in}" out || test_failed $LINENO +cmp "${in2}" out || test_failed $LINENO +"${DDRESCUE}" -q -R -K65536,65536 -m "${map1}" "${in1}" out || test_failed $LINENO +cmp "${in}" out || test_failed $LINENO rm -f out || framework_failure -"${DDRESCUE}" -q --mapfile-interval=5m -m ${map5} ${in5} out || +"${DDRESCUE}" -q --mapfile-interval=5m -m "${map5}" "${in5}" out || test_failed $LINENO -"${DDRESCUE}" -q --mapfile-interval=5,5 -m ${map4} ${in4} out || +"${DDRESCUE}" -q --mapfile-interval=5,5 -m "${map4}" "${in4}" out || test_failed $LINENO -"${DDRESCUE}" -q --mapfile-interval=,5s -m ${map3} ${in3} out || +"${DDRESCUE}" -q --mapfile-interval=,5s -m "${map3}" "${in3}" out || test_failed $LINENO -cmp ${in} out || test_failed $LINENO +cmp "${in}" out || test_failed $LINENO rm -f out || framework_failure -cat ${map1} > mapfile || framework_failure -"${DDRESCUE}" -q -I ${in2} out mapfile || test_failed $LINENO -cat ${map2} > mapfile || framework_failure -"${DDRESCUE}" -q -I ${in} out mapfile || test_failed $LINENO -cmp ${in} out || test_failed $LINENO +cat "${map1}" > mapfile || framework_failure +"${DDRESCUE}" -q -I "${in2}" out mapfile || test_failed $LINENO +cat "${map2}" > mapfile || framework_failure +"${DDRESCUE}" -q -I "${in}" out mapfile || test_failed $LINENO +cmp "${in}" out || test_failed $LINENO rm -f out || framework_failure -cat ${map1} > mapfile || framework_failure -"${DDRESCUE}" -q -R ${in2} out mapfile || test_failed $LINENO -cat ${map2} > mapfile || framework_failure -"${DDRESCUE}" -q -R -C ${in1} out mapfile || test_failed $LINENO -cmp ${in} out || test_failed $LINENO +cat "${map1}" > mapfile || framework_failure +"${DDRESCUE}" -q -R "${in2}" out mapfile || test_failed $LINENO +cat "${map2}" > mapfile || framework_failure +"${DDRESCUE}" -q -R -C "${in1}" out mapfile || test_failed $LINENO +cmp "${in}" out || test_failed $LINENO # test joining non-finished subsectors rm -f out || framework_failure -cat ${map2} > mapfile || framework_failure -"${DDRESCUE}" -q ${in} out mapfile || test_failed $LINENO -cmp ${in1} out || test_failed $LINENO -cat ${map6} > mapfile || framework_failure -"${DDRESCUE}" -q -s0x800 ${in2} out mapfile || test_failed $LINENO -"${DDRESCUELOG}" -p ${map6j} mapfile || test_failed $LINENO -cmp ${in1} out || test_failed $LINENO -"${DDRESCUE}" -q ${in2} out mapfile || test_failed $LINENO -cmp -s ${in} out && test_failed $LINENO +cat "${map2}" > mapfile || framework_failure +"${DDRESCUE}" -q "${in}" out mapfile || test_failed $LINENO +cmp "${in1}" out || test_failed $LINENO +cat "${map6}" > mapfile || framework_failure +"${DDRESCUE}" -q -s0x800 "${in2}" out mapfile || test_failed $LINENO +"${DDRESCUELOG}" -p "${map6j}" mapfile || test_failed $LINENO +cmp "${in1}" out || test_failed $LINENO +"${DDRESCUE}" -q "${in2}" out mapfile || test_failed $LINENO +cmp -s "${in}" out && test_failed $LINENO "${DDRESCUELOG}" -d mapfile && test_failed $LINENO -"${DDRESCUE}" -q -r1 ${in2} out mapfile || test_failed $LINENO -cmp ${in} out || test_failed $LINENO +"${DDRESCUE}" -q -r1 "${in2}" out mapfile || test_failed $LINENO +cmp "${in}" out || test_failed $LINENO "${DDRESCUELOG}" -d mapfile || test_failed $LINENO -cat ${in1} > out || framework_failure -cat ${map6} > mapfile || framework_failure -"${DDRESCUE}" -q -b0x80 ${in2} out mapfile || test_failed $LINENO -cmp -s ${in} out && test_failed $LINENO +cat "${in1}" > out || framework_failure +cat "${map6}" > mapfile || framework_failure +"${DDRESCUE}" -q -b0x80 "${in2}" out mapfile || test_failed $LINENO +cmp -s "${in}" out && test_failed $LINENO "${DDRESCUELOG}" -d mapfile && test_failed $LINENO -"${DDRESCUE}" -q -b0x80 -r1 ${in2} out mapfile || test_failed $LINENO -cmp ${in} out || test_failed $LINENO +"${DDRESCUE}" -q -b0x80 -r1 "${in2}" out mapfile || test_failed $LINENO +cmp "${in}" out || test_failed $LINENO "${DDRESCUELOG}" -d mapfile || test_failed $LINENO -cat ${in1} > out || framework_failure -cat ${map6} > mapfile || framework_failure -"${DDRESCUE}" -q -b4096 -s0x800 ${in2} out mapfile || test_failed $LINENO -"${DDRESCUELOG}" -P ${map1} mapfile || test_failed $LINENO -"${DDRESCUELOG}" -q -p ${map1} mapfile && test_failed $LINENO -cmp ${in1} out || test_failed $LINENO -"${DDRESCUE}" -q -b4096 ${in2} out mapfile || test_failed $LINENO -cmp ${in} out || test_failed $LINENO +cat "${in1}" > out || framework_failure +cat "${map6}" > mapfile || framework_failure +"${DDRESCUE}" -q -b4096 -s0x800 "${in2}" out mapfile || test_failed $LINENO +"${DDRESCUELOG}" -P "${map1}" mapfile || test_failed $LINENO +"${DDRESCUELOG}" -q -p "${map1}" mapfile && test_failed $LINENO +cmp "${in1}" out || test_failed $LINENO +"${DDRESCUE}" -q -b4096 "${in2}" out mapfile || test_failed $LINENO +cmp "${in}" out || test_failed $LINENO "${DDRESCUELOG}" -d mapfile || test_failed $LINENO rm -f out || framework_failure for i in 0 8000 16000 24000 32000 40000 48000 56000 64000 72000 ; do - "${DDRESCUE}" -q -i$i -s4000 -m ${map1} ${in} out || + "${DDRESCUE}" -q -i$i -s4000 -m "${map1}" "${in}" out || test_failed $LINENO $i done -cmp -s ${in} out && test_failed $LINENO +cmp -s "${in}" out && test_failed $LINENO for i in 4000 12000 20000 28000 36000 44000 52000 60000 68000 ; do - "${DDRESCUE}" -q -i$i -s4000 -m ${map1} ${in} out || + "${DDRESCUE}" -q -i$i -s4000 -m "${map1}" "${in}" out || test_failed $LINENO $i done -cmp ${in1} out || test_failed $LINENO +cmp "${in1}" out || test_failed $LINENO for i in 0 8000 16000 24000 32000 40000 48000 56000 64000 72000 ; do - "${DDRESCUE}" -q -i$i -s4000 -m ${map2} ${in2} out || + "${DDRESCUE}" -q -i$i -s4000 -m "${map2}" "${in2}" out || test_failed $LINENO $i done -cmp -s ${in} out && test_failed $LINENO +cmp -s "${in}" out && test_failed $LINENO for i in 4000 12000 20000 28000 36000 44000 52000 60000 68000 ; do - "${DDRESCUE}" -q -i$i -s4000 -m ${map2} ${in2} out || + "${DDRESCUE}" -q -i$i -s4000 -m "${map2}" "${in2}" out || test_failed $LINENO $i done -cmp ${in} out || test_failed $LINENO +cmp "${in}" out || test_failed $LINENO rm -f mapfile || framework_failure -cat ${in1} > out || framework_failure -"${DDRESCUE}" -q -G ${in} out mapfile || test_failed $LINENO -"${DDRESCUE}" -q ${in2} out mapfile || test_failed $LINENO -cmp ${in} out || test_failed $LINENO +cat "${in1}" > out || framework_failure +"${DDRESCUE}" -q -G "${in}" out mapfile || test_failed $LINENO +"${DDRESCUE}" -q "${in2}" out mapfile || test_failed $LINENO +cmp "${in}" out || test_failed $LINENO rm -f mapfile || framework_failure -cat ${in} > copy || framework_failure +cat "${in}" > copy || framework_failure printf "garbage" >> copy || framework_failure -cat ${in2} > out || framework_failure -"${DDRESCUE}" -q -t -x 72776 ${in1} copy || test_failed $LINENO -"${DDRESCUE}" -q -G ${in} out mapfile || test_failed $LINENO +cat "${in2}" > out || framework_failure +"${DDRESCUE}" -q -t -x 72776 "${in1}" copy || test_failed $LINENO +"${DDRESCUE}" -q -G "${in}" out mapfile || test_failed $LINENO "${DDRESCUE}" -q -R -T1.5d copy out mapfile || test_failed $LINENO -cmp ${in} out || test_failed $LINENO +cmp "${in}" out || test_failed $LINENO "${DDRESCUE}" -q --same-file out out || test_failed $LINENO -cmp ${in} out || test_failed $LINENO +cmp "${in}" out || test_failed $LINENO -"${DDRESCUE}" -q -t ${in} out || test_failed $LINENO +"${DDRESCUE}" -q -t "${in}" out || test_failed $LINENO "${DDRESCUE}" -q --same-file -o 72776 out out || test_failed $LINENO -cat ${in} ${in} | cmp out - || test_failed $LINENO +cat "${in}" "${in}" | cmp out - || test_failed $LINENO rm -f out || framework_failure -"${DDRESCUE}" -q ${in} out || test_failed $LINENO +"${DDRESCUE}" -q "${in}" out || test_failed $LINENO "${DDRESCUE}" -q --same-file -o 145552 -S out out || test_failed $LINENO "${DDRESCUE}" -q --same-file -i 145552 -o 72776 out out || test_failed $LINENO -cat ${in} ${in} ${in} | cmp out - || test_failed $LINENO +cat "${in}" "${in}" "${in}" | cmp out - || test_failed $LINENO rm -f out || framework_failure -printf "c 0 72776\nq\n" | "${DDRESCUE}" -m ${map1} --command-mode ${in} out \ +printf "c 0 72776\nq\n" | "${DDRESCUE}" -m "${map1}" --command-mode "${in}" out \ > /dev/null || test_failed $LINENO -cmp ${in1} out || test_failed $LINENO -printf "c 0 72776\nu\n" | "${DDRESCUE}" -m ${map2} --command-mode ${in2} out \ +cmp "${in1}" out || test_failed $LINENO +printf "c 0 72776\nu\n" | "${DDRESCUE}" -m "${map2}" --command-mode "${in2}" out \ > /dev/null || test_failed $LINENO -cmp ${in} out || test_failed $LINENO +cmp "${in}" out || test_failed $LINENO rm -f out || framework_failure -cat ${map1} > mapfile || framework_failure -printf "c 0 72776\ns0 1\n" | "${DDRESCUE}" --command-mode ${in} out mapfile \ +cat "${map1}" > mapfile || framework_failure +printf "c 0 72776\ns0 1\n" | "${DDRESCUE}" --command-mode "${in}" out mapfile \ > /dev/null || test_failed $LINENO -cmp ${in2} out || test_failed $LINENO -cat ${map2} > mapfile || framework_failure -printf "c 0 72776\n" | "${DDRESCUE}" -C --command-mode ${in1} out mapfile \ +cmp "${in2}" out || test_failed $LINENO +cat "${map2}" > mapfile || framework_failure +printf "c 0 72776\n" | "${DDRESCUE}" -C --command-mode "${in1}" out mapfile \ > /dev/null || test_failed $LINENO -cmp ${in} out || test_failed $LINENO +cmp "${in}" out || test_failed $LINENO "${DDRESCUELOG}" -d mapfile || test_failed $LINENO rm -f out mapfile || framework_failure printf "c 0x1000 0x800\nc 0x2800 0x800\nc 0x4000 0x800\nc 0x5800 0x800\n\ c 0x7000 0x800\nc 0x8800 0x800\nc 0xA000 0x800\nc 0xB800 0x800\n\ c 0xD000 0x800\nc 0xE800 0x800\nc 0x10000 0x800\nc 0x11800 0x448\n" | \ -"${DDRESCUE}" --command-mode ${in} out mapfile > /dev/null || +"${DDRESCUE}" --command-mode "${in}" out mapfile > /dev/null || test_failed $LINENO -cmp ${in5} out || test_failed $LINENO +cmp "${in5}" out || test_failed $LINENO printf "c 0 0x800\nc 0x1800 0x800\nc 0x3000 0x800\nc 0x4800 0x800\n\ c 0x6000 0x800\nc 0x7800 0x800\nc 0x9000 0x800\nc 0xA800 0x800\n\ c 0xC000 0x800\nc 0xD800 0x800\nc 0xF000 0x800\nc 0x10800 0x800\n" | \ -"${DDRESCUE}" -C --command-mode ${in3} out mapfile > /dev/null || +"${DDRESCUE}" -C --command-mode "${in3}" out mapfile > /dev/null || test_failed $LINENO -printf "c 0 72776\nf\n" | "${DDRESCUE}" --command-mode ${in4} out mapfile \ +printf "c 0 72776\nf\n" | "${DDRESCUE}" --command-mode "${in4}" out mapfile \ > /dev/null || test_failed $LINENO -cmp ${in} out || test_failed $LINENO +cmp "${in}" out || test_failed $LINENO "${DDRESCUELOG}" -d mapfile || test_failed $LINENO printf "\ntesting ddrescuelog-%s..." "$2" @@ -362,16 +336,16 @@ printf "\ntesting ddrescuelog-%s..." "$2" [ $? = 1 ] || test_failed $LINENO "${DDRESCUELOG}" -q -d [ $? = 1 ] || test_failed $LINENO -"${DDRESCUELOG}" -q -l+l ${map1} +"${DDRESCUELOG}" -q -l+l "${map1}" [ $? = 1 ] || test_failed $LINENO "${DDRESCUELOG}" -q -t -d mapfile [ $? = 1 ] || test_failed $LINENO -"${DDRESCUELOG}" -q -m ${map2i} -t mapfile +"${DDRESCUELOG}" -q -m "${map2i}" -t mapfile [ $? = 2 ] || test_failed $LINENO "${DDRESCUELOG}" -q --shift -i20 mapfile [ $? = 1 ] || test_failed $LINENO -"${DDRESCUELOG}" -a '?,+' -i3072 - < ${map1} > mapfile +"${DDRESCUELOG}" -a '?,+' -i3072 - < "${map1}" > mapfile "${DDRESCUELOG}" -D - < mapfile [ $? = 1 ] || test_failed $LINENO "${DDRESCUELOG}" -D mapfile @@ -381,58 +355,58 @@ printf "\ntesting ddrescuelog-%s..." "$2" [ $? = 1 ] || test_failed $LINENO "${DDRESCUELOG}" -d mapfile2 || test_failed $LINENO -"${DDRESCUELOG}" -b2048 -l+ - < ${map1} > out || test_failed $LINENO +"${DDRESCUELOG}" -b2048 -l+ - < "${map1}" > out || test_failed $LINENO "${DDRESCUELOG}" -b2048 -c - < out > mapfile || test_failed $LINENO "${DDRESCUELOG}" -b2048 -l+ mapfile > copy || test_failed $LINENO cmp out copy || test_failed $LINENO -"${DDRESCUELOG}" -q -p ${map1} mapfile +"${DDRESCUELOG}" -q -p "${map1}" mapfile [ $? = 1 ] || test_failed $LINENO -"${DDRESCUELOG}" -P ${map1} mapfile || test_failed $LINENO +"${DDRESCUELOG}" -P "${map1}" mapfile || test_failed $LINENO "${DDRESCUELOG}" -b2048 -s72776 -f '-c?+' mapfile < out || test_failed $LINENO -"${DDRESCUELOG}" -p ${map2} - < mapfile || test_failed $LINENO +"${DDRESCUELOG}" -p "${map2}" - < mapfile || test_failed $LINENO "${DDRESCUELOG}" -b2048 -f '-c?+' mapfile < out || test_failed $LINENO -"${DDRESCUELOG}" -s72776 -p ${map2} mapfile || test_failed $LINENO -"${DDRESCUELOG}" -q -s72777 -p ${map2} mapfile +"${DDRESCUELOG}" -s72776 -p "${map2}" mapfile || test_failed $LINENO +"${DDRESCUELOG}" -q -s72777 -p "${map2}" mapfile [ $? = 1 ] || test_failed $LINENO printf "10\n12\n14\n16\n" | "${DDRESCUELOG}" -b2048 -f '-c+?' mapfile || test_failed $LINENO -"${DDRESCUELOG}" -q -p mapfile ${map1} +"${DDRESCUELOG}" -q -p mapfile "${map1}" [ $? = 1 ] || test_failed $LINENO -"${DDRESCUELOG}" -q -i0x5000 -p mapfile ${map1} +"${DDRESCUELOG}" -q -i0x5000 -p mapfile "${map1}" [ $? = 1 ] || test_failed $LINENO -"${DDRESCUELOG}" -i0x5000 -s0x3800 -p mapfile ${map1} || test_failed $LINENO +"${DDRESCUELOG}" -i0x5000 -s0x3800 -p mapfile "${map1}" || test_failed $LINENO -"${DDRESCUELOG}" -C ${map2i} > mapfile || test_failed $LINENO -"${DDRESCUELOG}" -p ${map2} mapfile || test_failed $LINENO +"${DDRESCUELOG}" -C "${map2i}" > mapfile || test_failed $LINENO +"${DDRESCUELOG}" -p "${map2}" mapfile || test_failed $LINENO -cat ${map1} > mapfile || framework_failure +cat "${map1}" > mapfile || framework_failure "${DDRESCUELOG}" -i1024 -s2048 -d mapfile [ $? = 1 ] || test_failed $LINENO "${DDRESCUELOG}" -i1024 -s1024 -d mapfile || test_failed $LINENO "${DDRESCUELOG}" -q -i1024 -s1024 -d mapfile [ $? = 1 ] || test_failed $LINENO -cat ${map2} > mapfile || framework_failure -"${DDRESCUELOG}" -m ${map1} -D mapfile +cat "${map2}" > mapfile || framework_failure +"${DDRESCUELOG}" -m "${map1}" -D mapfile [ $? = 1 ] || test_failed $LINENO -"${DDRESCUELOG}" -L -m - -D mapfile < ${map2i} || test_failed $LINENO +"${DDRESCUELOG}" -L -m - -D mapfile < "${map2i}" || test_failed $LINENO "${DDRESCUELOG}" -i1024 -s2048 -d mapfile [ $? = 1 ] || test_failed $LINENO "${DDRESCUELOG}" -i2048 -s2048 -d mapfile || test_failed $LINENO -"${DDRESCUELOG}" -b2048 -l+ ${map1} > out || test_failed $LINENO +"${DDRESCUELOG}" -b2048 -l+ "${map1}" > out || test_failed $LINENO printf "0\n2\n4\n6\n8\n10\n12\n14\n16\n18\n20\n22\n24\n26\n28\n30\n32\n34\n" > copy || framework_failure cmp out copy || test_failed $LINENO -"${DDRESCUELOG}" -b2048 '-l?-' ${map1} > out || test_failed $LINENO +"${DDRESCUELOG}" -b2048 '-l?-' "${map1}" > out || test_failed $LINENO printf "1\n3\n5\n7\n9\n11\n13\n15\n17\n19\n21\n23\n25\n27\n29\n31\n33\n35\n" > copy || framework_failure cmp out copy || test_failed $LINENO -"${DDRESCUELOG}" -b2048 -l+ -i0x1800 -o0 -s0x4000 ${map1} > out || +"${DDRESCUELOG}" -b2048 -l+ -i0x1800 -o0 -s0x4000 "${map1}" > out || test_failed $LINENO printf "1\n3\n5\n7\n" > copy || framework_failure cmp out copy || test_failed $LINENO -"${DDRESCUELOG}" -n ${map2} > mapfile || framework_failure +"${DDRESCUELOG}" -n "${map2}" > mapfile || framework_failure "${DDRESCUELOG}" -b2048 -l+ mapfile > out || test_failed $LINENO printf "0\n2\n4\n6\n8\n10\n12\n14\n16\n18\n20\n22\n24\n26\n28\n30\n32\n34\n" > copy || framework_failure cmp out copy || test_failed $LINENO @@ -444,118 +418,118 @@ cmp out copy || test_failed $LINENO printf "1\n3\n5\n7\n" > copy || framework_failure cmp out copy || test_failed $LINENO -"${DDRESCUELOG}" -q -P ${map2i} - < ${map2} +"${DDRESCUELOG}" -q -P "${map2i}" - < "${map2}" [ $? = 2 ] || test_failed $LINENO -"${DDRESCUELOG}" -L -P ${map2i} ${map2} || test_failed $LINENO +"${DDRESCUELOG}" -L -P "${map2i}" "${map2}" || test_failed $LINENO # test XOR -for i in ${map1} ${map2} ${map3} ${map4} ${map5} ; do - for j in ${map1} ${map2} ${map3} ${map4} ${map5} ; do - "${DDRESCUELOG}" -x $j $i > out || test_failed $LINENO "$i $j" - "${DDRESCUELOG}" -x $i $j > copy || test_failed $LINENO "$i $j" +for i in "${map1}" "${map2}" "${map3}" "${map4}" "${map5}" ; do + for j in "${map1}" "${map2}" "${map3}" "${map4}" "${map5}" ; do + "${DDRESCUELOG}" -x "$j" "$i" > out || test_failed $LINENO "$i $j" + "${DDRESCUELOG}" -x "$i" "$j" > copy || test_failed $LINENO "$i $j" "${DDRESCUELOG}" -P out copy || test_failed $LINENO "$i $j" - "${DDRESCUELOG}" -x $j out > copy || test_failed $LINENO "$i $j" - "${DDRESCUELOG}" -P $i copy || test_failed $LINENO "$i $j" + "${DDRESCUELOG}" -x "$j" out > copy || test_failed $LINENO "$i $j" + "${DDRESCUELOG}" -P "$i" copy || test_failed $LINENO "$i $j" done done -"${DDRESCUELOG}" -x ${map1} - < ${map2} > out || test_failed $LINENO -"${DDRESCUELOG}" -x ${map2} ${map1} > copy || test_failed $LINENO +"${DDRESCUELOG}" -x "${map1}" - < "${map2}" > out || test_failed $LINENO +"${DDRESCUELOG}" -x "${map2}" "${map1}" > copy || test_failed $LINENO "${DDRESCUELOG}" -p out copy || test_failed $LINENO "${DDRESCUELOG}" -d out || test_failed $LINENO "${DDRESCUELOG}" -d copy || test_failed $LINENO -"${DDRESCUELOG}" -x ${map1} ${blank} > out || test_failed $LINENO -"${DDRESCUELOG}" -x ${blank} ${map1} > copy || test_failed $LINENO +"${DDRESCUELOG}" -x "${map1}" "${blank}" > out || test_failed $LINENO +"${DDRESCUELOG}" -x "${blank}" "${map1}" > copy || test_failed $LINENO "${DDRESCUELOG}" -p out copy || test_failed $LINENO -"${DDRESCUELOG}" -p out ${map1} || test_failed $LINENO -"${DDRESCUELOG}" -p ${map1} copy || test_failed $LINENO -"${DDRESCUELOG}" -x ${map2} ${map2} > mapfile || test_failed $LINENO -"${DDRESCUELOG}" -P ${blank} mapfile || test_failed $LINENO -"${DDRESCUELOG}" -x ${map1} ${map1} > mapfile || test_failed $LINENO -"${DDRESCUELOG}" -P ${blank} mapfile || test_failed $LINENO -"${DDRESCUELOG}" -b2048 -l+ ${map1} > out || test_failed $LINENO +"${DDRESCUELOG}" -p out "${map1}" || test_failed $LINENO +"${DDRESCUELOG}" -p "${map1}" copy || test_failed $LINENO +"${DDRESCUELOG}" -x "${map2}" "${map2}" > mapfile || test_failed $LINENO +"${DDRESCUELOG}" -P "${blank}" mapfile || test_failed $LINENO +"${DDRESCUELOG}" -x "${map1}" "${map1}" > mapfile || test_failed $LINENO +"${DDRESCUELOG}" -P "${blank}" mapfile || test_failed $LINENO +"${DDRESCUELOG}" -b2048 -l+ "${map1}" > out || test_failed $LINENO "${DDRESCUELOG}" -b2048 -l- mapfile > copy || test_failed $LINENO cmp out copy || test_failed $LINENO -"${DDRESCUELOG}" -b2048 -i0x2000 -s0x2800 -l+ ${map1} > out || +"${DDRESCUELOG}" -b2048 -i0x2000 -s0x2800 -l+ "${map1}" > out || test_failed $LINENO -"${DDRESCUELOG}" -i0x1800 -s0x3800 -x ${map1} ${map1} > mapfile || +"${DDRESCUELOG}" -i0x1800 -s0x3800 -x "${map1}" "${map1}" > mapfile || test_failed $LINENO "${DDRESCUELOG}" -b2048 -l- mapfile > copy || test_failed $LINENO cmp out copy || test_failed $LINENO -"${DDRESCUELOG}" -x ${map3} ${map4} > out || test_failed $LINENO -"${DDRESCUELOG}" -x ${map4} ${map3} > copy || test_failed $LINENO +"${DDRESCUELOG}" -x "${map3}" "${map4}" > out || test_failed $LINENO +"${DDRESCUELOG}" -x "${map4}" "${map3}" > copy || test_failed $LINENO "${DDRESCUELOG}" -p out copy || test_failed $LINENO -"${DDRESCUELOG}" -x ${map3} ${map5} > out || test_failed $LINENO -"${DDRESCUELOG}" -x ${map5} ${map3} > copy || test_failed $LINENO +"${DDRESCUELOG}" -x "${map3}" "${map5}" > out || test_failed $LINENO +"${DDRESCUELOG}" -x "${map5}" "${map3}" > copy || test_failed $LINENO "${DDRESCUELOG}" -p out copy || test_failed $LINENO -"${DDRESCUELOG}" -x ${map4} ${map5} > out || test_failed $LINENO -"${DDRESCUELOG}" -x ${map5} ${map4} > copy || test_failed $LINENO +"${DDRESCUELOG}" -x "${map4}" "${map5}" > out || test_failed $LINENO +"${DDRESCUELOG}" -x "${map5}" "${map4}" > copy || test_failed $LINENO "${DDRESCUELOG}" -p out copy || test_failed $LINENO -"${DDRESCUELOG}" -x ${map3} ${map4} > out || test_failed $LINENO +"${DDRESCUELOG}" -x "${map3}" "${map4}" > out || test_failed $LINENO "${DDRESCUELOG}" -D out && test_failed $LINENO -"${DDRESCUELOG}" -x out ${map5} > mapfile || test_failed $LINENO +"${DDRESCUELOG}" -x out "${map5}" > mapfile || test_failed $LINENO "${DDRESCUELOG}" -d mapfile || test_failed $LINENO -"${DDRESCUELOG}" -x ${map3} ${map5} > out || test_failed $LINENO +"${DDRESCUELOG}" -x "${map3}" "${map5}" > out || test_failed $LINENO "${DDRESCUELOG}" -D out && test_failed $LINENO -"${DDRESCUELOG}" -x out ${map4} > mapfile || test_failed $LINENO +"${DDRESCUELOG}" -x out "${map4}" > mapfile || test_failed $LINENO "${DDRESCUELOG}" -d mapfile || test_failed $LINENO -"${DDRESCUELOG}" -x ${map4} ${map3} > out || test_failed $LINENO +"${DDRESCUELOG}" -x "${map4}" "${map3}" > out || test_failed $LINENO "${DDRESCUELOG}" -D out && test_failed $LINENO -"${DDRESCUELOG}" -x out ${map5} > mapfile || test_failed $LINENO +"${DDRESCUELOG}" -x out "${map5}" > mapfile || test_failed $LINENO "${DDRESCUELOG}" -d mapfile || test_failed $LINENO -"${DDRESCUELOG}" -x ${map4} ${map5} > out || test_failed $LINENO +"${DDRESCUELOG}" -x "${map4}" "${map5}" > out || test_failed $LINENO "${DDRESCUELOG}" -D out && test_failed $LINENO -"${DDRESCUELOG}" -x out ${map3} > mapfile || test_failed $LINENO +"${DDRESCUELOG}" -x out "${map3}" > mapfile || test_failed $LINENO "${DDRESCUELOG}" -d mapfile || test_failed $LINENO -"${DDRESCUELOG}" -x ${map5} ${map3} > out || test_failed $LINENO +"${DDRESCUELOG}" -x "${map5}" "${map3}" > out || test_failed $LINENO "${DDRESCUELOG}" -D out && test_failed $LINENO -"${DDRESCUELOG}" -x out ${map4} > mapfile || test_failed $LINENO +"${DDRESCUELOG}" -x out "${map4}" > mapfile || test_failed $LINENO "${DDRESCUELOG}" -d mapfile || test_failed $LINENO -"${DDRESCUELOG}" -x ${map5} ${map4} > out || test_failed $LINENO +"${DDRESCUELOG}" -x "${map5}" "${map4}" > out || test_failed $LINENO "${DDRESCUELOG}" -D out && test_failed $LINENO -"${DDRESCUELOG}" -x out ${map3} > mapfile || test_failed $LINENO +"${DDRESCUELOG}" -x out "${map3}" > mapfile || test_failed $LINENO "${DDRESCUELOG}" -d mapfile || test_failed $LINENO # test AND -for i in ${map1} ${map2} ${map3} ${map4} ${map5} ; do - for j in ${map1} ${map2} ${map3} ${map4} ${map5} ; do - "${DDRESCUELOG}" -y $j $i > out || test_failed $LINENO "$i $j" - "${DDRESCUELOG}" -y $i $j > copy || test_failed $LINENO "$i $j" +for i in "${map1}" "${map2}" "${map3}" "${map4}" "${map5}" ; do + for j in "${map1}" "${map2}" "${map3}" "${map4}" "${map5}" ; do + "${DDRESCUELOG}" -y "$j" "$i" > out || test_failed $LINENO "$i $j" + "${DDRESCUELOG}" -y "$i" "$j" > copy || test_failed $LINENO "$i $j" "${DDRESCUELOG}" -P out copy || test_failed $LINENO "$i $j" done done -"${DDRESCUELOG}" -b2048 -l+ ${map1} > out || test_failed $LINENO -"${DDRESCUELOG}" -y ${map1} - < ${map2} > mapfile || test_failed $LINENO -"${DDRESCUELOG}" -P ${blank} mapfile || test_failed $LINENO +"${DDRESCUELOG}" -b2048 -l+ "${map1}" > out || test_failed $LINENO +"${DDRESCUELOG}" -y "${map1}" - < "${map2}" > mapfile || test_failed $LINENO +"${DDRESCUELOG}" -P "${blank}" mapfile || test_failed $LINENO "${DDRESCUELOG}" -b2048 '-l?' mapfile > copy || test_failed $LINENO cmp out copy || test_failed $LINENO -"${DDRESCUELOG}" -y ${map2} ${map1} > mapfile || test_failed $LINENO -"${DDRESCUELOG}" -P ${blank} mapfile || test_failed $LINENO +"${DDRESCUELOG}" -y "${map2}" "${map1}" > mapfile || test_failed $LINENO +"${DDRESCUELOG}" -P "${blank}" mapfile || test_failed $LINENO "${DDRESCUELOG}" -b2048 -l- mapfile > copy || test_failed $LINENO cmp out copy || test_failed $LINENO -"${DDRESCUELOG}" -b2048 -i0x2000 -s0x2800 -l+ ${map1} > out || +"${DDRESCUELOG}" -b2048 -i0x2000 -s0x2800 -l+ "${map1}" > out || test_failed $LINENO -"${DDRESCUELOG}" -i0x1800 -s0x3800 -y ${map2} ${map1} > mapfile || +"${DDRESCUELOG}" -i0x1800 -s0x3800 -y "${map2}" "${map1}" > mapfile || test_failed $LINENO "${DDRESCUELOG}" -b2048 -l- mapfile > copy || test_failed $LINENO cmp out copy || test_failed $LINENO -"${DDRESCUELOG}" -y ${map3} ${map4} > out || test_failed $LINENO -"${DDRESCUELOG}" -P ${blank} out || test_failed $LINENO -"${DDRESCUELOG}" -y ${map3} ${map5} > out || test_failed $LINENO -"${DDRESCUELOG}" -P ${blank} out || test_failed $LINENO -"${DDRESCUELOG}" -y ${map4} ${map5} > out || test_failed $LINENO -"${DDRESCUELOG}" -P ${blank} out || test_failed $LINENO +"${DDRESCUELOG}" -y "${map3}" "${map4}" > out || test_failed $LINENO +"${DDRESCUELOG}" -P "${blank}" out || test_failed $LINENO +"${DDRESCUELOG}" -y "${map3}" "${map5}" > out || test_failed $LINENO +"${DDRESCUELOG}" -P "${blank}" out || test_failed $LINENO +"${DDRESCUELOG}" -y "${map4}" "${map5}" > out || test_failed $LINENO +"${DDRESCUELOG}" -P "${blank}" out || test_failed $LINENO -"${DDRESCUELOG}" -i0x2000 -s0x2800 -z ${map2} ${map1} > mapfile || +"${DDRESCUELOG}" -i0x2000 -s0x2800 -z "${map2}" "${map1}" > mapfile || test_failed $LINENO "${DDRESCUELOG}" -D mapfile [ $? = 1 ] || test_failed $LINENO @@ -566,105 +540,105 @@ cmp out copy || test_failed $LINENO "${DDRESCUELOG}" -i0x2000 -s0x2800 -d mapfile || test_failed $LINENO # test OR -for i in ${map1} ${map2} ${map3} ${map4} ${map5} ; do - for j in ${map1} ${map2} ${map3} ${map4} ${map5} ; do - "${DDRESCUELOG}" -z $j $i > out || test_failed $LINENO "$i $j" - "${DDRESCUELOG}" -z $i $j > copy || test_failed $LINENO "$i $j" +for i in "${map1}" "${map2}" "${map3}" "${map4}" "${map5}" ; do + for j in "${map1}" "${map2}" "${map3}" "${map4}" "${map5}" ; do + "${DDRESCUELOG}" -z "$j" "$i" > out || test_failed $LINENO "$i $j" + "${DDRESCUELOG}" -z "$i" "$j" > copy || test_failed $LINENO "$i $j" "${DDRESCUELOG}" -P out copy || test_failed $LINENO "$i $j" done done -"${DDRESCUELOG}" -z ${map1} - < ${map2} > out || test_failed $LINENO -"${DDRESCUELOG}" -z ${map2} ${map1} > copy || test_failed $LINENO +"${DDRESCUELOG}" -z "${map1}" - < "${map2}" > out || test_failed $LINENO +"${DDRESCUELOG}" -z "${map2}" "${map1}" > copy || test_failed $LINENO "${DDRESCUELOG}" -p out copy || test_failed $LINENO "${DDRESCUELOG}" -d out || test_failed $LINENO "${DDRESCUELOG}" -d copy || test_failed $LINENO -"${DDRESCUELOG}" -z ${map1} ${blank} > out || test_failed $LINENO -"${DDRESCUELOG}" -z ${blank} ${map1} > copy || test_failed $LINENO +"${DDRESCUELOG}" -z "${map1}" "${blank}" > out || test_failed $LINENO +"${DDRESCUELOG}" -z "${blank}" "${map1}" > copy || test_failed $LINENO "${DDRESCUELOG}" -p out copy || test_failed $LINENO -"${DDRESCUELOG}" -p out ${map1} || test_failed $LINENO -"${DDRESCUELOG}" -p ${map1} copy || test_failed $LINENO -"${DDRESCUELOG}" -z ${map3} ${map4} > out || test_failed $LINENO -"${DDRESCUELOG}" -z ${map4} ${map3} > copy || test_failed $LINENO +"${DDRESCUELOG}" -p out "${map1}" || test_failed $LINENO +"${DDRESCUELOG}" -p "${map1}" copy || test_failed $LINENO +"${DDRESCUELOG}" -z "${map3}" "${map4}" > out || test_failed $LINENO +"${DDRESCUELOG}" -z "${map4}" "${map3}" > copy || test_failed $LINENO "${DDRESCUELOG}" -p out copy || test_failed $LINENO -"${DDRESCUELOG}" -z ${map3} ${map5} > out || test_failed $LINENO -"${DDRESCUELOG}" -z ${map5} ${map3} > copy || test_failed $LINENO +"${DDRESCUELOG}" -z "${map3}" "${map5}" > out || test_failed $LINENO +"${DDRESCUELOG}" -z "${map5}" "${map3}" > copy || test_failed $LINENO "${DDRESCUELOG}" -p out copy || test_failed $LINENO -"${DDRESCUELOG}" -z ${map4} ${map5} > out || test_failed $LINENO -"${DDRESCUELOG}" -z ${map5} ${map4} > copy || test_failed $LINENO +"${DDRESCUELOG}" -z "${map4}" "${map5}" > out || test_failed $LINENO +"${DDRESCUELOG}" -z "${map5}" "${map4}" > copy || test_failed $LINENO "${DDRESCUELOG}" -p out copy || test_failed $LINENO -"${DDRESCUELOG}" -z ${map3} ${map4} > out || test_failed $LINENO +"${DDRESCUELOG}" -z "${map3}" "${map4}" > out || test_failed $LINENO "${DDRESCUELOG}" -D out && test_failed $LINENO -"${DDRESCUELOG}" -z out ${map5} > mapfile || test_failed $LINENO +"${DDRESCUELOG}" -z out "${map5}" > mapfile || test_failed $LINENO "${DDRESCUELOG}" -d mapfile || test_failed $LINENO -"${DDRESCUELOG}" -z ${map3} ${map5} > out || test_failed $LINENO +"${DDRESCUELOG}" -z "${map3}" "${map5}" > out || test_failed $LINENO "${DDRESCUELOG}" -D out && test_failed $LINENO -"${DDRESCUELOG}" -z out ${map4} > mapfile || test_failed $LINENO +"${DDRESCUELOG}" -z out "${map4}" > mapfile || test_failed $LINENO "${DDRESCUELOG}" -d mapfile || test_failed $LINENO -"${DDRESCUELOG}" -z ${map4} ${map3} > out || test_failed $LINENO +"${DDRESCUELOG}" -z "${map4}" "${map3}" > out || test_failed $LINENO "${DDRESCUELOG}" -D out && test_failed $LINENO -"${DDRESCUELOG}" -z out ${map5} > mapfile || test_failed $LINENO +"${DDRESCUELOG}" -z out "${map5}" > mapfile || test_failed $LINENO "${DDRESCUELOG}" -d mapfile || test_failed $LINENO -"${DDRESCUELOG}" -z ${map4} ${map5} > out || test_failed $LINENO +"${DDRESCUELOG}" -z "${map4}" "${map5}" > out || test_failed $LINENO "${DDRESCUELOG}" -D out && test_failed $LINENO -"${DDRESCUELOG}" -z out ${map3} > mapfile || test_failed $LINENO +"${DDRESCUELOG}" -z out "${map3}" > mapfile || test_failed $LINENO "${DDRESCUELOG}" -d mapfile || test_failed $LINENO -"${DDRESCUELOG}" -z ${map5} ${map3} > out || test_failed $LINENO +"${DDRESCUELOG}" -z "${map5}" "${map3}" > out || test_failed $LINENO "${DDRESCUELOG}" -D out && test_failed $LINENO -"${DDRESCUELOG}" -z out ${map4} > mapfile || test_failed $LINENO +"${DDRESCUELOG}" -z out "${map4}" > mapfile || test_failed $LINENO "${DDRESCUELOG}" -d mapfile || test_failed $LINENO -"${DDRESCUELOG}" -z ${map5} ${map4} > out || test_failed $LINENO +"${DDRESCUELOG}" -z "${map5}" "${map4}" > out || test_failed $LINENO "${DDRESCUELOG}" -D out && test_failed $LINENO -"${DDRESCUELOG}" -z out ${map3} > mapfile || test_failed $LINENO +"${DDRESCUELOG}" -z out "${map3}" > mapfile || test_failed $LINENO "${DDRESCUELOG}" -d mapfile || test_failed $LINENO # test ( a && b ) == !( !a || !b ) -for i in ${map1} ${map2} ${map3} ${map4} ${map5} ; do - for j in ${map1} ${map2} ${map3} ${map4} ${map5} ; do - "${DDRESCUELOG}" -n $i > na || test_failed $LINENO "$i $j" - "${DDRESCUELOG}" -n $j > nb || test_failed $LINENO "$i $j" +for i in "${map1}" "${map2}" "${map3}" "${map4}" "${map5}" ; do + for j in "${map1}" "${map2}" "${map3}" "${map4}" "${map5}" ; do + "${DDRESCUELOG}" -n "$i" > na || test_failed $LINENO "$i $j" + "${DDRESCUELOG}" -n "$j" > nb || test_failed $LINENO "$i $j" "${DDRESCUELOG}" -z nb na > out || test_failed $LINENO "$i $j" "${DDRESCUELOG}" -n out > copy || test_failed $LINENO "$i $j" - "${DDRESCUELOG}" -y $j $i > out || test_failed $LINENO "$i $j" + "${DDRESCUELOG}" -y "$j" "$i" > out || test_failed $LINENO "$i $j" "${DDRESCUELOG}" -P out copy || test_failed $LINENO "$i $j" done done -"${DDRESCUELOG}" --shift -o0x800 -s0x11448 ${map1} > out || test_failed $LINENO -"${DDRESCUELOG}" -p ${map2} out || test_failed $LINENO +"${DDRESCUELOG}" --shift -o0x800 -s0x11448 "${map1}" > out || test_failed $LINENO +"${DDRESCUELOG}" -p "${map2}" out || test_failed $LINENO -"${DDRESCUELOG}" --shift -o0x400 ${map1} > out || test_failed $LINENO +"${DDRESCUELOG}" --shift -o0x400 "${map1}" > out || test_failed $LINENO "${DDRESCUELOG}" --shift -o0x400 -s0x11848 out > copy || test_failed $LINENO -"${DDRESCUELOG}" -p ${map2} copy || test_failed $LINENO +"${DDRESCUELOG}" -p "${map2}" copy || test_failed $LINENO -"${DDRESCUELOG}" --shift -o0x400 ${map2} > out || test_failed $LINENO +"${DDRESCUELOG}" --shift -o0x400 "${map2}" > out || test_failed $LINENO "${DDRESCUELOG}" --shift -i0x400 -o0 out > copy || test_failed $LINENO -"${DDRESCUELOG}" -p ${map2} copy || test_failed $LINENO +"${DDRESCUELOG}" -p "${map2}" copy || test_failed $LINENO -"${DDRESCUELOG}" --shift -o0x900 ${map1} > copy || test_failed $LINENO +"${DDRESCUELOG}" --shift -o0x900 "${map1}" > copy || test_failed $LINENO "${DDRESCUELOG}" --shift -i0x300 -o0 copy > out || test_failed $LINENO "${DDRESCUELOG}" --shift -i0x600 -o0 out > copy || test_failed $LINENO -"${DDRESCUELOG}" -p ${map1} copy || test_failed $LINENO +"${DDRESCUELOG}" -p "${map1}" copy || test_failed $LINENO -"${DDRESCUELOG}" --shift -i0x800 -o0 ${map2} > copy || test_failed $LINENO +"${DDRESCUELOG}" --shift -i0x800 -o0 "${map2}" > copy || test_failed $LINENO "${DDRESCUELOG}" --shift -o0x488 copy > out || test_failed $LINENO "${DDRESCUELOG}" --shift -o0x378 out > copy || test_failed $LINENO -"${DDRESCUELOG}" -p ${map2} copy || test_failed $LINENO +"${DDRESCUELOG}" -p "${map2}" copy || test_failed $LINENO printf "\ntesting combined rescue..." rm -f mapfile || framework_failure -"${DDRESCUE}" -q ${in} out mapfile # rescue partition +"${DDRESCUE}" -q "${in}" out mapfile # rescue partition "${DDRESCUELOG}" --shift -o45 mapfile > shifted_mapfile "${DDRESCUE}" -q --same-file -o45 -s72776 --reverse out out -"${DDRESCUE}" -q -C ${fox} out shifted_mapfile # rescue rest of drive -cat ${fox} ${in} | cmp out - || test_failed $LINENO +"${DDRESCUE}" -q -C "${fox}" out shifted_mapfile # rescue rest of drive +cat "${fox}" "${in}" | cmp out - || test_failed $LINENO "${DDRESCUELOG}" -d mapfile || test_failed $LINENO "${DDRESCUELOG}" -d shifted_mapfile || test_failed $LINENO