The drive is not unmounting. Try this instead:
- Restart the computer.
- Immediately after the chime press and hold down the "COMMAND" and "R" keys together.
- Release the keys when the Utilities Menu appears.
- Select Disk Utility from the Utility Menu and click on the Continue button.
- Select the USB device from listing. Click Unmount from the toolbar icons. If the device ghosts out in the listing:
- Click on the Erase tab in the Disk Utility toolbar. A panel should drop down.
- In the drop down panel set the partition scheme to MBR. Set the Format type to MSDOS.
- Click on the Apply button and click on the Done button when it is activated.
- Quit Disk Utility.
If the disk will not unmount then quit Disk Utility. From the Utilities' menu select Terminal. At the Terminal prompt enter:
diskutil list
Locate the entry for the flash drive and note the Disk identifier number and the Slice number on the right. It may, for example, be /dev/disk1s2. Yours may differ. Now, enter the following at the Terminal prompt:
diskutil unmountDisk force /dev/disk1
If the command succeeds then quit the Terminal and relaunch Disk Utility from the Utility Menu. Try partitioning and formatting again.