LINUX- show progress bar during dd copy using pv

Warning & Disclaimer: dd is a low level tool. if you are not familiar with it  please do NOT use it. If wrongly used it can wipe off all your data. Always run or play with such commands on TEST Machines first. If you follow this post , you accept you are doing it at your own risk.

Method 1:

dd if=FILE1 of=FILE2
pkill -USER1 dd  

To see output being refreshed continuosly:

watch -n 10 pkill -USR1 dd

Method 2:

pv FILE1 | dd of=FILE2

EXAMPLE: sudo pv /dev/sde3 |dd of= /tmp/mybackup.img

WHERE: /dev/sde3 is the data partition (the input) on my usb drive
AND /tmp/mybackup.img  is the output (the backup)

I have taken this post & modified a bit to make it more clear from Robert’s Blog.

 

Advertisements

One comment

  1. In order to get it to work I had to do:
    sudo pv FILE1 | sudo dd of=FILE2
    (note the sudo before the dd command as well).

    Other than that, really helpful, thanks!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s