Setup your benchmark parameters:
BM_FILE=./benchmark_data.$$
BM_SIZE=10 # in GB
Write the file:
sync && echo 3 > /proc/sys/vm/drop_caches && dd if=/dev/zero of="$BM_FILE" bs=1G count=$BM_SIZE conv=fdatasync
Clear the pagecache, dentries and inode buffers, then read the file:
sync && echo 3 > /proc/sys/vm/drop_caches && dd if="$BM_FILE" of=/dev/null bs=1G count=$BM_SIZE
And of course, don't forget to clean it up when you're done:
rm -f "$BM_FILE"