Command line

Copying a 1 GiB File: dd at bs=512 Is 9x Slower — and cp Ties dd Once the Block Size Is Right

Eight ways to copy the same 1 GiB file, three reps each, two runs tonight. dd with the default 512-byte block takes 3.6 seconds. The same dd at bs=1M takes 0.4. And plain cp — no flags, no tuning — ties the tuned dd exactly. The decision is the block size, not the tool.

Written November 9, 2026 · 16 min read

By the end of this guide
  • The table: one file, eight arms, two runs
  • The plateau: above 64K the block size stops mattering
  • No tool winner: cp and cat tie tuned dd
  • The slow reps are system state, not a tool property

What this guide is

One 1 GiB file of random bytes. Eight ways to copy it: plain cp, plain cat redirected into a file, and dd at six block sizes from 512 bytes to 16 MiB, plus one dd run with conv=fdatasync. Every rep was checked with cmp: all 48 reps returned code 0 with identical bytes.

The question is the one people actually type at a prompt. Not which syscall copies fastest — that is the sibling guide — but which command, and with what flags. The answer splits in two directions, and both halves matter: the block size costs 9x when it is wrong, and once it is right there is no tool winner at all.

The two tools, briefly

dd copies a file in fixed-size blocks. The block size is the bs operand, and the manual page states the default plainly: bs=BYTES, read and write up to that many bytes at a time, default 512. The input and output block sizes default to 512 as well (ibs and obs). So a bare dd if=src of=dst with no bs reads and writes 512 bytes per call, 2,097,152 reads and the same number of writes for a 1 GiB file. That count is arithmetic from the block size, not a traced measurement: there is no strace, and the probe did not count calls. At bs=1M the same file takes 1,024 reads and 1,024 writes.

cp copies a file with no block size to set. The manual page documents --reflink for copy-on-write clones and a sparse-file heuristic, but nothing about a buffer size, because cp does not copy through a userspace buffer at all. Running cp --debug reports copy offload: yes, reflink: unsupported, sparse detection: no — the copy went through the kernel copy offload, the same copy_file_range mechanism the sibling guide measures at the syscall level. That is why cp keeps up with tuned dd: it is not racing with a 128 KiB buffer, it is asking the kernel to do the copy.

cat is the control arm. cat src > dst is a plain read/write loop in userspace, no tuning, no offload. If the kernel-side methods were the whole story, cat should lose. It does not.

The table: one file, eight arms, two runs

Wall seconds for a 1 GiB copy, medians of three reps, fresh tonight. Both runs are printed because the fast arms are bimodal and one run alone would lie about them.

  • cp src dst: run 1 median 0.376, run 2 median 0.382. Reps run 1: 0.816, 0.376, 0.367. Reps run 2: 0.857, 0.375, 0.382.
  • cat src > dst: run 1 median 0.383, run 2 median 0.376. Reps run 1: 0.826, 0.383, 0.372. Reps run 2: 0.376, 0.832, 0.374.
  • dd bs=512: run 1 median 3.582, run 2 median 3.774. Reps run 1: 3.664, 3.494, 3.582. Reps run 2: 3.639, 3.774, 3.808.
  • dd bs=4K: run 1 median 0.821, run 2 median 0.947. Reps run 1: 0.821, 0.931, 0.758. Reps run 2: 0.947, 1.050, 0.749.
  • dd bs=64K: run 1 median 0.413, run 2 median 0.406. Reps run 1: 0.735, 0.411, 0.413. Reps run 2: 0.406, 0.409, 0.406.
  • dd bs=1M: run 1 median 0.405, run 2 median 0.389. Reps run 1: 0.392, 0.405, 0.826. Reps run 2: 0.389, 0.392, 0.385.
  • dd bs=16M: run 1 median 0.439, run 2 median 0.435. Reps run 1: 0.439, 0.439, 0.433. Reps run 2: 1.016, 0.435, 0.420.
  • dd bs=1M conv=fdatasync: run 1 median 0.397, run 2 median 0.391. Reps run 1: 0.389, 0.397, 0.848. Reps run 2: 0.389, 0.719, 0.391.

