Can't reformat SD card (Yosemite)
Get drive name
diskutil list

then try
diskutil unmountDisk force /dev/DRIVENAME

Then format
diskutil eraseDisk JHFS+ Emptied /dev/DRIVENAME

or
diskutil eraseDisk FAT32 NEWNAME /dev/DRIVENAME