You are not logged in.
I have noticed this on multiple occasions. When wiping a drive, but also when writing other content to it; both atop and iotop show that the disk is reading and writing the same amount of data. This feels like it is slowing down the writing I want it to do. Is there an option in dd I'm missing? Happens on multiple machines, kernels and disks. It feels like the linux-kernel is verifying what was written to the disk; but I cannot find any documentation on this
Last edited by Spider.007 (2014-07-15 07:43:21)
Offline
use bs=4M option with dd. This increases the block size to 4 "M"egabytes so reads and writes are faster. You can even use bs=8M.
I haven't tried above bs=8M so maybe you can look into that.
dd if=/dev/zero of=/dev/sdc bs=8MOffline
That definitely doesn't seem right. Here's what I see in iotop:
1846 be/4 root 0.00 B/s 104.04 M/s 0.00 % 91.64 % dd if=/dev/zero of=/dev/sdc bs=1MBut whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
Okay it does indeed seem the blocksize is to blame. Without it; I get ~ 30 MiB/s; when I add it the speed increases to ~ 200 MiB/s.
I'd never expect the impact of a missing blocksize to be this big; it seems the default isn't optimal
Offline
The default dd block size is 512 bytes, which is the traditional size of HDD sectors.
However, most of the time, Linux performs disk IO in 4kB blocks. When you submit a sequence of 512 byte write requests, it reads a 4kB block, modifies it part-by-part in 512 byte chunks, writes it back, reads another 4kB block and so on.
Setting bs to at least 4kB should eliminate the reads. Increasing it to few MB may improve performance slightly further by reducing the number of individual write requests and hence the time spent by the kernel on "understanding" them.
Last edited by mich41 (2014-07-15 09:31:43)
Offline
...and best answer goes to mich41!
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline