I'm trying to fill up a disk drive with random data (3TB). Mainly to overwrite the whole disk with gibberish, but also for the fun of doing it myself.
I'm aware that there are plenty of programs for that.
So I was wondering what would be the fastest method of writing data.
Currently I just use std::fstream. I get about 100MB per second, the buffer size for each call to fstream::write() is 512kB (currently).
I didn't play around with different buffer sizes, yet, and I'm not sure how the OS buffering interferes with the writing of large amounts of data.
Can I control the buffering in any way? Should I?