Adafruit forums user aaaidan ran into an issue familiar to those using OSX (Catalina) with flash drives, including microcontroller development boards appearing as flash drives.
I found I was running out of space on my Trinket M0 super easily, and I wanted to share a tip for Mac OS that helped save me a lot of space (possibly dozens of KB on my very modest program). This is beyond clearing out needless visible files and hidden files (e.g. dotfiles).
While adafruit have done a really good job hinting to operating systems that they shouldn’t write metadata to the drive (no_log etc), that doesn’t stop Mac OS copying “extended attributes” on files if you copy-paste or drag them into the drive in the Finder. (This is explained by Adafruit here under “Copy Files on Mac OSX Without Creating Hidden Files”.)
For me, a newcomer to CircuitPython, these attributes were included when I copied the default main.py program, and some adafruit SPI library files into the lib folder. A total of 5 files (~8.5KB of code). But it wouldn’t fit in the 48KB drive, even after I cleared out all the junk I could find. (And emptied the trash ;P)
After a bit of research and learning about these extended attributes, I cleared them manually on every file. I was very surprised to see how much space it freed up on the drive. I went from having 0% free to about 50% free, which is over 20kb – enough for a decent main.py.
If you are having the same issues, see the forum post for a shell script that will clean up the extended file attributes, freeing up much appreciated space.