A
A
Asparagales2019-01-05 10:28:45
linux
Asparagales, 2019-01-05 10:28:45

What is the optimal block size for writing with dd?

The dd program has a bs option. First, I can't understand why it is believed that the smaller its value, the slower the copy speed will be. Explaining that this option means the block size in bytes that will be read and written at a time does not explain anything to me.
Secondly, how to find out the optimal block size for different cases? In particular, I want to clear the flash drive by writing zeros, and then re-format it. What is the best block size to use? The default should be 512 bytes.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sanes, 2019-01-05
@Sanes

Depends on the file system. Block size. Usually 4096 bytes. If you format later, it doesn't matter.

L
Lynn "Coffee Man", 2019-01-05
@Lynn

https://askubuntu.com/a/931588/910710
4k optimal size. 512 is a relic of antiquity, 5-inch hard drives and, in general, almost floppy disks https://en.wikipedia.org/wiki/Disk_sector

S
Saboteur, 2019-01-05
@saboteur_kiev

the block/cluster size of modern file systems is 4 KB.
The sector size of modern drives is 4 KB.
Therefore, theoretically, the maximum convenient block size is 4 kb.
But let's not forget about the controller cache, about sata queues and the operating system cache - if you just copy linearly - the larger the block, the faster.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question