DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: -Recklessly- remove hardware (from USB)  (Read 12,467 times)

SKesselman

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 318
-Recklessly- remove hardware (from USB)
« on: September 27, 2009, 09:52 AM »
Hi,
Can someone please tell me what bad things will happen if I just unplug something from the USB, without "Safely remove"ing it?
Simply unplugging external devices/peripherals (a printer, a digital camera & a smartphone) doesn't seem to affect anything.
Does this apply only to certain types of hardware, or what?

Thanks.
-Sarah

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: -Recklessly- remove hardware (from USB)
« Reply #1 on: September 27, 2009, 09:57 AM »
wait for the experts to chime in, but i believe the real danger in prematurely unplugging a USB device is if it's a USB storage device of some sort that you have written TO (reading from shouldn't pose any risk).

in this case -- what you have worry about is that the operating system may not have actually finished writing to the drive even though it looks for all intents and purposes like it has.

other than that, it's hard to think what harm could really be caused.

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • Coding Snacks
    • Volunteers/Staff
    • Gathering Badge
    • Participated in NANY Challenge Once
    • Linux User
Re: -Recklessly- remove hardware (from USB)
« Reply #2 on: September 27, 2009, 10:49 AM »
i concur with what mouser said. if you have to remove "recklessly", then at least enable the "Optimize for quick removal" option within your removable drive settings. you can read more about this option here.

jgpaiva

  • Artificial Idiocy
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • Cody Award
    • Participated in NANY Challenge Once
    • Coding Snacks
    • Portugal Inhabitant
    • Linux User
Re: -Recklessly- remove hardware (from USB)
« Reply #3 on: September 27, 2009, 11:16 AM »
Here's a topic from 2007 about the dangers of not using the "safely remove" option. It's more directed at external disks, however.

hpearce

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 139
Windows 7 SP1 (TM) Home Premium 64-bit .. Intel(R) Core(TM)2 Duo CPU P8400 @ 2.26 GHz / 2.27 GHz .. 4GB RAM .. NVIDIA GeForce 9800M GTS .. Gateway P-7805u FX

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • Coding Snacks
    • Volunteers/Staff
    • Gathering Badge
    • Participated in NANY Challenge Once
    • Linux User
Re: -Recklessly- remove hardware (from USB)
« Reply #5 on: September 27, 2009, 11:46 AM »
another "usb ejector" - USB Disk Ejector. this freeware also supports command-line parameters, can easily be run from Farr.

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Re: -Recklessly- remove hardware (from USB)
« Reply #6 on: September 27, 2009, 04:57 PM »
Even with "optimize for quick removal", I'd still use "safely remove" to be 100% on the safe side. That will ensure all data is flushed and the filesystem is clean, and will notify you if there's programs still trying to access the device.

Do non-storage devices even show up on safely remove?
- carpe noctem

SKesselman

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 318
Re: -Recklessly- remove hardware (from USB)
« Reply #7 on: September 27, 2009, 05:07 PM »
Do non-storage devices even show up on safely remove?
Yes. All things USB show up. That's really why I'm asking - with my external drives, I'm happy to wait; with my printer or headset, it's so tedious...
-Sarah

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Re: -Recklessly- remove hardware (from USB)
« Reply #8 on: September 27, 2009, 05:16 PM »
Hm, I don't think neither my printer nor my scanner shows up on the list - I always just yank those out anyway :)
- carpe noctem

SKesselman

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 318
Re: -Recklessly- remove hardware (from USB)
« Reply #9 on: September 27, 2009, 05:20 PM »
Hm, I don't think neither my printer nor my scanner shows up on the list - I always just yank those out anyway :)

:D OK, question answered. Thanks!
-Sarah

Innuendo

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,266
Re: -Recklessly- remove hardware (from USB)
« Reply #10 on: September 27, 2009, 05:52 PM »
If I recall correctly, the latest versions of Windows don't turn on a write cache for USB devices so they should be safe to just "yank out" unlike back in the Win98 days when doing so would surely corrupt your data.

I'm reading/writing from USB flash drives all day long & I'll confess that I'm a yank and run kind of person and never mess with "safely remove". I've been practicing this 'bad behavior' for a couple years now and data has never gotten corrupted.

But don't use my bad behavior as an excuse for you to act badly as well. :)

Ehtyar

  • That News Guy
  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 1,237
    • Plugin Coding Medal
    • Gathering Badge
Re: -Recklessly- remove hardware (from USB)
« Reply #11 on: September 27, 2009, 11:24 PM »
Even with "optimize for quick removal", I'd still use "safely remove" to be 100% on the safe side. That will ensure all data is flushed and the filesystem is clean, and will notify you if there's programs still trying to access the device.
Amen. However, it is extremely frustrating when Windows refuses to eject a device despite there being no open handles to it. I find that in this case, there are no adverse effects to simply yanking the device.

Ehtyar.

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Re: -Recklessly- remove hardware (from USB)
« Reply #12 on: September 27, 2009, 11:38 PM »
Even with "optimize for quick removal", I'd still use "safely remove" to be 100% on the safe side. That will ensure all data is flushed and the filesystem is clean, and will notify you if there's programs still trying to access the device.
Amen. However, it is extremely frustrating when Windows refuses to eject a device despite there being no open handles to it. I find that in this case, there are no adverse effects to simply yanking the device.
I haven't experienced that?

However, I find that tortoisesvn's cache service often has a lock on an usb drive - killing the process fixes the problem :)
- carpe noctem

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • Coding Snacks
    • Volunteers/Staff
    • Gathering Badge
    • Participated in NANY Challenge Once
    • Linux User
Re: -Recklessly- remove hardware (from USB)
« Reply #13 on: September 28, 2009, 01:46 AM »
if clicking/locating the 'safely remove' icon on the systray is tedious for you, then you can create a shortcut on the desktop with the following parameter.

Code
%windir%\System32\RUNDLL32.EXE shell32.dll,Control_RunDLL hotplug.dll

executing this shortcut will show the 'safely remove' dialog. plus you can also check the "Display device components" option which will display more info about the device, useful if you have more than one thumb drive plugged in at a time.

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
Re: -Recklessly- remove hardware (from USB)
« Reply #14 on: September 29, 2009, 05:02 AM »
Even with "optimize for quick removal", I'd still use "safely remove" to be 100% on the safe side. That will ensure all data is flushed and the filesystem is clean, and will notify you if there's programs still trying to access the device.
Amen. However, it is extremely frustrating when Windows refuses to eject a device despite there being no open handles to it. I find that in this case, there are no adverse effects to simply yanking the device.
I haven't experienced that?

However, I find that tortoisesvn's cache service often has a lock on an usb drive - killing the process fixes the problem :)

I used to get it a fair bit which I attributed to the "Shell Media Handler" in XP.  According to nlite info it can be responsible for keeping a lock on media files, (it's used for popup media file info and thumbnails of video files, IIRC).

However, ever since I started removing it and all the WMP components about the only thing that now holds a lock is Everything, (I should probably go through it's prefs and specify exactly which drives to only index....but it's so much easier to just exit it :) ).
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Re: -Recklessly- remove hardware (from USB)
« Reply #15 on: September 29, 2009, 05:04 AM »
4wd: ah yes, shell media handler can be a lot of trouble - I haven't had that component installed for the last.. 5? years, so hadn't thought about it :). It's especially a problem when you use 3rd party codecs; with unstable codecs (as those found in codec packs) and slightly corrupted media files, you get anything ranging from file locks to constant explorer crashes.
- carpe noctem

Original address: https://www.donationcoder.com/forum/index.php?topic=20077.0