Posted On August 24, 2021

Linux: Testing Disk Speed

kimconnect 0 comments
blog.KimConnect.com >> Linux >> Linux: Testing Disk Speed

Below is an exercise in comparing 2 different media: external USB drive vs a SD card

# Perform the WRITE test on USB Disk
outputFile=/media/data/test.img
blocksize=1G
numberOfBlocks=1
dd if=/dev/zero of=$outputFile bs=$blocksize count=$numberOfBlocks oflag=dsync
rm $outputFile

# Perform the WRITE test on SD Card
outputFile=/media/kim/2849-2EAD/test.img
blocksize=1G
numberOfBlocks=1
dd if=/dev/zero of=$outputFile bs=$blocksize count=$numberOfBlocks oflag=dsync
rm $outputFile

# Read test must be performed subsequent to clearing the data being stored in RAM by switching the disk1 vs disk2 test files...

# Perform READ test on USB Disk
outputFile=/media/data/test.img
blocksize=1G
numberOfBlocks=1
echo 3 | sudo tee /proc/sys/vm/drop_caches
dd if=$outputFile of=/dev/null bs=$blocksize count=$numberOfBlocks

# Perform the READ test on SD Card
outputFile=/media/kim/2849-2EAD/test.img
blocksize=1G
numberOfBlocks=1
echo 3 | sudo tee /proc/sys/vm/drop_caches
dd if=$outputFile of=/dev/null bs=$blocksize count=$numberOfBlocks

Results:

# USB External Drive Write Speed
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 30.8095 s, 34.9 MB/s

# USB External Drive Read Speed
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 26.5893 s, 40.4 MB/s

# SD Card Write Speed
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 167.147 s, 6.4 MB/s

# SD Card Read Speed
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 68.2176 s, 15.7 MB/s

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

How to Install & Configure Pihole on Ubuntu 20.04

1. Installation- Run these commands: # sudo apt-get install gamin -ysudo curl -sSL https://raw.githubusercontent.com/pi-hole/pi-hole/master/automated%20install/basic-install.sh |…

Linux: An Experience in Resizing a Root Partition

Scope: These instructions are intended for Linux systems without Logical Volume Manager (LVM). For that…

Linux: How to Set Startup Script

In previous Linux versions, startup scripts can simply be enabled by linking a script into…