How do I format a partition with FAT32? The command diskutil eraseDisk is not what I want because that wipes the entire disk. I have a partition already allocated and it is blank. All I need to do is format it with VFAT/FAT32. How can this be done from Terminal? It must the same effect as using mkfs.vfat on Linux.
Enter diskutil list to get the disk identifier/partition. Then enter:

diskutil eraseVolume FAT32 DATA diskXsY #replace diskXsY by the proper disk identifier


DATA will be the name of the volume. The name has to be capitalized using diskutil ....



The diskutil eraseVolume ... command will change the pMBR of the GUID partition table to a hybrid MBR and probably renders an existing OS X system volume on the same drive unbootable.