Throughput at the medians: dd bs=1M moves about 2,530 to 2,630 MiB per second; dd bs=512 about 271 to 286. The night before, the same probe gave cp 0.969 and 0.385, cat 0.378 and 0.661, dd bs=512 3.528 and 3.419, dd bs=4K 0.931 and 0.784, dd bs=64K 0.415 and 0.408, dd bs=1M 0.389 and 0.388, dd bs=16M 0.560 and 0.428, fdatasync 0.388 and 0.392. Every direction held across all four runs. The absolute numbers moved by a few percent; the ranking did not move at all.

The trap: bs=512 costs 9x

Trap
dd bs=512 takes 3.582 and 3.774 seconds against 0.405 and 0.389 for bs=1M: 8.8 times slower in run 1, 9.7 times in run 2. The night before it was 9.1 and 8.8. Across four runs the factor sits between 8.8 and 9.7, so the guide calls it about 9 times slower.

The slow arm is also the stable one. Its six reps tonight span 3.494 to 3.808 seconds, a tight band with no overlap against any fast arm. That matters because the fast arms are noisy in the other direction: a single slow rep near 0.8 seconds shows up somewhere in almost every arm, and the 512-byte arm never gets a fast rep to balance it. The trap is not a bad day. It is the default.

The default is the trap. dd with no bs operand uses 512, the value the manual page has carried since the command was written for tape blocks. Nobody copying a file in 2026 wants 512-byte blocks, but that is what a bare dd if=src of=dst does, and it costs 9x against the same command with bs=1M appended. If the guide teaches one command, it is this one:

Command
dd if=src of=dst bs=1M status=progress

The plateau: above 64K the block size stops mattering

dd bs=64K medians are 0.413 and 0.406. bs=1M is 0.405 and 0.389. bs=16M is 0.439 and 0.435. The three sit inside a 0.39 to 0.44 second band, within run-to-run noise of each other. The night before gave the same picture: 0.415 and 0.408, 0.389 and 0.388, 0.560 and 0.428.

bs=4K is the middle step: 0.821 and 0.947 tonight, 0.931 and 0.784 the night before, about 2.0 to 2.4 times slower than bs=1M in all four runs. So the ladder has three rungs, not six: 512 bytes is 9x, 4 KiB is about 2x, and everything from 64 KiB up is the same speed. There is no reason to tune past 1M, and no penalty for stopping at 64K. The guides that recommend 1M to 4M as the sweet spot are right about the range and wrong if they imply a sharp peak inside it: the curve is flat from 64K to 16M.

No tool winner: cp and cat tie tuned dd

cp medians tonight are 0.376 and 0.382 against dd bs=1M at 0.405 and 0.389. cat is 0.383 and 0.376. All three sit in the same 0.37 to 0.41 second band, and the ordering flips between runs: cp is fastest in run 1, cat in run 2, dd bs=1M never leads. The night before, cp medians were 0.969 and 0.385 and cat 0.378 and 0.661: the same bimodality, the same band, the same conclusion once both runs are read together.

That corrects the reading the night-before numbers invite on their own. Read run 1 alone, cp at 0.969 looks 2.5 times slower than dd bs=1M at 0.389. Read run 2, cp at 0.385 ties it. Read tonight, cp beats it twice. The honest statement across all four runs is that there is no tool winner: cp, cat, and tuned dd copy a 1 GiB file in the same time, and the choice between them is about what else the tool does — metadata, progress reporting, sparse handling — not speed.

The cat result is the same mechanism story the sibling guide found at the syscall level. There, splice made the same number of syscalls as the read/write loop and still matched sendfile speed: the win was the avoided userspace copies, not fewer syscalls. Here, cat is a plain read/write loop and it ties the kernel-offload cp and the tuned dd. At this size, on warm cache, the bottleneck is not the syscall shape. Do not claim dd beats cp, and do not claim cp beats dd: four runs say neither.

