DD IF=/DEV/SDA Of=/dev/sdb bs=10m
The progress of the DD command is displayed under Linux:
DD If=/dev/zero of=/tmp/zero.img bs=10m count=100000
To see the execution progress of the DD command above, you can use the following methods:
Example: Output dd progress every 5 seconds
Method One:
Watch-n 5 PKILL-USR1 ^dd$
Method Two:
Watch-n 5 KILLALL-USR1 DD
Method Three:
While KILLALL-USR1 DD; Do sleep 5; Done
Method Four:
while (PS auxww |grep "dd" |grep-v grep |awk ' {print $} ' |while read PID; Do KILL-USR1 $pid; Done); Do sleep 5; Done
The above four methods use three commands: Pkill, Killall, kill to the DD command to send SIGUSR1 information, the DD command process after receiving the signal to print their current progress.
Backup:
DD IF=/DEV/HDX of=/dev/hdy #将本地的/DEV/HDX full disk Backup to/dev/hdy
DD IF=/DEV/HDX of=/path/to/image #将/DEV/HDX full data Backup to the image file of the specified path
DD IF=/DEV/HDX | Gzip >/path/to/image.gz
#备份/DEV/HDX Overall data and compress it using the Gzip tool to save to the specified path
Recovery:
DD If=/path/to/image OF=/DEV/HDX #将备份文件恢复到指定盘
gzip-dc/path/to/image.gz | DD OF=/DEV/HDX #将压缩的备份文件恢复到指定盘
Use Fdisk–u–l to view the partition information,
with DD BS = 512 (in the information viewed) count= (the largest end number in the Fdisk command +1) if=/path1 of=/path2
Linux DD usage Record