ARM, linux, OYB software, shell

Safely flash SD card images with ddsd

I would like to share another wrapper based on the pv command ( because we love progress bars!! ).

As part of my work in NextCloudPi, I am constantly copying images to an SD card to test the latest build. The classic Linux way of doing this is by using the dd command

We all know the caveats of using this command, namely

  • The syntax is ugly
  • Better not forget that last sync call
  • There is no safety check to prevent you to mistakenly overwriting your root partition
  • If the SD card showed up in a different place, let’s say /dev/sde, you end up with a new 4GB file in /dev/sdd, and still you think that the copy went well.
  • Even though we now have status=progress for dd, I still like the progress bar better.


The usage is simple

The only optional argument is the block size. For instance

As in the dd command, the optimum value for this parameter depends on the specifics of the operating system, buffers and hardware. If not specified, the following rule will be used ( from man pv )

The default buffer size is the block size of the input file’s filesystem multiplied by 32 (512KiB max), or 400KiB if the block size cannot be determined.


Get the script and make it executable. You can do this in two lines, but better inspect it first. Don’t trust anyone blindly.


Author: nachoparker

Humbly sharing things that I find useful [ github dockerhub ]

6 Comments on “Safely flash SD card images with ddsd

  1. Hi nachoparker,
    looks like a nice script to increase the usability for building a SD cards.
    But I think in your description is a typo: Under Usages the second code blocks calls for the normal >>dd<>ddsd<< instead.
    This can be a frustration trap for users.
    Nevertheless, Thanks for the script!

  2. Hi there.

    Very good job.

    I think there’s a typo in the first installation line, possibly must en in ddsd:
    -O /usr/local/bin/ddsd


  3. What’s that nice terminal theme, that displays you the next tab completion with dimmed colors and the other swag? 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *