On 6/16/2023 12:21 AM, Steve Hayes wrote:
> I use a USB flash drive to transfer my working data files between by
> dsktop computer (running Windows XP) and my laptop computer (running
> Windows 7.
>
> I used to do most of this this using Dropbox, but Dropbox stopped
> working on Windows XP, so I've done it with a flash drive since then.
>
> Recently, however, one of my data files, for the Rootsmagic genealogy
> program, started getting corrupted in the transfer.
>
> This is the command I use to transfer it from the flash drive to the
> desktop computer (which runs WinXP):
>
> XXCOPY J:\Dropbox\*.* G:\Stevedoc\Dropbox\ /BN /s /y
>
> Where J: is the flash drive and G: is a hard drive on my computer.
>
> That command is part of a batch file which I run every time I need to
> transfer the files. I use similar commands copy files to the flash
> drive.
>
> When the Rootsmagic V7 data file reached 100 Mb, however, it started
> being corrupted.
>
> It seems to be corrupted only when copying from the flash drive to the
> hard drive, on both computers. It does not seem to be corrupted when
> copying from the hard drive to the flash drive. When I notice it is
> corrupted, I copy it manually, using FlashCommander, and that seems to
> copy the file without corruption.
>
> Does anyone know of any limitation of both XXCOPY and ROBOCOPY that
> would cause them to produce errors when copying files over 100 Mb?
>
> Or could the problem be in the use of the command in a batch file, so
> that the batch file tries to run the next command before the computer
> has finished copying the file to the hard drive? If so, is there way
> of delaying it until the copying is finished?
Would the Rootsmagic V7 data file (sqlite), currently be open
by the program ? Does any part of the program run, even when
the GUI is not visible ?
Sometimes a service, or even some sort of license enforcement, may
be meddling with the file.
If you boot any other OS on the machine, you may be able to
make a copy from there, because at that point, any tricky
Rootsmagic protections will be "at rest".
If you boot the Win7 installer DVD, use the Troubleshooting section,
then Command Prompt, there may be a copy of "robocopy" in there.
On an OS like WinXP, you had to install Robocopy XP026 yourself.
But later OSes, the utility became "supported" and issued on
the system partition.
*******
You have the option of creating "duff" files for test.
fsutil can create files, but they are "sparse" on NTFS and
don't take space on the source drive.
On other OSes, they had a "mkfile" utility which I liked for this.
On Windows, we can use a third party tool. When the window appears, wait
about 15 seconds, and the 200KB file will download.
http://www.chrysocome.net/downloads/dd-0.6beta3.zip
The thing is portable and does not install. Just unpack "dd.exe" for usage.
I just copied mine to my scratch partition which is D:
D:
md results # Make a place to examine the results of the copy test.
dd.exe --list # This is how you discover the names of partitions
# for usage when crafting commands. We are just working with
# a single file, so do not need this info right now. The
# existence of virtual device "/dev/zero" will be listed there.
dd.exe if=/dev/zero of=zeroes.bin bs=1M count=1024 # Make a 1GB file of zeroes
dd.exe if=/dev/zero of=zeroes.bin bs=1M count=100 # Make a 100MB file of zeroes
dd.exe if=/dev/random of=rand.bin bs=1M count=100 # Make a 100MB file of random data
sha1sum zeroes.bin # record the checksum of a test file, which will be copied
sha1sum rand.bin # record the checksum of a test file, which will be copied
copy zeroes.bin K:\zeroes.bin # copy to the USB drive
copy K:\zeroes.bin D:\results\zeroes.bin # copy back to a system disk
sha1sum D:\results\zeroes.bin # compare checksum to original
That's just to illustrate a quick way to make files. The "dd.exe"
can make files as fast as the storage can go (about 2.5GB/sec). This
run took four seconds. The random file would take eight seconds.
06/16/2023 06:00 AM 10,737,418,240 zeroes.bin
7ZIP has a context menu and SHA1 and SHA256 sums are offered.
Name: zeroes.bin
Size: 10737418240 bytes (10 GiB)
SHA1: A0B6E2CA4E28360A929943E8EB966F703A69DC44
Now if I copy that file around, I can check for corruption by
running the SHA1SUM again.
Even MD5SUM is sufficient for checking for file corruption
(any sort of hash like that can be used as a signature). If
all you had, was an ancient copy of MD5SUM.exe, that's OK as
a tool for corruption testing as well. The only algo which is
too weak, is "sum.exe", which is an arithmetic sum of all bytes.
You can disable system write caching on individual devices
(such as a USB stick). I could not find the setting to
disable it for the entire W7 computer.
But first, I want to see you copy a representative test file,
one which RootsMagic will not have open.
I don't think this is a write caching issue. That particular
file is affected, because some executable has the file open
and has not told you that. The Sysinternals utility "handle.exe"
or Process Explorer has a copy of Handle inside, these can be
used to detect an executable has a file open. I'm not recommending
that as a first step at the moment, because I just want to test
your USB stick is working OK with benign test files. It is sometimes
hard to get handle.exe working properly.
Paul