Monitoring the progress of dd

2 min read

For a long time we were not able to properly monitor the progress of a dd command unless we were using pv of having another process to periodically send a SIGUSR1 to the dd process

On one terminal we start the dd:

$ dd if=/dev/zero of=/dev/zero 

On a new one we send the SIGUSR1 signal like this:

$ pkill -SIGUSR1 dd

Back on the first terminal, we will be able to see the stats:

$ dd if=/dev/zero of=/dev/zero 
22707933+0 records in
22707932+0 records out
11626461184 bytes (12 GB) copied, 10.8072 seconds, 1.1 GB/s

This have changed starting GNU Coreutils 8.24 with the introduction of the status=progress option to dd. If we add it, it will continuously report the status of the dd command:

# dd if=/home/jprats/Downloads/2021-05-07-raspios-buster-arm64.img of=/dev/sdb status=progress
465125888 bytes (465 MB, 444 MiB) copied, 28 s, 16,6 MB/s

Once if finishes copying all the data, it will report back the overall statistics as usual:

# dd if=/home/jprats/Downloads/2021-05-07-raspios-buster-arm64.img of=/dev/sdb status=progress
7299072+0 records in
7299072+0 records out
3737124864 bytes (3,7 GB, 3,5 GiB) copied, 679,777 s, 5,5 MB/s

Posted on 17/09/2021

Categories