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 -
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.
bbcopy.exe [-<switches>] <source file> <target file>
bbcopy.exe [-<dd-style options>]
-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)
-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
if=<source file> or ifd=<num>
of=<target file> or ofd=<num>
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
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
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
The latest version with sources -
bb_copy_v2c.rar/tgz (39.3 Kb/42.9 Kb)
Implemented error reporting in all cases of wrong parameters.
bb_copy_v2c.rar/tgz (39.3 Kb/42.9 Kb)
Fixed handling of -o and -c options.
bb_copy_v2b.rar/tgz (38.9 Kb/42.5 Kb)
Fixed handling of not aligned file tail in non-cached mode.
bb_copy_v2a.rar/tgz (38.8 Kb/42.4 Kb)
A lot of fixes. Now it really works :)
bb_copy_v2.rar/tgz (38.6 Kb/42.1 Kb)
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)
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)
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)
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)
Fixed still some mistakes in text messages.
bb_copy_v1e.rar/tgz (30.6 Kb/32.4 Kb)
Fixed minor bugs with text messages under Windows 95/98/Me.
bb_copy_v1d.rar/tgz (30.6 Kb/32.3 Kb)
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)
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.
This version allows you to specify number of read retries for bad blocks.
bb_copy_v1a.rar/tgz (24.6 Kb/25.8 Kb)
Distribution (with sources):
bb_copy_v1.rar/tgz (19.3 Kb/20.1 Kb)
Please, send your comments and propositions here:
or mail alterX@alter.org.ua (remove X)