Skip to content

Instantly share code, notes, and snippets.

@M1ke
Created October 3, 2013 11:15
Show Gist options
  • Save M1ke/6808171 to your computer and use it in GitHub Desktop.
Save M1ke/6808171 to your computer and use it in GitHub Desktop.
Bash scripts for copying images to and from drives. Made with the intention of replicating SD cards for Raspberry Pi
#!/bin/bash
# img will have gz appended
img=$1
drive=$2
dd if=$drive | gzip > $img.gz
#!/bin/bash
# img must be gz
img=$1
drive=$2
gzip -dc $img | dd of=$drive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment