Get drive name
diskutil list
then try
diskutil unmountDisk force /dev/DRIVENAME
Then format
diskutil eraseDisk JHFS+ Emptied /dev/DRIVENAME
or
diskutil eraseDisk FAT32 DRIVENAME /dev/disk1
Get drive name
diskutil list
then try
diskutil unmountDisk force /dev/DRIVENAME
Then format
diskutil eraseDisk JHFS+ Emptied /dev/DRIVENAME
or
diskutil eraseDisk FAT32 DRIVENAME /dev/disk1