Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Feb 2008 12:04:53 -0500
From:      Chuck Robey <chuckr@chuckr.org>
To:        =?UTF-8?B?xYF1a2FzeiBTcm9tZWs=?= <lukasz.sromek@gmail.com>
Cc:        freebsd-usb@freebsd.org
Subject:   Re: Copying to usb flash drive corrupts files
Message-ID:  <47B9BAB5.6000903@chuckr.org>
In-Reply-To: <32f529bc0802180102m6fa12e32x1903e3a8b98a70b3@mail.gmail.com>
References:  <32f529bc0802180102m6fa12e32x1903e3a8b98a70b3@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ɓukasz Sromek wrote:
> Hello.
> 
> I asked this question on bsdforums.org, but I got no answer. I guess
> this list is a better place to post problems like this.
> 
> When I copy mp3s from hard drive to usb stick they become corrupted.
> 
> lukasz ~% mount /mnt/usb
> lukasz ~% cp file.mp3 /mnt/usb
> lukasz ~% diff file.mp3 /mnt/usb/file.mp3
> lukasz ~% umount /mnt/usb
> lukasz ~% mount /mnt/usb
> lukasz ~% diff file.mp3 /mnt/usb/file.mp3
> Files file.mp3 and /mnt/usb/file.mp3 differ
> 
> If I set sync option in fstab:
> 
> /dev/da0 /mnt/usb msdosfs rw,noauto,sync 0 0
> 
> Then files are copied correctly, but very slowly, when buffer size is
> low. Midnight Commander uses 8k buffers, so I get about 20kB/s which
> is unacceptable.
> 
> I'm using FreeBSD 7.0-RC2.
> 
> Could you help me with this issue?

Dunno if anyone else has responded to you or not, but it's possible that
you might not realize that the write speed of flash memories is,
comparatively speaking, slow as molasses in wintertime.  When you buy flash
memories, any GOOD ones will advertise their write (and read, for that
matter) speeds.  If they don't, it's because they[re particularly
embarrassed about them.  On top of the read/write speeds being so slow, the
nature of our file systems hides the fact that a function such as a copy
actually takes far longer than just the return time of the cp process.
Normally, this isn't a problem, because when you go to dismount the memory,
it will normally refuse to complete the dismount until all of the copying
has actually completed.

Is there any possibility thsat you might have misinterpreted the slwo
response time of umount, and tried to hurry it's finish time?  Because,
that would most certainly cause the data being wrong.  As far as thjings
being slow, if you spend more money on your flash, and get one's with a
speedier read/write time, you'll find the process taking much less time.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHubq1z62J6PPcoOkRAv6+AJ90M886Td33PEv/UwMy2l7DrqGRrQCbBNWo
71qdbiPTvlB4YbmnDPhdbwc=
=eQh5
-----END PGP SIGNATURE-----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?47B9BAB5.6000903>