Formatting SD card as FAT32 on Mac?
partitionDisk wants the entire drive as its target, because it's about to erase all partitions &amp; 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
&amp; 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