The openssl did not seem to work for me. I got "unknown options" and other issues with the provided solutions. So I ended up going with the program fio.
fio -name="fill" -ioengine=libaio -direct=1 -bs=512m -rw=write -iodepth=4 -size=100% -filename=/dev/md0
Which seems to be taking 3 hours to do 19TB across 24 HDDs. So roughly 1,800 MB/s
smp-016:~ # fdisk -l /dev/md0
Disk /dev/md0: 18890.1 GB, 18890060464128 bytes
smp-016:~ # fio -name="fill" -ioengine=libaio -direct=1 -bs=512m -rw=write -iodepth=4 -size=100% -filename=/dev/md0
fill: (g=0): rw=write, bs=512M-512M/512M-512M/512M-512M, ioengine=libaio, iodepth=4
fio-2.2.10
Starting 1 process
Jobs: 1 (f=1): [W(1)] [2.7% done] [0KB/1536MB/0KB /s] [0/3/0 iops] [eta 03h:01m:11s]
I hope this is actually random data. The man page says fio "Default: fill buffers with random data." http://linux.die.net/man/1/fio
I'm not doing it for secure/encryption purposes, just trying to be sure my later read tests are actual data and not just 0's. This same fio command could be used for SSD/NVMe preconditioning. As just using /dev/zero can lead to disk level compression "cheating" how much is actually written. Although I would add a -loops=2
flag to it, if it is a fresh SSD for benchmarking.
If you did want it to be secure you may be able to use the -randrepeat=bool
option, as that will toggle "Seed the random number generator in a predictable way so results are repeatable across runs. Default: true.", but I'm still not certain how secure that would be.
Additionally some enterprise class HDDs out there are SED (Self Encrypting Drives) and will allow you to spin the encryption key to instantly and securely erasing all the data written.
Lastly, I have in the past used DBAN (aka Darik's Boot and Nuke), which has CD and USB bootable options and "is an open source project hosted on SourceForge. The program is designed to securely erase a hard disk until its data is permanently removed and no longer recoverable"
dd bs=1M
for example. – phemmer Apr 12 '13 at 16:06iostat -kx 10
to see what busy % on the drive is. – derobert Apr 12 '13 at 17:53shred -v -n 1 /dev/overwritethis
is fast. It's about the only case whereshred
is actually useful for something. – frostschutz Apr 12 '13 at 19:14