Linux's block layer is somewhat daft and will happily queue up writes
for as long as you have the memory. Once enqueued, they are no longer
interruptible. In my case, this means on a 64GB host system trying to
write an 8GB image to an SD card that can write around 24MB/sec I spend
about five minutes staring at dd syncing its output. If I decide midway
through that I wanted to flash something else instead I still have to
wait for that to finish, and the progress bar was basically lying to me
about how fast things were going. Not a good look.
oflag=direct fixes this by asking for O_DIRECT which skips the above
buffering.
Linux's block layer is somewhat daft and will happily queue up writes
for as long as you have the memory. Once enqueued, they are no longer
interruptible. In my case, this means on a 64GB host system trying to
write an 8GB image to an SD card that can write around 24MB/sec I spend
about five minutes staring at dd syncing its output. If I decide midway
through that I wanted to flash something else instead I still have to
wait for that to finish, and the progress bar was basically lying to me
about how fast things were going. Not a good look.
oflag=direct fixes this by asking for O_DIRECT which skips the above
buffering.
On my system I also get a warning like:
dd: warning: partial read (8192 bytes); suggest iflag=fullblock
Which might also be worth quashing, and the docs make it sound harmless,
but I haven't tried it.
Signed-off-by: Adam Jackson ajax@redhat.com