Clearing the OSX extended files off of microcontroller flash drives #Apple #Catalina #AdafruitForums

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.


Have an amazing project to share? The Electronics Show and Tell is every Wednesday at 7:30pm ET! To join, head over to YouTube and check out the show’s live chat and our Discord!

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Join over 38,000+ makers on Adafruit’s Discord channels and be part of the community! http://adafru.it/discord

CircuitPython – The easiest way to program microcontrollers – CircuitPython.org


New Products – Adafruit Industries – Makers, hackers, artists, designers and engineers! — New Products 11/15/2024 Featuring Adafruit bq25185 USB / DC / Solar Charger with 3.3V Buck Board! (Video)

Python for Microcontrollers – Adafruit Daily — Python on Microcontrollers Newsletter: A New Arduino MicroPython Package Manager, How-Tos and Much More! #CircuitPython #Python #micropython @ThePSF @Raspberry_Pi

EYE on NPI – Adafruit Daily — EYE on NPI Maxim’s Himalaya uSLIC Step-Down Power Module #EyeOnNPI @maximintegrated @digikey

Adafruit IoT Monthly — The 2024 Recap Issue!

Maker Business – Adafruit Daily — Apple to build another chip at TSMC Arizona

Electronics – Adafruit Daily — SMT Tip – Stop moving around!

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !


No Comments

No comments yet.

Sorry, the comment form is closed at this time.