Copying to usb flash drive corrupts files

Hans Petter Selasky hselasky at c2i.net
Tue Feb 19 08:24:08 PST 2008


On Monday 18 February 2008, Łukasz Sromek wrote:
> > Maybe your memory stick is corrupted ?
>
> It works (tested today) under Windows. I have used it with several
> linux distros in the past without problems.
>
> Things got even more weird today... Now copying with sync option
> enabled don't help at all :(
>
> Besides, another strange problem appeared:
> I copy some files to memory stick under FreeBSD
> Reboot and read them under Windows (they contain errors, of course...)
> Then I copy some files under Windows.
> Another reboot into windows - I can see files that were copied under
> FreeBSD (with errors) and Windows (no errors).
> Reboot into FreeBSD. I mount memory stick ang guess what? I see only
> files that were copied under FreeBSD :) Files copied during Windows
> session disappeared...
>
> > What is the brand ?
>
> da0 at umass-sim0 bus 0 target 0 lun 0
> da0: <SigmaTel MSCN 0100> Removable Direct Access SCSI-4 device
> da0: 1.000MB/s transfers
> da0: 494MB (1012992 512 byte sectors: 64H 32S/T 494C)

Hi,

Is this some kind of phone ?

Have you tried to "fsck_msdosfs" the partition where the FAT filesystem 
resides ?

Maybe you could do like this:

dd if=/dev/urandom of=/tmp/myrandomfile bs=65536 count=64

Then copy that file to the flash. "umount" and "mount". Then copy the file 
back to your disk again. After that you do a:

cat /tmp/myrandomfile | hexdump > /tmp/myrandomfile.txt

Then you compare the two .txt files using "diff".

--HPS


More information about the freebsd-usb mailing list