The slow reps are system state, not a tool property

Almost every fast arm has one slow rep near 0.8 seconds somewhere in the four runs, and it lands on a different arm each time. Tonight run 1: cp rep 1 at 0.816, cat rep 1 at 0.826, dd bs=64K rep 1 at 0.735, dd bs=1M rep 3 at 0.826, fdatasync rep 3 at 0.848. Tonight run 2: cp rep 1 at 0.857, cat rep 2 at 0.832, dd bs=16M rep 1 at 1.016, fdatasync rep 2 at 0.719. The night before shows the same scatter.

A slow rep is not a property of the arm it landed on. It is WSL2 scheduling or page-cache state, and it moves. That is why this guide prints every rep and reports medians: a median of three is immune to one slow rep, and a single timed run is not. Anyone reproducing this probe with one rep per arm will get a ranking decided by which arm drew the slow rep, and that ranking will not survive a second run.

conv=fdatasync costs nothing here — and that is a tmpfs artifact

dd bs=1M conv=fdatasync medians are 0.397 and 0.391 against 0.405 and 0.389 for plain bs=1M. Identical, in both runs and the night before (0.388 and 0.392 against 0.389 and 0.388). The manual page says fdatasync physically writes the output file data before finishing. On tmpfs there is nothing to flush: the filesystem lives in RAM, so the sync is a no-op and the numbers prove it.

Do not read this as "fdatasync is free". On a real disk the sync cost is the whole point of the flag: it is the difference between the data sitting in the page cache and the data being on the platter, and it is unmeasured here. The honest statement is narrow: on tmpfs, conv=fdatasync adds no measurable time. If you copy to a USB stick or a spinning disk, expect the flag to cost real seconds, and measure it there before trusting this table.

Why cp keeps up

The sibling guide measured the syscall table: copy_file_range copies a 1 GiB file in about 365 ms, sendfile in about 467, splice in about 390, the read/write loop in about 854, all medians. cp at 376 to 382 ms tonight sits in the kernel-method band, not the loop band, because cp --debug says so: copy offload yes. Modern GNU cp asks the kernel to do the copy where the filesystem supports it, which is the CLI-level echo of that syscall table, not a re-teach of it.

That also explains why the cat result does not contradict the sibling guide. cat ties cp here at 1 GiB on warm tmpfs cache, while the loop arm in the sibling guide was about twice as slow as the kernel methods at the same size. The two probes use different harnesses — this one times whole shell commands, the sibling one a C driver around the syscalls — so the absolute seconds are not directly comparable across guides. The ranking that survives both probes is the one this guide states: tuned dd, cp, and cat are the same speed for a plain file copy, and the block size is the only decision that moves the number by more than noise.

What the numbers do not say

  • tmpfs only. The source and destination both live on /dev/shm, a RAM filesystem. Cold-disk behavior, spinning rust, USB sticks, and NVMe are unmeasured, and the fdatasync result in particular does not travel to disk.
  • Warm cache only. The source file is generated once per run and read repeatedly; the page cache is warm for every timed rep except the first reads, which show up as the slow reps. A cold read of a file that is not in cache will be slower in absolute terms.
  • One file, 1 GiB, sequential, one thread. Small files, many files, sparse files, and parallel copies are different questions. Below roughly 64 MiB the sibling guide found all copy methods tie, so this table's 9x trap is a large-file finding.
  • No metadata timing. cp -a, which preserves permissions, ownership, and timestamps, was not timed. cp without flags copies the data; the metadata work is extra and unmeasured.
  • No rsync arm. The sibling rsync guide measures delta against whole-file transfer on the same harness; this guide is the commands people type for a local copy.
  • The nearest published table is asserted, not measured. A copyprogramming guide puts cp at about 2 seconds and optimized dd at about 1.5 seconds for a 1 GB file, with no method, no repetitions, and no filesystem stated, and its C-buffer numbers (512 bytes in 22 seconds) are a different mechanism — stdio buffering, not dd syscalls — so they do not contradict the 3.6 seconds measured here. The table this guide adds is the measured one: eight arms, three reps, two runs, every rep printed.

