Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SeanCline/8358eb7d56cc7f388cd7d1ac8f2329ff to your computer and use it in GitHub Desktop.
Save SeanCline/8358eb7d56cc7f388cd7d1ac8f2329ff to your computer and use it in GitHub Desktop.

Raspberry PI (cli):

  $ DST_HOST=nc_machine_addr
  $ SDSIZE=`sudo blockdev --getsize64 /dev/mmcblk0`;sudo pv -tpreb /dev/mmcblk0 -s $SDSIZE | nc $DST_HOST 19000

Netcat machine | "nc_machine_addr" (srv):

  $ nc -l 19000 | dd bs=1M of=/path/to/file.img

Restoring img to SD card:

  $ sudo dd bs=1M if=/path/to/file.img of=/dev/disk1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment