Last active
February 14, 2024 18:17
-
-
Save rgov/e029e97c294df7eba2c864919564fd0d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -eu | |
# remount-circuitpy.sh -- remount a FAT disk, usually CIRCUITPY, so it works | |
# | |
# Works around bug where macOS 14.x causes file corruption on small FAT | |
# filesystems. The remount apparently causes older kernel FAT driver | |
# to be loaded. see https://github.com/adafruit/circuitpython/issues/8449 | |
# | |
# Original author: Tod Kurt @todbot | |
DISKNAME=${1:-CIRCUITPY} | |
DISKDEV=$(df | grep "$DISKNAME" | cut -d" " -f1) | |
sudo umount "/Volumes/${DISKNAME}" | |
sudo mkdir "/Volumes/${DISKNAME}" | |
sleep 2 | |
sudo mount -v -t msdos "$DISKDEV" "/Volumes/${DISKNAME}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment