Tuesday, December 16, 2008

Monitor dd(1) progress

When using dd(1) on command line you might want to see the speed it is being used at and its progress. This can be done by sending SIGUSR1 signal to the process, like so:

1. start dd: dd if=/dev/urandom of=/dev/zero

2. in another terminal run ps and find the dd's PID and send it SIGUSR1 signal like so:

kill -SIGUSR1 PID

which will output the results but in the first terminal where you started the dd process:

712107+0 records in
712106+0 records out
364598272 bytes (365 MB) copied, 64.4686 s, 5.7 MB/s

You can take this a bit further if the dd process is copying a large file and run it in a while loop at n intervals:


> while :
> do
> kill -SIGUSR1 13925
> sleep 5
> done

No comments: