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

test usb drive read / write speed



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.


Cheers,

Tao
--
School of Mathematical Sciences
Peking University

http://huangtao.me/
http://www.google.com/profiles/UniIsland


Reply to: