From: Jan Seeger <jan.seeger@thenybble.de>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Re: jffs2 on gentoo
Date: Sun, 16 Mar 2008 19:03:11 +0100 [thread overview]
Message-ID: <20080316180311.GA5265@venus> (raw)
In-Reply-To: <20080316083804.GA12745@venus>
[-- Attachment #1: Type: text/plain, Size: 1578 bytes --]
As a followup, I have actually written said script (in perl), and would welcome
any improvement comments. File size of the test file shouldn't matter, since
without wear leveling, the same cells should get written over and over again.
Only thing I need to do now is run it for a long time... Unfortunately, I need
linux for that since we need to mount the drive sync. And I have no live CD in
the house... Ts. What have I come to?
Anyway, here's the script:
use strict;
use warnings;
use Digest::MD5;
use Getopt::Std;
use File::Basename;
use File::Spec;
use File::Copy;
my %opts;
getopts("d:i:",\%opts);
if (! $opts{d} || ! $opts{i}) {
die <<"EOF"
-d: Mountpoint of drive to be tested. Should be mounted with "sync" mount option.
-i: Input file. Will be copied to mountpoint to test integrity.
Leave running for a long time to "test" your USB stick.
EOF
}
my $counter = 0;
my $originaldigest;
my $outfilename = File::Spec->catfile($opts{d},(fileparse($opts{i}))[0]);
my $digester = Digest::MD5->new();
open my $handle,"<$opts{i}";
binmode($handle);
$digester->addfile($handle);
close($handle);
$originaldigest = $digester->digest();
while (1) {
print "Running test $counter.\n";
copy($opts{i},$outfilename);
open my $outhandle,"<$outfilename";
binmode($outhandle);
$digester->addfile($outhandle);
if ($digester->digest() ne $originaldigest) {
die "Failed write at read $counter.\n";
}
close($outhandle);
unlink($outfilename);
$counter++;
}
--
thenybble.de/blog/ -- four bits at a time
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2008-03-16 18:03 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-14 18:27 [gentoo-user] jffs2 on gentoo James
2008-03-14 18:52 ` Dan Farrell
2008-03-15 20:08 ` [gentoo-user] " James
2008-03-15 23:14 ` Stroller
2008-03-16 8:38 ` Jan Seeger
2008-03-16 9:46 ` Alan McKinnon
2008-03-16 18:03 ` Jan Seeger [this message]
2008-03-16 21:43 ` W.Kenworthy
2008-03-16 21:52 ` Neil Bothwick
2008-03-17 7:47 ` Jan Seeger
2008-03-15 10:50 ` [gentoo-user] " Florian Philipp
2008-03-15 19:38 ` dexters84
2008-03-15 20:17 ` [gentoo-user] " James
2008-03-15 23:19 ` Stroller
2008-03-16 0:08 ` dexters84
2008-03-17 18:10 ` James
2008-03-18 1:47 ` Stroller
2008-03-18 10:33 ` Florian Philipp
2008-03-18 13:47 ` Stroller
2008-03-18 19:02 ` dexters84
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080316180311.GA5265@venus \
--to=jan.seeger@thenybble.de \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox