Alter.Org.UA  
 << Back Home RU ru   Donate Donate www/www1/www2

Bad Block Copy for Windows

Copies data from file or raw harddisk ignoring Bad Blocks. If target file doesn't exists, ZEROs are written instead of unreadable blocks. If target file exists, its blocks, coresponding to Bad Blocks in source are not touched. Thus, if you have some copies of the same file with Bad Blocks in different places, it is possible to completly restore the original file. To do this you should run bbcopy.exe with same target, but different sources. You can use other harddisk of same of greater size as target.

Works under all Windows versions - Windows (95/98/Me/NT/2000/XP/etc.).

bbcopy is similar to Unix dd utility. The main difference is that bbcopy is oriented on data recovery. Thus, it has 'ignore errors' mode and equal input and output offsets by default.

Usage:
  bbcopy.exe [-<switches>] <source file> <target file>
    or
  bbcopy.exe [-<dd-style options>]
Switches:
  -b[k] <blocksize>   sets physical block (sector) size for media. 2048 (2k) is default.
  -B[k] <blocksize>   sets I/O block size. 64k is default.
  -o[b|k|m|g] <offset>  offset in bytes (or optionally in blocks, KBytes, MBytes or GBytes)
                      to start recovery from
  -c[b|k|m|g] <count>   number of bytes (or optionally in blocks, KBytes, MBytes or GBytes)
                      to recover
  -r <retry>          number of retry attempts. 3 is default
  -e <max errors>     abort copying after specified number of sequential errors
  -f                  fall-back to physical sector-by-sector mode, when I/O block
                        cannot be read in single request (contains some bad sectors)
  -l <logfile>        log unreliable and bad blocks to <logfile>
  -s                  fill unreadable parts with '** BAD BLOCK ***'
  -S <string>         fill unreadable parts with <string>
                      Do not use fill patterns if you restore from multiple copies
  -n                  use NO CACHE option for file/device I/O
                        This option is automatically enabled for block devices
  -d[i|o] <num>       specify input (i) or output (o) block device <num>
                        this is short form for \\.\\PhysicalDrive<num>
  -?                  display this help
DD-style options:
  if=<source file>    or    ifd=<num>
  of=<target file>    or    ofd=<num>
  bs=<bytes>
  iobs=<bytes>
  ioseek=<blocks>
  count=<blocks>
Note:
  1 KByte = 1024 bytes
  1 MByte = 1024 KBytes = 1024*1024 bytes
  if byte offset or byte count is specified, it will be rounded to blocksize
Examples:
  bbcopy.exe -o 5000000 X:\Video.dat E:\Temp\Restored_Film.dat
    will copy data starting from byte offset 5000000 to end of file
  bbcopy.exe -om 1300 -cm 1000 X:\Video.dat E:\Temp\Restored_Film.dat
    will copy not more than 1000Mb of data starting from byte offset 1300Mb
  bbcopy.exe -f -r 1 -b 512 -Bk 64 -l hdd.log \\.\\PhysicalDrive2 \\.\\PhysicalDrive3
    or
  bbcopy.exe -f -r 1 bs=512 iobs=65536 log=hdd.log ifd=2 ofd=3
    will copy from harddisk2 to harddisk3 with optimal transfer block 64k
    if 64k cannot be read, fall back to 512 bytes blocks for damaged area

Download

The latest version with sources - bb_copy_v2c.rar/tgz (39.3 Kb/42.9 Kb)

History

Implemented error reporting in all cases of wrong parameters.
bb_copy_v2c.rar/tgz (39.3 Kb/42.9 Kb)
2014.01.25

Fixed handling of -o and -c options.
bb_copy_v2b.rar/tgz (38.9 Kb/42.5 Kb)
2013.06.18

Fixed handling of not aligned file tail in non-cached mode.
bb_copy_v2a.rar/tgz (38.8 Kb/42.4 Kb)
2012.09.20

A lot of fixes. Now it really works :)
bb_copy_v2.rar/tgz (38.6 Kb/42.1 Kb)
2011.05.18

  • Significantly improved transfer rate.
  • I've found and fixed still one bug in handling -c.
  • Added some unix dd-style options.
  • I've found, that it is necessary to disable I/O caching when deal to large files. Otherwise I.O operations fail with status INSUFFICIENT RESOURCES. It means, that system cannot allocate memory for some internal structures. Size limit for my PS (320 Mb RAM) appeared to be about 150Gb. In order to overcome this problem I've added option -n to disable caching manually. Also, caching is disabled automatically for block devices and 'large' files. File is assimed to be 'large' of its size exceeds 2Gb under 9x and 100Gb - under NT family OSes.
    bb_copy_v1i.rar/tgz (37.1 Kb/40.5 Kb)
    2011.03.18

  • I had to restore data from badblocked HDD. So, I added -e, -B, -f, -di, -do options to efficiently handle block devices. Works under NT family only.
  • I've found and fixed bug in handling -c и -o.
    bb_copy_v1h.rar/tgz (34.6 Kb/37.1 Kb)
    2010.08.21

  • Added -s and -S options, prompted by Jiri. These options specify fill pattern for unreadable blocks. I do not recommend using this option when target file already exists. This may happen when you restore data from multiple copies or make 2nd attempt to read damaged file, With this options previously read blocks may be overwritten if 2nd attempt fails.
  • I've found and fixed bug with recovering small files (those have size less than device block size).
    bb_copy_v1g.rar/tgz (31.4 Kb/33.4 Kb)
    2007.10.25

    Fixed bug with crash on files of size between 2Gb and 4Gb.
    Thanks to Jiri for bug-report.
    bb_copy_v1f.rar/tgz (30.9 Kb/32.7 Kb)
    2007.05.11

    Fixed still some mistakes in text messages.
    bb_copy_v1e.rar/tgz (30.6 Kb/32.4 Kb)
    2004.11.03

    Fixed minor bugs with text messages under Windows 95/98/Me.
    bb_copy_v1d.rar/tgz (30.6 Kb/32.3 Kb)
    2004.10.31

    Due to customer's requests I have added Windows 95/98/Me support. Enjoy!
    bb_copy_v1c.rar/tgz (29.7 Kb/31.4 Kb)
    2004.10.26

    bb_copy_v1b.rar/tgz (26.1 Kb/27.4 Kb)
  • Implemented options for setting recovery start position and amount of data to be recovered. For example if midle part of file cannot be read in 3 attempts, you can specify greater number specially for this part. These values can be specified in bytes, KBytes and MBytes.
  • Still one new feature - bad and unreliable block logging. You can leave utility alone and later view information about damaged parts of file.
    2004.06.30

    This version allows you to specify number of read retries for bad blocks. bb_copy_v1a.rar/tgz (24.6 Kb/25.8 Kb)
    2004.03.03

    Distribution (with sources): bb_copy_v1.rar/tgz (19.3 Kb/20.1 Kb)
    2003.11.14

    Please, send your comments and propositions here: Mail to alterX@alter.org.ua (remove X)  

  • designed by Alter aka Alexander A. Telyatnikov powered by Apache+PHP under FBSD © 2002-2014