On Sun, Sep 08, 2024 at 10:59:58AM -0700, David Christensen wrote:
2. Using dd(1) with sync(1):
3. Using dd(1) without explicit synchronization:
These two tests are identical, as dd has exited (and all the performance
information has been printed) before sync runs. The flag you want[1] is
conv=fsync which runs sync before exiting, thus making the stats reflect
the time taken to flush to disk.
Mike Stone
[1] insofar as you want to use dd at all; as I've said before, it's
almost never the best tool for the task unless you're trying to reblock
data from a mainframe 3490 tape to a unix 9 track or somesuch. I haven't
needed to do that in almost 25 years. In general cp will provide the
best possible performance using familiar parameters and without the need
to try to understand how to apply flags based on a 1960s-era mainframe
directive to a modern unix system. I suppose if you enjoy impressing
people with obscure command syntax (and if you know people who can be
impressed by same) dd is its own reward.