Checklist

  • Before copying a file with dd, check the block size: a bare dd uses 512-byte blocks and costs about 9x against bs=1M, and the default is the trap.
  • Before tuning past 1M, check the plateau: 64K, 1M, and 16M sit in the same 0.39 to 0.44 second band, so stop at 1M and spend the effort elsewhere.
  • Before choosing between dd, cp, and cat on speed, check the table: all three tie at about 0.38 to 0.41 seconds once the block size is right, so choose on what else the tool does.
  • Before trusting a single timed run, check the reps: a slow rep near 0.8 seconds lands on a different arm each run, and one rep per arm gives a ranking decided by luck.
  • Before adding conv=fdatasync on disk, check the filesystem: it costs nothing on tmpfs because there is nothing to flush, and that result does not travel to a real disk.
  • Before citing the nearest published table, check its method: the copyprogramming comparison gives cp at about 2 seconds and optimized dd at about 1.5 with no repetitions and no filesystem stated, and its 512-byte figure is stdio buffering, not dd.
  • Before reusing these numbers, check the setup: WSL2, 32 CPUs, coreutils 9.4, tmpfs, warm cache, one 1 GiB sequential file, one thread per arm — the ranking held across four runs, the absolute seconds are this box's.

Sources

  • Linux man-pages project, dd(1) — read on the box 2026-11-09: bs=BYTES reads and writes up to that many bytes at a time, default 512; ibs and obs also default to 512; conv=fdatasync physically writes the output file data before finishing; suffixes K=1024, M=1024*1024.
  • Linux man-pages project, cp(1) — read on the box 2026-11-09: cp copies files and directories; --reflink controls clone and copy-on-write copies, falling back to a standard copy when unsupported; --sparse=auto is the default, detecting holes by a crude heuristic; --debug explains how a file is copied.
  • GNU Coreutils manual, cp invocation — read 2026-11-09: cp copies files or directories; by default sparse sources are detected by a crude heuristic and the destination is made sparse as well; --reflink=auto falls back to a standard copy when copy-on-write is unsupported.
  • copyprogramming, The Most Efficient Way to Copy Files in Linux — read in full 2026-11-09: the nearest published table, asserted rather than measured — cp at about 2 seconds and optimized dd (512 MB block) at about 1.5 seconds for a 1 GB file, with no method, repetitions, or filesystem stated; a 512-byte C buffer at 22 seconds is stdio buffering, a different mechanism from dd syscalls.
  • copyprogramming, How to Determine the Best Byte Size for dd Command — read 2026-11-09: the nearest dd block-size advice — larger blocks reduce syscall overhead, tests peak at 128K to 1M on most drives, 1M often optimal — with no cp comparison and no measured table with repetitions.
  • Veldica, sendfile vs copy_file_range vs splice, Measured — the sibling guide: the syscall-level copy table on the same box and harness, copy_file_range about 365 ms at 1 GiB against the read/write loop at about 854 ms; this guide is the commands people type, that guide is the syscalls underneath them.
  • Veldica, Are These Two Files the Same? cmp vs diff, Measured — the follow-up guide: the equality check on the same box, plain diff costs about 100 times more than diff -q on text when the difference is on line 1, and nothing extra on binary.
  • Veldica, mv Across Filesystems, Measured: One Rename or a Full Copy — the follow-up guide: the move table on the same box, 0.002 seconds on one filesystem against about 1 second across filesystems for the same 1 GiB file and the same 10,000-file tree; mv preserves the modification time across filesystems, plain cp does not.
  • Veldica, rsync Delta vs Whole File: Wall Clock, Measured — the sibling guide: delta against whole-file transfer on the same warm-cache, tmpfs harness, a different copy question from which command copies a local file.

Keep Exploring