USB-Stick (Format: FAT) retaining incomplete files I'm having a problem deleting files from a USB-Stick, which is formatted with FAT.
I tried transferring files from my Mac to the USB-Stick, and if I remember correctly, removed it from the USB-port before it finished transferring the files. Therefore some files weren't transferred entirely, resulting in this:



The three bottom folders haven't been transferred completely, hindering me from accessing them. The top two folders contain files, which weren't transferred entirely.

If I try to delete the folders, by simply selecting them and pressing ⌘⌫ it deletes them for about a second, but then they return.
I have tried formatting the USB-Stick:



...but I get the following error:




  Deletion of the following medium has failed
  Following error has occurred, while trying to delete the following medium:
  The medium couldn't be deactivated.




Is there any way I can delete the entire content, so I have a completely clear USB-Stick?
It seems as if Disk Utility can't lock the device. This is usually because some other process has open handles on a mount point that resides on the drive. As it's an USB pen drive, I guess you already tried plugging and reinserting it. Thing is: As soon as it gets mounted, something immediately seems to request a lock. This MIGHT be Finder. If you want to know which process is responsible for this, execute sudo lsof /Volumes/Stick from terminal. This shows you all open handles and their respective owners affecting /Volumes/Stick.

Try disabling auto mount. Unfortunately it's a bit complicated.


Plug in your supposedly faulty stick. Open a terminal and wait until Finder recognizes the drive.
Enter mount. You will see something like
/dev/disk3s1 on /Volumes/Stick (exfat, local, nodev, nosuid, noowners). Note down the first part which refers to the device and the first part in brackets, in this example /dev/disk3s1 and exfat, the filesystem on that drive.
Run diskutil info &lt;device&gt; | grep "Volume UUID" in terminal, where &lt;device&gt; must be replaced with the device you noted down in the second step, so you'll end up with something like diskutil info /dev/disk3s1 | grep "Volume UUID".
The output of this command is a UUID. It should read something like Volume UUID:              03D819D9-49E0-387E-AC9E-2CB54BF0DDD9
Now unplug your USB drive and run sudo vifs. If you are not used to vi you want to put a EDITOR=nano afterwards. Edit the last line of the file making it read UUID=&lt;UUID&gt; none &lt;filesystem&gt; noauto, e.g. UUID=03D819D9-49E0-387E-AC9E-2CB54BF0DDD9 none exfat noauto. Exit the editor.
Now plug it back in. If you done the steps correctly, the drive won't be mounted automatically. 
Try to format it again using Disk Utility.