Blocking the mount of a UF2 Bootloader in OSX (and maybe Linux)
I’m really liking Adafruits “Metro Express” version of the Arduino Zero.
Except for one thing.
The UF2 boot loader. Every time I compile and load a sketch I get a whine notification from OSX about how I’ve unmounted a volume without the proper Steve Jobs NeXT dance.
The fix is actually pretty simple — tell fstab to stop mounting the filesystem in the first place. Apple has one solution but it needs a few tweaks for the UF2 boot system.
I'll use Adafruit's METRO as an example. First, use diskutil to find the UUID of the METRO: $ diskutil info /Volumes/METROBOOT/ Device Identifier: disk3 Device Node: /dev/disk3 Whole: Yes Part of Whole: disk3 Device / Media Name: Metro M0 Media Volume Name: METROBOOT Mounted: Yes Mount Point: /Volumes/METROBOOT File System Personality: MS-DOS FAT16 Type (Bundle): msdos Name (User Visible): MS-DOS (FAT16) Content (IOContent): None OS Can Be Installed: No Media Type: Generic Protocol: USB SMART Status: Not Supported Volume UUID: CA043DAF-C1C3-33CC-A5C4-A4B0D2BFDE85 Total Size: 4.1 MB (4096000 Bytes) (exactly 8000 512-Byte-Units) Volume Free Space: 3.5 MB (3530240 Bytes) (exactly 6895 512-Byte-Units) Device Block Size: 512 Bytes Allocation Block Size: 512 Bytes Read-Only Media: No Read-Only Volume: No Device Location: External Removable Media: Yes Media Removal: Software-Activated Virtual: No OS 9 Drivers: No Low Level Format: Not supported
Now, use vifs to change the fstab file:
$ sudo vifs
and add this line to the end of the file using the “Volume UUID” field to replace [Volume UUID]
UUID=[Volume UUID] none msdos ro,noauto
save and quit, then run
$ sudo automount -vc
to update your mac with the new fstab file.
This should stop the device from automounting under OSX and make the METRO work like a “normal” Arduino.