How to Benchmark Hard Disks in Linux

29/12/2020
Chưa phân loại
Monitoring read and write speeds of storage devices is a good way to determine genuine products and determine disk health overtime. This article will list various tools available for Linux that can be used to benchmark hard disks and monitor real time disk activity data.

GNOME Disks

GNOME Disks is an internal and external disk management tool for Linux. Based on udisks, it can be used to modify, format, and partition drives as well as to perform benchmarks on any storage media connected to the system.

GNOME Disks comes pre-installed on most distribution having a GNOME based desktop environment. In case if it missing on your Ubuntu system, you can install it by running the command below:

$ sudo apt install gnome-disks

To perform a hard disk benchmark using GNOME Disks, launch “Disks” app from application launcher.

Click on three dot menu and then click on “Benchmark Disk…” option.

Click on “Start Benchmark…” button on the next window.

Change the options as required. Note that the benchmark utility won’t allow you to do write benchmarks on mounted disks. So in order to perform a full read-write benchmark on built-in disk, you have to launch GNOME Disks in a live USB mode and unmount the built-in storage drive. Click on “Start Benchmarking…” button to start the benchmarking process.

The benchmarking process will take some to finish depending on the number of samples you have chosen. Once the process has finished, you will be able to see read / write speed results.

You need to compare these results with the vendor advertised read / write values to gauge the efficiency.

Hdparm

Hdparm is a simple command line app for Linux that allows you to manage storage devices by setting and removing parameters. It also includes an option to test read speeds of storage devices.

To install hdparm in Ubuntu, run the command below:

$ sudo apt install hdparm

To run a hard disk benchmark using Hdparm, use the command below:

$ sudo hdparm -tT /dev/sda

Replace “/dev/sda” part with the address of your hard drive. You can check the path using the GNOME Disks app mentioned above or by running the command below:

$ lsblk -o NAME,PATH,MODEL,VENDOR,SIZE,FSUSED,FSUSE%,TYPE,MOUNTPOINT

Once the benchmark has finished running, you will see test results as terminal output.

DD

Data Duplicator or simply ‘dd’ is a command line utility for Linux that allows you to copy and convert files and data. It is capable of copying large chunks of data, cloning entire hard disks, creating bootable USB drives and so on.

It is possible to check hard disk write speed using dd. Run the commands below in order to perform a write speed benchmark.

$ mkdir benchmark
$ cd benchmark
$ dd if=/dev/zero of=benchfile bs=4k count=200000 && sync; rm benchfile

Wait for the test to finish, results will be shown in terminal once done.

To perform a read test using dd, run the command below:

$ dd if=/dev/zero of=/dev/null && sync

This command will continue to run until stopped, so press <CTRL + C> after a few seconds to see the results.

Sysbench

Sysbench is a multi purpose benchmark utility for Linux. Some of the benchmark options provided by Sysbench include a CPU stress test, memory access speed test, and filesystem input output performance test.

To install sysbench in Ubuntu, run the command below:

$ sudo apt install sysbench

To perform a hard disk benchmark using sysbench, run the commands below one by one:

$ mkdir benchmark
$ cd benchmark
$ sysbench fileio prepare
$ sysbench fileio –file-test-mode=rndrw run

Wait for the test to finish. Once done, you will see the results as terminal output.

To remove the test files from benchmark directory, run the command below:

$ rm test_file.*

You can use “Throughput” statistics as the performance indicator.

Sysstat

Sysstat is a command line performance monitoring app for Linux. It can monitor input output operations, memory consumption, resource usage by running system processes, network activity etc. and show real time statistics about them.

To install Sysstat in Ubuntu, run the command below:

$ sudo apt install sysstat

To monitor performance of hard disk, you can use “iostat” command included in Sysstat. Though it doesn’t include an option to perform benchmark, it can show real time data about disk read and write activity.

To see disk read and write speeds every second, run the command below:

$ iostat –human 1

Iotop

Iotop is a “top” tool for monitoring disk reads and writes. It shows data in a tabular form, similar to what top or htop does for displaying resource consumption. It works similar to iostat utility mentioned above and it is not exactly a benchmark tool. However, it can display real time disk activity statistics, making it suitable for monitoring large data operations.

To install Iotop in Ubuntu, run the command below:

$ sudo apt install iotop

Run the command below, to launch iotop:

$ iotop

Conclusion

These are some of the methods that can be used to benchmark hard disks and determine their read and write speeds. There is no denying that some counterfeit and falsely advertised products are available today in market, especially flash storage products. The only way to determine their efficiency is to benchmark them and compare the results with advertised speeds.

ONET IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, ONET IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

[CentOS8] Hướng dẫn cài đặt MariaDB trên CentOS 8

MariaDB là một nhánh của cộng đồng phát triển cơ sở dữ liệu quan hệ MySQL.Trong loạt bài viết...
30/12/2020

Hướng dẫn tích hợp tính năng Etherpad trên Jitsi

Hôm nay, Cloud 365 sẽ hướng dẫn các bạn tích hợp công cụ Etherpad để sử dụng trong phòng họp...
30/12/2020

Bash conditional statement

The conditional statement is used in any programming language to do any decision-making tasks. This statement is also used...
29/12/2020
Bài Viết

Bài Viết Mới Cập Nhật

Reliable IPv4 and IPv6 Subnet Rental Services: The Perfect Solution for Global Businesses
23/12/2024

Tìm Hiểu Về Thuê Proxy US – Lợi Ích và Cách Sử Dụng Hiệu Quả
11/12/2024

Mua Proxy V6 Nuôi Facebook Spam Hiệu Quả Tại Onetcomvn
03/06/2024

Hướng dẫn cách sử dụng ProxyDroid để duyệt web ẩn danh
03/06/2024

Mua proxy Onet uy tín tại Onet.com.vn
03/06/2024