[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: test usb drive read / write speed

On 04/23/2011 11:09 PM, Huang, Tao wrote:
hi list,

i was trying to find out among several microSD cards which one has the
fastest speed.
i searched the web and didn't see any efficient solutions.
are there conventional ways to test usb drive read / write speed? or
any block device?

i'm currently using hdparm for reading speed test.

$ hdparm --offset N -t /path/to/device

for writing speed,

$ time { dd if=/dev/zero of=/file/on/device bs=1M count=100; sync; }
$ time { cp /tmp/100m.urandom /file/on/device; sync; }

the "100m.urandom" file is created before the test, since reading from
/dev/urandom is usually slower than writing to the device.
and my /tmp is mounted as tmpfs.

i wrote a script to run hdparm for multiple times on different
offsets. this is not random access but the results are satisfactory.
but i have no idea how to simulate a random writing access with data
on the drive untouched.

is there a utility that:
1. benchmarks random access,
2. can do random writing on unused spaces for major filesystems,
3. deals with the buffer properly.


"Neither the wisest constitution nor the wisest laws will secure
the liberty and happiness of a people whose manners are universally
Samuel Adams, essay in The Public Advertiser, 1749

Reply to: