Disk imager benchmarks

I was researching the block size settings for the disk imager to use in Klennet Recovery, and benchmarking seemed the best way to do it. Klennet Recovery uses a three-pass imager. The first pass uses the "large" block size, the second pass uses the "small" block size to localize bad blocks inside large blocks, and finally, the third pass is down to individual sectors. The time required to create an image mostly depends on the large block size (first pass).

There are three significant factors in play:

  1. Read speed on good blocks.
  2. The time spent handling bad blocks.
  3. Target write speed.

First, I got rid of the target write speed limit by disabling writes in my code because I wanted to measure read speed independent of the target device. Then, I picked up whatever drives I had around and measured the times with different first-pass block sizes.

The data

Here are the results, ordered approximately by read speed, from slow to fast.

Time to create the disk image, in minutes
Device Block size
128 K 256 K 512 K 1 M 2 M
JetFlash TS1GJFV20
1 GB USB2 thumbdrive
2 2 2 2 2
Seagate ST9320325AS
320 GB 2.5" SATA HDD
394 bad sectors
107 106 108 106 107
WD WD60EFRX-68L0BN1
6 TB 3.5" SATA HDD
750 749 750 749 749
WD Blue SA510
500 GB SATA SSD
34 26 22 20 19
Samsung 870 EVO
2 TB SATA SSD
346 bad sectors
86 74 68 65 62
SPCC M.2 PCIe SSD
2 TB NVMe SSD
63 55 36 25 18

The amount of time required to create a disk image, depending on the large block size.
The small block size is 64 KB for all tests.

The commentary

There are only two samples with bad sectors, and the number of bad sectors is low in both cases.

Then, going above 256 KB block size does not produce a practical improvement, with possibly one exception.

  • For large SATA HDDs, the speed does not improve at all.
  • For SATA SSDs, you get most of the improvement by going from 128 KB to 256 KB, and the absolute numbers are not that big anyway.
  • The NVMe SSD imaging time decreases significantly as the block size increases, from 55 to 18 minutes. Remember, however, that 2 TB in an hour translates to about 500 MB/sec. To take advantage of larger block sizes, your target device must be capable of sustaining higher than 500 MB/sec write speed.

The conclusion

Initially, I was researching this to determine if I wanted different block size presets for different device sizes. After looking at the data, I decided that a 256 KB block size is a good fit for all cases. By increasing the block size, you can save maybe half an hour if you are imaging an NVMe drive onto another NVMe drive; cases with many bad blocks may need settings adjusted on a case-by-case basis. In all other cases, keep the default values.

Filed under: Benchmarks, Disk imaging.

Created Friday, February 3, 2023