Created
January 3, 2013 13:17
-
-
Save homelinen/4443417 to your computer and use it in GitHub Desktop.
Short script to test read and write on a disk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Some simple read and write tests using dd | |
# Write | |
echo "Write" | |
dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc | |
# Read Without Cache | |
echo "Read w/o Cache" | |
sudo echo 3 > sudo /proc/sys/vm/drop_caches | |
dd if=tempfile of=/dev/null bs=1M count=1024 | |
# Read With Cache | |
echo "Read w/ Cache" | |
dd if=tempfile of=/dev/null bs=1M count=1024 | |
# tempfile no longer needed | |
rm tempfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
commit 462e5
Line 10
sudo echo 3 > sudo /proc/sys/vm/drop_caches
Second
sudo
is a typo.