Before we begin we first need to mount our USB flash drive. In our example USB flash drive will be mounted into /media/usb0 directory or keep the path relative.
USB flash drive WRITE speed test
Create a file called test.sh with the following content. Change the path to your mounted USB flash drive if necessary:
- dd command will create a new file of predefined size
- sync command will ensure that none of the data remain in RAM and thus are written onto USB filesystem
Execute test.sh file as folllows:
1 2 3 4 5 6 7 8
From here we can see that 3145728000 bytes took 3m36.677s to write.
USB flash drive READ speed test
Before you do any read test make sure that you clean your RAM otherwise chances are that you will read all or some of the data directly from RAM. To clean your RAM execute as root user:
Once done start read speed test by:
The time command will output time it took to read your data from your mounted USB drive.