In computing, dd is a common program for Unix and Unix-like operating systems whose primary purpose is to “convert and copy a file.” On Unix, device drivers for hardware (such as hard disks) and special device files (such as /dev/zero and /dev/random) appear in the file system just like normal files; dd can also read from (and in some cases write to) these files. As a result, dd can be used for tasks such as backing up the boot sector of a hard drive, and obtaining fixed amount of random data. The dd program can also perform conversions on the data as it is copied, including byte order swapping and conversion to and from the ASCII and EBCDIC text encodings. [http://en.wikipedia.org/wiki/Dd_%28Unix%29]
When you run DD command and you are copying few TB of data, you don’t know how much dd copied after some time.
To get status of DD we can do following steps:
– First run DD
dd if=/dev/zero of=/dev/null bs=1M count=100000
This DD is useless used only for demonstration (copy zeroes to null)
– Next we need to know pid of DD
root@gato:~# ps aux |grep dd
root 2 0.0 0.0 0 0 ? S lut05 0:00 [kthreadd]
root 1118 0.0 0.0 103624 1592 ? Ss lut05 0:00 /usr/sbin/winbindd -F
root 1173 0.0 0.0 0 0 ? S< lut05 0:00 [ib_addr]
root 1310 0.0 0.0 103624 912 ? S lut05 0:00 /usr/sbin/winbindd -F
gato 2045 0.0 0.0 25740 2020 ? Ss lut05 0:04 //bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
root 5581 100 0.0 13700 1724 pts/7 R+ 12:38 1:33 dd if=/dev/zero of=/dev/null bs=1M count=100000
root 5735 0.0 0.0 10644 932 pts/4 S+ 12:39 0:00 grep --color=auto dd
root 10141 0.0 0.0 23944 924 ? Ss lut11 0:00 //bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
– After that we can send USR1 signal from different terminal
kill -USR1 5581
– Finally in terminal where we run DD we will see following information
dd if=/dev/zero of=/dev/null bs=1M count=100000
6135+0 przeczytanych recordów
6135+0 zapisanych recordów
skopiowane 6433013760 bajtów (6,4 GB), 120,943 s, 53,2 MB/s
^C27466+0 przeczytanych recordów
27466+0 zapisanych recordów
skopiowane 28800188416 bajtów (29 GB), 529,659 s, 54,4 MB/s
Cheers!