Skip to content

Instantly share code, notes, and snippets.

@pikesley
Last active June 28, 2020 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pikesley/428858d1932c8ada234aaa0be55e922d to your computer and use it in GitHub Desktop.
Save pikesley/428858d1932c8ada234aaa0be55e922d to your computer and use it in GitHub Desktop.

How to set up a MicroSD card with the NOOBS installer (on a Mac)

Formatting 64GB and larger MicroSD cards with the SD Card Formatter thing no worky, it needs to be FAT32. And I've forgotten that more than once, so I'm writing it down here

This all presumes that you're happy to blat whatever's already on the card

  • Create a new directory
  • Create a Makefile in the directory with the content below
  • Copy the latest NOOBS into the directory
    • make download if you don't already have it
  • Unzip it
  • make install
    • Provide VOLUME_NAME if you want to call it something other than PI
    • Provide a DISK number if your SD Card is something other than disk2. You really want to confirm this with mount or something before you inadvertently destroy some other attached disk

Identical, Repeatable, Disposable

VOLUME_NAME := PI
DISK := 2
install: format symlink rsync unmount
format:
diskutil partitionDisk disk${DISK} MBR "MS-DOS FAT32" "${VOLUME_NAME}" 100%
symlink:
ln -sf $(shell find . -type d -name "NOOBS*" -depth 1 | sort | tail -1) NOOBS
rsync:
rsync -av NOOBS/ \
/Volumes/${VOLUME_NAME}/
unmount:
sudo diskutil unmount /Volumes/${VOLUME_NAME}/
download:
curl -L https://downloads.raspberrypi.org/NOOBS_lite_latest -o NOOBS.zip
unzip NOOBS.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment