Skip to content

Instantly share code, notes, and snippets.

@jason-riddle
Last active October 21, 2019 01:37
Show Gist options
  • Save jason-riddle/7740122 to your computer and use it in GitHub Desktop.
Save jason-riddle/7740122 to your computer and use it in GitHub Desktop.
Burn to sdcard using dd and pv #guide #complete
SD_CARD="/dev/disk1000"
LOCAL="~/Desktop/2013-09-25-wheezy-raspbian-minimal.img"
# First, unmount the disk
diskutil unmountDisk ${SD_CARD}
# If you are writing from SD card to Mac, calculate the number of bytes to skip as well as the size to pipe to pv.
# 5785600 bytes (count) * 512 (default bs) = 2962227200 bytes == 2825 Megabytes
dd if=${SD_CARD} count=5785600 | pv -s 2825M | dd of=${LOCAL} count=5785600
# If you are writing from the Mac to SD Card, then use the following.
sudo dd if=${LOCAL} | pv -s 2825M | dd of=${SD_CARD}
# If you want to use the exact number of bytes (from the ls -alh command), you can do so.
LOCAL="$PWD/FreeBSD-armv6-11.0-RPI-B-291824.img"
SIZE="$(stat -f%z ${LOCAL})"
SD_CARD="/dev/disk3"
BS="1m"
sudo dd if=${LOCAL} bs=${BS} | pv -s ${SIZE} | dd of=${SD_CARD} bs=${BS}
# Various images that have been used before
LOCAL="$PWD/FreeBSD-11.0-CURRENT-arm-armv6-RPI-B.img"
LOCAL="$PWD/resin-Temp-0.1.0-1.1.0-7588720e0262.img"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment