HomeLinuxBenchmark Your SSD or Hard Disk Speed in Mac & Linux

Benchmark Your SSD or Hard Disk Speed in Mac & Linux

Curious about your computer’s disk speed? Follow these quick steps to benchmark your drive.


Step 1: Open Terminal from Applications > Utilities, or by searching for it in Spotlight (Command + Space).

Step 2: Type the commands below into Terminal to measure speeds:

  • Write Speed: time dd if=/dev/zero bs=1024k of=tstfile count=1024
  • Read Speed: dd if=tstfile bs=1024k of=/dev/null count=1024

Step 3: Watch the operation in Terminal and check Activity Monitor for real-time speed.

These commands write and read a 1 GB file to test the performance. The Terminal will display the time taken for the write operation, and you can observe the read/write speeds in Activity Monitor. Remember to perform this test when your Mac isn’t busy with other tasks to ensure accurate results.

ON Linux:

To benchmark the read and write speeds of your SSD or hard disk in Linux, you can use similar commands in the terminal. Here’s how:

Write Speed Test:

  1. Open Terminal.
  2. Enter the following command and press Enter:

bashCopy code

time dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc

This command writes a file of 1 GB (1024 blocks of 1 MB) to your disk, using the dd utility.

Read Speed Test:

  1. Ensure the write test is completed.
  2. Enter the following command and press Enter:

bashCopy code

dd if=tempfile of=/dev/null bs=1M count=1024

This command reads the 1 GB file back, without writing it to disk, to measure the read speed.

The terminal will display the time taken to complete these operations, from which you can calculate the speed. You can also use hdparm for read tests or ioping for more detailed latency tests. Always ensure you run these tests when the system is idle for the most accurate results.

To check the read and write speed of your SSD or hard disk on Windows, you can use a few different methods, but here’s a simple process using PowerShell:

Write Speed Test:

  1. Open PowerShell as an administrator.
  2. To test write speed, use the following command:powershellCopy code$file = "$env:temp\testfile.tmp"; $filesize = 1GB; $buffer = New-Object byte[] 10MB; $random = New-Object Random; $filestream = [IO.File]::Create($file); for($i = 0; $i -lt ($filesize / 10MB); $i++){ $random.NextBytes($buffer); $filestream.Write($buffer, 0, $buffer.Length); }; $filestream.Close()
  3. This PowerShell command creates a file of 1GB using a 10MB buffer filled with random data to write to the disk.

Read Speed Test:

  1. Make sure the write test has been completed.
  2. To test read speed, use the following command:powershellCopy code$filestream = [io.file]::OpenRead($file); while($filestream.Read($buffer, 0, $buffer.Length) -ne 0){}; $filestream.Close()
  3. This command reads the previously created file without actually outputting the data anywhere, which tests the read capability.

Note: The above commands do not inherently measure the time taken or the speed directly. To see the read/write speed, you’d typically look at the output in PowerShell or use a third-party tool designed for disk benchmarking, such as CrystalDiskMark or ATTO Disk Benchmark, which provides a user-friendly interface and detailed information about the performance of your drives.

Remember, before running any tests, make sure to close any unnecessary applications to ensure the accuracy of the test. After the tests, you can delete the testfile.tmp from your temp folder to recover the used space.

- Advertisment -

Most Popular

Recent Comments