Skip to content

Instantly share code, notes, and snippets.

@vyder
Last active October 6, 2016 07:08
Show Gist options
  • Save vyder/055090706612e38d45a326f5fdf5c07d to your computer and use it in GitHub Desktop.
Save vyder/055090706612e38d45a326f5fdf5c07d to your computer and use it in GitHub Desktop.
Writing a disk image to a flash drive/SD card from OSX

Or, just install hypriot/flash and run:

$ flash /path/to/img

It also prints a pretty progress bar for dd, which is incredibly useful.

  1. List devices

    $ diskutil list
    
  2. Unmount the one you want to write to

    $ diskutil unmountDisk /dev/disk<n>
    
  3. Write the image

    $ sudo dd if=/path/to/img of=/dev/disk<n> bs=1m
    
    • if - input file
    • of - output file
    • bs - input/output block size
  4. Eject the disk

    $ diskutil eject /dev/disk<n>
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment