Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Benchmark your SSD or hard disk speed' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Benchmark your SSD or hard disk speed
Authored by: RogParish on Jul 13, '12 09:01:23AM

When I tried:

time dd if=/dev/zero bs=1024k of=tstfile count=1024 2>&1 | grep sec | awk '{print "scale = 2 ; "$(NF-1048576) "}' | bc

I got:

awk: non-terminated string }cale = 2 ... at source line 1
context is
>>> <<<
awk: giving up
source line number 2

Mac OS X Lion 10.7.4

---
Roger
Lovettsville, VA



[ Reply to This | # ]
Benchmark your SSD or hard disk speed
Authored by: bobsc on Jul 13, '12 10:06:59AM

That awk line has an extra quote, it appears.
Any way, I found that this works:

time dd if=/dev/zero bs=1024k of=tstfile count=1024 2>&1 | grep sec | awk '{print $1 / 1024 / 1024 / $5, "MB/sec" }'

You don't need bc at all, awk can do the arithmetic. I am dividing the total bytes by the total seconds and by

By the way, my standard internal drive in my 27" iMac (2.8GHz, a couple of years old) did the writing at 91 MB/sec.

---
bobsc



[ Reply to This | # ]
Benchmark your SSD or hard disk speed
Authored by: bobsc on Jul 13, '12 11:50:35AM

Even better, leave out grep also. Awk can do its own pattern matching:


time dd if=/dev/zero bs=1024k of=tstfile count=1024 2>&1 | awk '/sec/ {print $1 / $5 / 1048576, "MB/sec" }'

---
bobsc



[ Reply to This | # ]