1

I am copying this .img file to my USB flash drive using dd command. How can I check its progress ?

1
  • The "this question already has answers here" is a different question, and the answers are different to the answers here. Commented Jun 5, 2024 at 6:39

3 Answers 3

4

If you write to a slow drive, for example a USB drive, you may want to know not only the progress of the command dd itself, but also the progress of actual writing to the target device.

You can modify the dd command line to make it flush the buffers regularly, for example after writing each mibibyte, and at the same time show the progress, for example

  sudo dd if=file.img bs=1M of=/dev/sdx status=progress oflag=dsync

Please check and double-check, that you specify the correct target device. Otherwise you might overwrite valuable data. dd does what you tell it to do without any questions.


Edit: You can find several other methods in my answer as well as other answers at this link.

2

dd by default uses 512 bytes blocks to copy data which could result in slow data transfers and increased CPU usage. I often prefer to use cat or pv instead, e.g.

pv -petrab img-file > /dev/sdc1
1
  • 1
    On really slow disks like this one ancient USB stick I use for installing systems (because it's not useful for anything else!) the buffer might end up absorbing the entire write. I use the -Y option to cause pv to call fdatasync() after each write: -petrabY. This gives me a much more accurate speed reading without making me wonder how long it takes to sync the disk as pv exits. Commented Jun 17, 2024 at 5:40
2

The easiest way to do this is by using progress in the status flag, it will display the seconds elapsed and speed of copying on your terminal.

sudo dd if=img-file of=/dev/sdc1 status=progress

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.