:: dd 상태진행 표시
블록 복제하거나....원하는 사이즈 파일을 만들때 사용
1. PV(Pipe Viewer) 사용# sudo apt-get install pv
# dd if=/dev/zero | pv | dd of=test.img bs=2048 count=1000000
dd: warning: partial read (1024 bytes); suggest iflag=fullblock
982442+17558 레코드 들어옴] [ <=> ]
982442+17558 레코드 나감
2030613504 bytes (2.0 GB, 1.9 GiB) copied, 5.38553 s, 377 MB/s
1.89GiB 0:00:05 [ 359MiB/s] [ <=> ]※ pv options ( -tpreb )
-t, --timer Turn the timer on. This will display the total elapsed time that pv has been running for.
-p, --progress Turn the progress bar on. If standard input is not a file and no size was given (with the -s modifier), the progress bar cannot indicate how close to completion the transfer is, so it will just move left and right to indicate that data is moving.
-r ,--rate Turn the rate counter on. This will display the current rate of data transfer.
-e, --eta Turn the ETA timer on. This will attempt to guess, based on previous transfer rates and the total data size, how long it will be before completion. This option will have no effect if the total data size cannot be determined.
-b, --bytes Turn the total byte counter on. This will display the total amount of data transferred so far.
dialog 화면하고 연동
# sudo apt-get install dialog
# (pv -n /dev/sda | dd of=/dev/sdb bs=128M conv=notrunc,noerror) 2>&1 | dialog --gauge "Running dd command (cloning), please wait..." 10 70 0
2. status=progressstatus 옵션중 progress는 coreutils >= 8.24 부터 지원
Ubuntu 16.04 에서는 기본버전이 8.25
# dpkg --list |grep coreutils
ii coreutils 8.25-2ubuntu2 amd64 GNU core utilities
# dd if=/dev/zero of=test.img bs=2048 count=1000000 status=progress
1471096832 bytes (1.5 GB, 1.4 GiB) copied, 2 s, 736 MB/s1000000+0 레코드 들어옴
1000000+0 레코드 나감
2048000000 bytes (2.0 GB, 1.9 GiB) copied, 2.77894 s, 737 MB/s
참고
http://askubuntu.com/questions/215505/how-do-you-monitor-the-progress-of-dd