panthema / 2013 / disk-filltest
Thumbnail of a pie chart filling to 100%

disk-filltest - Simple Tool to Detect Bad Disks by Filling with Random Data

TalkBox
Gravatar xrosolar: I did something similar but I use the same 30 GB data set with known md5s. I repeatedly go through the files and check the sums. You would be surprised (or not) but after 24h of this some drives start giving wrong sums. And this is on systems that have been put through extensive burn-ins with prime95 and memtest and more. For example I have this one 500gb drive from WD blue that after a while throws bad sums on this test. Amazing stuff, I have kept the drive for science, and not rma'ed it. Cool site btw. VERY COOL!



Posted on 2013-03-27, last updated 2013-05-07 by Timo Bingmann at Permlink.

The number of hard disk produced in the last five years is huge. Of course, this is the same number of hard disks that will most probably fail in the next five years, possibly with catastrophic consequences for the particular user or business.

The simple tool disk-filltest can help, together with S.M.A.R.T. monitoring, to check disks periodically and thus be forewarned about coming failures. The function of disk-filltest is simple:

The method is simple and effective, however, it of course does not verify other files on the disk. That is a different task, which can be solved efficiently using digup (a Digest Updating Tool).

Another useful side-function of disk-filltest is to measure read/write speed while filling the disk. Slow speeds may also indicate a future failure, or just bad disk controlling.

The program runs on Linux, Windows and probably any other POSIX-compatible system. The whole source code is just one .c-file.

Downloads

disk-filltest 0.7.1 (current) released 2013-05-07
Source code archive: disk-filltest-0.7.1.tar.bz2 (14 KiB) Browse online
Generic Linux binaries: disk-filltest-0.7.1-linux.tar.bz2 (9 KiB)
Win32/MinGW binary: disk-filltest-0.7.1-win32.zip (20 KiB)

The source code is published under the GNU General Public License v3 (GPL), which can be found in the file COPYING.

A git repository containing all sources and revisions is fetchable by running
git clone https://github.com/bingmann/disk-filltest.git

Short Usage Guide

Just call disk-filltest on the command line, optionally adding -u. The tool will fill the current directory with random data files. About 575 GiB were free in the example directory, as seen from the run below:

tb@deka ~/datahdd $ disk-filltest -u
Writing files random-######## with seed 1364065156
Wrote 1024 MiB random data to random-00000000 with 279.864766 MiB/s
Wrote 1024 MiB random data to random-00000001 with 107.078272 MiB/s
Wrote 1024 MiB random data to random-00000002 with 108.964478 MiB/s
Wrote 1024 MiB random data to random-00000003 with 115.551387 MiB/s
Wrote 1024 MiB random data to random-00000004 with 103.198904 MiB/s
Wrote 1024 MiB random data to random-00000005 with 107.402722 MiB/s
Wrote 1024 MiB random data to random-00000006 with 138.360599 MiB/s
Wrote 1024 MiB random data to random-00000007 with 113.862503 MiB/s
[...]
Wrote 1024 MiB random data to random-00000571 with 44.394972 MiB/s
Wrote 1024 MiB random data to random-00000572 with 32.891062 MiB/s
Wrote 1024 MiB random data to random-00000573 with 43.505017 MiB/s
Wrote 1024 MiB random data to random-00000574 with 10.343835 MiB/s
Error writing next file random-00000575: No space left on device
Wrote 138 MiB random data to random-00000575 with 28.315684 MiB/s
Verifying files random-######## with seed 1364065156
Read 1024 MiB random data from random-00000000 with 56.286455 MiB/s
Read 1024 MiB random data from random-00000001 with 23.081034 MiB/s
Read 1024 MiB random data from random-00000002 with 69.574330 MiB/s
Read 1024 MiB random data from random-00000003 with 105.285789 MiB/s
[...]
Read 1024 MiB random data from random-00000571 with 32.974293 MiB/s
Read 1024 MiB random data from random-00000572 with 29.421141 MiB/s
Read 1024 MiB random data from random-00000573 with 26.699826 MiB/s
Read 1024 MiB random data from random-00000574 with 14.714866 MiB/s
Error reading file random-00000575: No space left on device
Read 138 MiB random data from random-00000575 with 12.073844 MiB/s
Removing old files ...... [...] ..... total: 576.
tb@deka ~/datahdd $

Command Line Help

The tool has some pretty versatile command line functions, which are targeted for batched and automated runs.

tb@deka ~/datahdd $ disk-filltest -h
Usage: ./disk-filltest [-s seed] [-f file limit] [-S size] [-r] [-u] [-U] [-C dir]

Options: 
  -C <dir>            Change into given directory before starting work.
  -f <file number>    Only write this number of 1 GiB sized files.
  -r                  Only verify existing data files with given random seed.
  -s <random seed>    Use random seed to write or verify data files.
  -S <size>           Size of each random file in MiB (default: 1024).
  -u                  Remove files after successful test.
  -U                  Immediately remove files, but still write and verify via file handles.

The only option requiring more explanation is -U. In this mode, the tool will create the files random-######## as usual, but will immediately unlink() them from the file system (the directory stays empty). On Linux this is possible, because the tool can keep the file descriptors open and perform the usual write/read/verify sequence. The mode is very useful for batch checking, because the system will automatically free the used disk space when the program finishes, whether successfully or with an error!

ChangeLog

2013-05-07 - Timo Bingmann - v0.7.1

Older Downloads

disk-filltest 0.7 released 2013-03-27
Source code archive: disk-filltest-0.7.tar.bz2 (14 KiB) Browse online
Generic Linux binaries: disk-filltest-0.7-linux.tar.bz2 (9 KiB)
Win32/MinGW binary: disk-filltest-0.7-win32.zip (20 KiB)
RSS 2.0 Weblog Feed Atom 1.0 Weblog Feed Valid XHTML 1.1 Valid CSS (2.1)
Copyright 2005-2016 Timo Bingmann - Impressum