zs3.me

Randomized Filler & Verifier

Revision 1
© 2017, 2026 by Zack Smith. All rights reserved.

My randomized filler & verifier

This is my utility to verify drive integrity.

It writes pseudorandom files, by default 1 gigabyte each, containing pseudorandom bytes where the seed for each file's bytes is based on the file number e.g.

  • file0000.dat has seed 0.
  • file0007.dat has seed 7.
  • file0123.dat has seed 123.
  • Et cetera.

This ensures that later, after we purge cached file data from RAM (e.g. by rebooting), we can reconstruct in RAM the exact same pseudorandom data that should be in each file and then compare to what is actually on disk (not cached in RAM) to determine whether the drive contains the correct data, or whether it became corrupted.

When it becomes impossible to write 1GB files due to diminishing free space, the utility will progressively write out smaller and smaller files.

Usage

Let's say you have 220GB of free space on a drive and you want to fill it with pseudorandom files. You would cd to the drive and then type:

 randomFillerVerifier 230

The reason for the higher number is that the code will produce smaller files toward the end, as the drive fills up. So you add 5 or 10 to the original amount of free space, to allow for files of size 0.5GB, 0.25GB etc.

Later, after a reboot, you would use this command to verify those files, which tells you about the drive's integrity:

 randomFillerVerifier -v 230

Download

1190146534