I write ISO files to USB thumb drives a lot, and I'm trying to find a way to monitor the status of a write. Googling this, I have found a bunch of solutions, including pv
, dcfldd
and the USR1 signal to the dd
command.
In all cases, this seems to be the case:
- The file is written to the thumb drive at ca 100 MB/s
- The transfer finishes (or possibly freezes at 99.99%) in less than 10 seconds
- The transfer command remains unresponsive for several minutes, not even responding to interrupts
- The transfer finishes
The behavior I expect would be a relatively slow write, perhaps around 5 MB/s, and a progress bar that progresses evenly from 0% to 100%. It seems to be that the file is written quickly into a buffer of some kind, then slowly flushed to disk afterwards.
Here are some commands I have tried, all with basically the same outcome:
# function vdd { > sudo dd "$@" & > sudo sh -c "while pkill -10 ^dd$; do sleep 5; done" > } # vdd bs=4096 if="/path/to/ubuntu-15.04-desktop-amd64.iso" of=/dev/sdb
dcfldd bs=4096 if="/path/to/ubuntu-15.04-desktop-amd64.iso" of=/dev/sdb
pv "/path/to/ubuntu-15.04-desktop-amd64.iso" | dd bs=4096 of=/dev/sdb
pv -B 4096 "/path/to/ubuntu-15.04-desktop-amd64.iso" > /dev/sdb
I have searched the man pages for dd
, pv
and dcfldd
for the word "flush" with no results...