On Fri, Feb 09, 2024 at 08:23:30AM -0500, Dan Ritter wrote:
> to...@tuxteam.de wrote: 
> > On Fri, Feb 09, 2024 at 07:50:18AM -0500, Stefan Monnier wrote:
> > > So, if you want to use `badblocks`, you may want to do it on an
> > > encrypted partition (that covers the whole device) rather than on the
> > > raw device.
> > 
> > This is an interesting idea. I haven't wrapped my head around "what if
> > the controller maps several block addresses to the same physical block"?
> > 
> > Perhaps you'd have to fill the disk and check afterwards?
> 
> Blocks are very likely to be 128KB, sometimes 64KB.
> 
> I would (I have, in the past) generate a non-random but mostly
> incompressible large file -- a compressed movie is pretty good for this -- 
> use md5sum to get its hash, and then write it under a variety of
> names until I fill the disk. 
> 
> Then read back each file and compare the md5sum of each file to
> the known value. They should be all the same.
> 
> I found a bad RAID controller this way.

What I'd do is encrypt the block number (in whichever form) padded
with zeros to block size with some symmetric scheme (e.g. AES) and
a constant symmetric key. That should be "random enough" and still
repeatable in the sense that, given the block number you know how
it is supposed to look like.

Plus, if you're lucky and have chosen the cipher judiciously, your
CPU might help you to make it fast.

Cheers
-- 
t

Attachment: signature.asc
Description: PGP signature

Reply via email to