The following is a simple benchmarking method for disks in Linux. These are basic commands for testing disk read/write performance.
Write test
dd if=/dev/zero of=benchmark bs=64K count=32K conv=fdatasync
This command reads data from /dev/zero (a special file that outputs infinite zeros) and writes it to a file called ‘benchmark’. The write block size (bs) is 64K and the number of blocks (count) is 32K. Synchronization (fdatasync) is performed after all data has been written to disk.
Read test
dd if=benchmark of=/dev/null
Reads the ‘benchmark’ file created in the write test and outputs its contents to /dev/null (a special file that displays nothing). This allows you to measure the read performance of the disk.