Formatting SD card as FAT32 on Mac?

Named brand micro SD with 8 gigs on it. Trying everything to format as FAT32, on a Mac running Sierra and I get this error:

/dev/disk2s1 does not appear to be a whole disk

When running this:

$ diskutil partitionDisk /dev/disk2s1 1 MBRFormat "MS-DOS FAT32" UDOO 1024M

Any idea what's going on here?


partitionDisk wants the entire drive as its target, because it's about to erase all partitions & replace with your new parameters.

/dev/disk2s1 is your existing 1st partition on that drive, disk2 is what it's looking for. I'm not actually certain why dev/disk2 wouldn't work, but it doesn't.
That would make your command
$ diskutil partitionDisk disk2 1 MBRFormat "MS-DOS FAT32" UDOO 1024M

You can also simplify the command if you like, as far as
$ diskutil partitionDisk disk2 1 MBR fat32 UDOO 1024M
& it will still work.

As pointed out in comments, the volume name only needs to be in quotes if there's a space. I'd missed that, my bad.

Ref: http://ss64.com/osx/diskutil.html