2008-07-24

How To Forcefully Eject A USB Stick In Windows And Linux

by Anoop Engineer 11 comments






You plugged in a USB Flash drive, copied some files, and then tried to eject the drive.
But Windows says openly that it doesn't like you. So sad.



This can occur when some processes running in the background are accessing your USB drive. You cannot simply pull out the thumb drive, because you risk corrupting the data in it.

Until now, your only way seemed to be shutting down the computer. Not any more, for here comes a very nifty little utility. Read along to find out more.

EjectUSB is an extremely tiny (250 KB) utility that finds out what all applications are using the USB disk, kills them all mercilessly and releases your disk from the Windows jail, all within a matter of seconds.
All you have to do, is download the zip archieve, extract it to your USB disk and run the executable. Visit this link to watch a video of EjectUSB in action.

Now, how to achieve the same in Linux?
In Linux, the procedure is a bit simple because you don't have to download any new utility. The program that you are going to use, called fuser comes pre-installed in almost all distros.

If you are unable to unmount the disk using the GUI in GNOME or KDE, just open up a terminal and run sudo fuser -k /media/usbdrive. Change /media/usbdrive to where your USB drive is mounted.
This command kills all processing accessing your usb drive and then a simple eject command from your GNOME or KDE explorer will do the trick.

Note: In both Windows and Linux, remember to close all unsaved files in USB drive before attempting these.

Comments 11 comments
atoztoa said...

I have been having the problem with my Maxtor External HDD for a long time.

I am releaved to see this post, Anoop.

BUT, it is not working !!!

The taskbar icon is still there, the operation not yet finished. Have been a couple of minutes. What-to-do...

Mayur said...

nice share...
Thanks

DarkRadience said...

... just pull it the f*ck out?? haha

Anonymous said...

ya or bite the crap out

jacjos said...

try terminating the explorer process from the task manager and then start it again. Some times this works. I believe the reason would be because if you view your files in the thumbnail view, the file's thumbnail is somehow gets tied up with the explorer.

Embee said...

In linux you could also run sudo fuser -m /where/deviceismounted
It will give back the relevant PID that's preventing the device from being unmounted. Close that app, and the USB stick will be unmounted with no further trouble..

Anonymous said...

No computer tells me what to do! I'll just rip it out and screw the consequences

Anonymous said...

i never eject the thing, i jsut make sure its transfering data, it has an activity light
then i take it out.

Anonymous said...

I wouldn't care if it corrupted ...I make copies of their contents...rip it out the pc!!!!

Anon A. Mouse said...

WoW! me l33t cuz [bad grammar] and [pointless flame] is [baseless insult] and your iif(idiot="male","mother","father") should [physical impossibility] because I [baseless boast] and [garbled text] !!?!!

-I'd like to join the Internets pipes likes I knows my stuffs, so here is a template seems to apply to 98% of the posts, I'll flesh it out l8tr (see,
l8tr' means 'later', due to the homophonic nature of '8' and 'ate', cool, huh?)

Sinn replica watches said...

Your post is really informative for me. I liked it very much.

Post a Comment

Subscribe feeds via e-mail
Subscribe in your preferred RSS reader

Advertise on this site Sponsored links

Subscribe feeds rss Recent Entries

Categories

Subscribe feed rss Popular posts

Subscribe comments rss Recent Comments

Technorati

Technorati
My authority on technorati
Add this blog to your faves