home | list info | list archive | date index | thread index

Re: Getting correct timing for transfer to USB -- timings

http://web.ncf.ca/nashjc/USBtimes/usbtimeJN.xls

gives some timings I ran yesterday to see if the $8 Blackweb 32G USB3 flash
drive at Walmart this week is genuine or flakey. From the timings seems not
too bad. The variations over machines and connectors is a bit of an education.
Also my oldest laptop had the best USB2 time on one device.

I believe I used sync correctly to avoid timing just memory transfers. I won't
claim that my effort was perfect. Script below is what I used.


Best, JN

#!/bin/bash
# usbtimer.sh
## run as root so buffers can be cleared
## ?? how to check $1
if [ -d /media/john/$1/temp/ ]; then
   echo "We have directory /media/john/$1/temp/ available"
else
   echo "/media/john/$1/temp/ NOT found";
   exit
fi
## make sure file to use is at /media/john/$1/temp/tmp.iso
if [ -f /media/john/$1/temp/tmp.iso ]; then
   echo "File tmp.iso available"
else
   echo "tmp.iso not found";
   exit
fi
echo "clear buffers"
if [ -f /home/john/temp/tmp.iso ]; then
   echo "File tmp.iso exists -- delete it"
   rm /home/john/temp/tmp.iso
fi
sync
echo "Read from USB" >>t$1.txt
date >>t$1.txt
cp /media/john/$1/temp/tmp.iso /home/john/temp/
sync
date >>t$1.txt
echo "Write to USB" >>t$1.txt
echo "clear buffers first"
sync
date >>t$1.txt
cp /home/john/temp/tmp.iso /media/john/$1/ttt.iso
sync
# Make sure we count the flush time.
date >>t$1.txt
echo "Clear the working files"
rm /home/john/temp/tmp.iso
rm /media/john/$1/ttt.iso

To unsubscribe send a blank message to linux+unsubscribe [ at ] linux-ottawa [ dot ] org
To get help send a blank message to linux+help [ at ] linux-ottawa [ dot ] org
To visit the archives: https://lists.linux-ottawa.org