Do not like the silent dd on unix? Let’s add a progress bar for it. (Using pv)

Though dd is not efficient, it’s still widely used for many years until now, especially when we are “burning” the disk image of the famous Raspberry Pi or some related boards, the worst point I hate about dd is the silence, it makes me worried, we can not know the progress of the process, and if it takes too much time, we may start to think about if the computer hung, the SD card broken, or something else … until the process finished, that’s very bad.

I’ve found pv and also use it for a while, it’s the Pipe Viewer, a terminal-based tool for monitoring the progress of data through a pipeline, I know it’s not so famous and widely used, so I would like to share and talk about it, let’s start it!

pv is a OSI(Open Source Initiative, not the network Open Systems Interconnection model) certified open source software, here is the homepage of it: https://www.ivarch.com/programs/pv.shtml

pv-homepage.png

The latest release until now is v1.6.0, the version in Ubuntu 14.04 LTS is v1.2.0, but still works well, I am going to use Raspbian Jessie, version February 2016 (Release date:2016-02-09) as the example image in this post, and writing an raw image to a microSD card as the scenario.

Traditionally, we use dd like this, dd in, dd out, with silence:

$ sudo dd if=./2016-02-09-raspbian-jessie.img of=/dev/sdd bs=10M
dd_install_2016-02-09-raspbian-jessie.png
閱讀全文