According to the manual for dd
, there are two options that can cause I/O to bypass the filesystem cache: direct
and nocache
. When using these flags to, for example, copy files or copy raw data to/from block devices, what are the differences between these two flags?
Let's say I want to copy one file from A to B using just dd
(no real reason, just an experiment), in a way that dd
will...
- ...read one full block from the input file, without putting it in the read cache, and then...
- ...write that data to the destination as soon as a full block is read, without putting it in the write cache.
What do these flags do differently for this example scenario? What would be the proper invocation of dd
for this task?