How to Test Speed of Raspberry Pi SD Card


The SD is the backbone of your Raspberry Pi device because, without it, you won’t be able to use an operating system on your device. The reason is that most operating systems don’t support USB boot on your Raspberry Pi device. Thus, having a good-speed SD card is necessary for the users to enjoy a smooth desktop environment. If you somehow purchase an SD card for your Raspberry Pi device and you don’t have information about whether the card is good enough for a smooth desktop experience, you should need to perform an SD card test.

This article provides a way to determine your Raspberry Pi card speed, as this will help you continue with the current SD card or purchase a new one for your device.

Raspberry Pi SD Card Speed Test

There are two simple methods through which you can perform a speed test for your Raspberry Pi SD card:

  1. SD Card Speed Test Using Agnostics
  2. SD Card Speed Test Using the dd Command

The details of both these methods are discussed as below.

1: SD Card Speed Test Using Agnostics

One of the simplest ways to perform SD card speed test is using the Agnostics tool, which is pre-installed on your Raspberry Pi device. However, if you don’t have then you can install it anytime using the following command:

$ sudo apt install agnostics -y

To open this tool, head to the Raspberry Pi menu, and in the “Accessories” option, click on the “Raspberry Pi Diagnostics”.

This will open up the following screen on your Raspberry Pi desktop, where you will be able to run a SD card speed test merienda you click on the “Run Tests” button.

If you find the output result as PASS, it means that your SD card is fast enough to provide you with a smooth desktop experience and if it outputs the result as FAIL, then you should need to replace your SD card as soon as possible.

2: SD Card Speed Test Using the dd Command

You can also find detailed information about your SD card speed test using the dd command, which provides information related to your SD card write and read speed performance.

To find out the SD card write speed performance, we are creating 100MB of free storage space and five blocks of 20MB each. You can change this preference according to your choice as greater storage space provides better results but requires more time. With this information, you can apply the following command in your Raspberry Pi terminal to find out the write speed performance of your SD card:

$ dd if=/dev/zero of=./speedTestFile bs=20M count=5 oflag=direct

From the above command, “if” and “of” are used for reading and writing from a source file to destination file respectively. While the “/dev/zero” is a built-in special Linux file that is used to fill the memory of any kind where all bits are set to zero. This file is mostly utilized in the reading and writing process. The result in the last row shows the time spent and promedio speed of the writing operation on your SD card.

To find out the read speed information of your SD card, issue the following command in the terminal:

$ dd if=./speedTestFile of=/dev/zero bs=20M count=5 oflag=dsync

From the above command, we are reading the data from the previously generated source file, so in that case, we use the “if” command to read from the source file and uses the oflag as dysnc instead of direct. While the output in the last row shows the time spent and promedio speed of the reading operation on your SD card, which should always be greater than the write speed.

Conclusion

Raspberry Pi SD card speed test is an important test that every user must perform to keep a check on the card performance. The easiest way to perform an SD card speed test is to use the Raspberry Pi Diagnostics from the Raspberry Pi menu, where you will be able to find out whether your SD card can provide you with adequate performance or not. You can also find out the write and read speed of your SD card using the dd command, which is crucial if you have proper knowledge of SD card reading and writing speed.



Source link