Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 04, 2016, 12:10:24 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: Windows "safely remove device" thingie  (Read 17249 times)

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Windows "safely remove device" thingie
« on: April 13, 2007, 07:13:31 AM »
Anyone know this: Screenshot-07_04_13,01_14_08.png?
Do you actually use it?

I have a few doubts about this. There has been a time where i'd be very cautious about it, but eventually gave up when i found out that using it would frequently restart the connection on all USB ports and, as my modem was USB at the time, it'd make my internet connection drop everytime i "safelly removed" something.

Although i do understand that it is meant to avoid having processes writing or reading from the usb disk when it is unpluggled, i don't think that not using it does that much damage. I own an external USB hdd, and although i'm very cautious not to unplug it when i'm working in it, i never "safely remove" it, also because, for some reason, that thing only works when i "safely remove" that disk twice, since the first time it always fails for some stupid reason.

So.. What's your opinion on this?

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,029
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: Windows "safely remove device" thingie
« Reply #1 on: April 13, 2007, 07:40:13 AM »
I use it when I need to remove a device, all the time, period. If you don't do this, you risk filesystem cache not being flushed, device not being unmounted cleanly, and filesystem corruption as a result. If you have your devices set as "optimize for quick removal" (which means slow speed) the risk of damage is a lot smaller, but you'll suffer from bad speed.

And yeah, sometimes the device will be in use even though it appearantly makes no sense... even an application having it's "current working directory" set to a location on the external disk will cause this, no files have to be open.
- carpe noctem

TucknDar

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,104
    • View Profile
    • Donate to Member
Re: Windows "safely remove device" thingie
« Reply #2 on: April 13, 2007, 11:52:27 AM »
I use it for my external hdd (rarely though, as it's connected pretty much 24/7) and my iPod, but not for my thumbdrive. I'm planning on buying a better thumbdrive with more space (currently 128mb :o ) which I'll be running a few apps on, and I'll probably use the safely remove-option when I get that.

CWuestefeld

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,001
    • View Profile
    • Donate to Member
Re: Windows "safely remove device" thingie
« Reply #3 on: April 13, 2007, 12:06:33 PM »
I follow the rules almost always. The exception is when it tells me it can't stop the device, which I guess is because some badly-behaved program is still pointing to it as the default directory after a File|Save or something.

A recent article on the Langa List http://windowssecret...m/comp/070405#langa0 points out other ugly problems that can occur when you break the rules. I've never experienced these, though.
Quote
Have you ever had Windows show you a device — perhaps a USB drive or other removable device — that's no longer connected to your system? When this happens, you can run into trouble if software tries to access the phantom device.

Or, because the nonexistent device is still consuming a drive letter assignment and/or other resources, you may have problems when you add additional devices that need the already-assigned resources. I've seen some cases where people were running out of drive letters because their systems were maintaining a whole flock of phantom drives! ...

Phantom devices can appear for any number of reasons. Perhaps the most common reason is a shutdown error with a removable drive...

gjehle

  • Member
  • Joined in 2006
  • **
  • Posts: 286
  • lonesome linux warrior
    • View Profile
    • Open Source Corner
    • Read more about this member.
    • Donate to Member
Re: Windows "safely remove device" thingie
« Reply #4 on: April 13, 2007, 12:43:57 PM »
oops, just found the proper place to post, here we go:

Off topic a bit...
The oh-so-damn-useful unplug-stuff thingie (which i never use).
Your referring to the Safely Remove Hardware icon. Unless you have a "permanent" thing like an external drive or DVD drive that you never turn off or unplug, you actually should be using this lol...
Actually, good idea. I'll start a new thread asking for more info on that :)


the thing i think this 'unplug thingy' does is making sure the filesystem is sync, in 99.9999% a very good idea.
virtually all filesystems that are used in 'normal' scenarios use some kind of buffer at some point (esp when writing to the device, which most of the time is a fire-and-forget task (unlike reading which has to respond with data asap)).
on linux and unix there's 'fsync' (good idea to use if you're creating a initrd image via loopback device), on windows you just click 'remove device', i pretty sure it does the same thing, make sure all data is consistent and buffers are cleared.

depending on the device (type of filesystem) it is more or less likely that you'll corrupt it by unplugging.
if there hasn't been any writing access to the device over the last few seconds it is also unlikely that there's still something in the buffer (if your I/O scheduler was idle for some time)
still.. chances remain..

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: Windows "safely remove device" thingie
« Reply #5 on: April 13, 2007, 04:42:18 PM »
Oh... Buffers and delayed/lazy writing... Now i know i should pay more atention to my classes!
Yeah, i learned that in my "Operating Systems" course at the uni.
I'm much more enlightened about what could happen if i don't use that!!
Thanks a lot!

I was wrongly thinking that, after windows said there was no writing to the disk, there wouldn't be any, but you're absolutelly right, stuff can be left behind.
Oh damn... I think the best option i have is to buy a usb hub so that i can keep everything connected and not have to be plugging and unplugging stuff everytime i want to connect my usb pen drive :)

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,029
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: Windows "safely remove device" thingie
« Reply #6 on: April 13, 2007, 04:43:05 PM »
Also, if you get the "device busy, cannot unmount" error, try using the handle tool from sysinternals - it will often show you which program is the sinner. Doesn't always work though, which puzzles me; I'd really like to know what has the device locked in those situations.
- carpe noctem

CWuestefeld

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,001
    • View Profile
    • Donate to Member
Re: Windows "safely remove device" thingie
« Reply #7 on: April 13, 2007, 04:53:17 PM »
Speaking of annoying USB behavior...

My PC has 6 high-speed USB2 ports. But if I ever plug in a USB1 device, the entire chain is downgraded to USB1 (until I reboot). So the minute I plug in my scanner, my flash drive's data transfers become glacial. Plugging in the drive or my MP3 player gives the message "This device can perform better...". This even happens if I use a USB hub, plugging the scanner into the hub to try insulating the system from the device.
Has anyone ever heard of such a thing?  :tellme:

I recently got a DV camcorder, and bought a Firewire interface for it. That card also happens to have 2 more USB2 ports. I'm hoping that I can plug my scanner into one of those ports, and since they're connected through an entirely different bus, it won't affect the speed of the original ports.

Hirudin

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 543
    • View Profile
    • Donate to Member
Re: Windows "safely remove device" thingie
« Reply #8 on: April 14, 2007, 03:27:21 AM »
I've heard of that happening CWuestefeld, I think I might have seen it on the MFSN forums, but I might be completely wrong.

I always use the safely remove hardware thing when removing USB drives, except (as others above have said) when something stupid is happening and it says it can't remove it...

gjehle

  • Member
  • Joined in 2006
  • **
  • Posts: 286
  • lonesome linux warrior
    • View Profile
    • Open Source Corner
    • Read more about this member.
    • Donate to Member
Re: Windows "safely remove device" thingie
« Reply #9 on: April 14, 2007, 03:33:04 AM »
Speaking of annoying USB behavior...

My PC has 6 high-speed USB2 ports. But if I ever plug in a USB1 device, the entire chain is downgraded to USB1 (until I reboot).[...]

well, never heard of that, wonder if it's a firmware or software problem tho

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,666
    • View Profile
    • App's Apps
    • Read more about this member.
    • Donate to Member
Re: Windows "safely remove device" thingie
« Reply #10 on: April 14, 2007, 05:51:36 AM »
I am wondering something...

There is a 'safely remove hardware' for usb devices, which is good for usb thumb drives and such...but what about CF and other types of cards? They can suffer the same problems on removal that USB devices can.

I have never seen a card reader that has a feature for 'safe removal' of a card. Why is this?

Hirudin

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 543
    • View Profile
    • Donate to Member
Re: Windows "safely remove device" thingie
« Reply #11 on: April 14, 2007, 07:29:06 AM »
Inresting... Yeah, it's odd that they don't let you "safely remove" flash cards with that icon... I guess MS doesn't consider a flash card as a device.

In the future, what you have to do is right-click on the drive the card is in and choose "Eject". The "Eject" option will not be on the list unless there is a flash card in there...

Also, in it's infinite wisdom MS put it RIGHT next to the "Format" item.

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: Windows "safely remove device" thingie
« Reply #12 on: April 14, 2007, 07:37:51 AM »
Also, in it's infinite wisdom MS put it RIGHT next to the "Format" item.
;D ;D ;D ;D ;D

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,666
    • View Profile
    • App's Apps
    • Read more about this member.
    • Donate to Member
Re: Windows "safely remove device" thingie
« Reply #13 on: April 14, 2007, 08:03:47 AM »
Inresting... Yeah, it's odd that they don't let you "safely remove" flash cards with that icon... I guess MS doesn't consider a flash card as a device.

It really shouldn't matter what MS thinks in this case, since they are not the manufacturers of the card readers.

You would think that somewhere in the driver/software packages that come with these readers, that there would be something that would pop a little icon in your tray for this purpose. This really should be part of the card reader software.

Since most of these card readers are usb devices, the icon for the safe removal of the reader is there...MS has done their job. It's the manufacturers of the readers that hasn't done theirs.

And I think it's very odd that not one card reader I have come across has this.

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,029
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: Windows "safely remove device" thingie
« Reply #14 on: April 14, 2007, 08:08:36 AM »
I think the issue is that card readers are seen as a removable drive - think floppy drive, zip drive, etc. You don't want to "unplug the drive", you want to "eject the disk".
- carpe noctem

Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,727
    • View Profile
    • Donate to Member
Re: Windows "safely remove device" thingie
« Reply #15 on: April 14, 2007, 11:23:19 AM »
Coming back to the 'remove device' icon, the 'unplug thingy'...
Some have said that, sometimes, Windows won't allow them to remove or unplug the device.
Well, it happens to me fairly frequently (at least twice a week) with my external hard drives.
I've tried everything : sysinternal handle app., closing all the opened programs, chosing the 'optimize for quick removal' option, etc.

What I now do -- when I don't want to sit for two hours in front of my laptop for Windows to finaly decide when it's safe to remove my device (!) -- is that I put my laptop in hibernation or standby mode, and  then remove the HDs: sometimes, just putting it IN and then OUT of standby will allow me to safely remove the device, but... *most of the time*, it won't, and I'll just remove the device while the computer is 'off'.

UNtil now, I haven't had any 'corruption' problems. But the fear of having to deal with that problem is still there.
What do you guys think off my workaround? Do you think filesystem cache would be flushed, and device being, hum, unmounted more cleanly ?  :)
Is it safer than just unplugging the damn external HDs while the computer is on ? I'd hope so... But.

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,029
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: Windows "safely remove device" thingie
« Reply #16 on: April 14, 2007, 11:32:26 AM »
Well, if you shut down your computer it's safe... I assume it's the same with hibernate.
- carpe noctem

Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,727
    • View Profile
    • Donate to Member
Re: Windows "safely remove device" thingie
« Reply #17 on: April 14, 2007, 11:40:39 AM »
Thanks, f0dder.
I thought Hibernate would be very similar to standby. Only suspending to disk instead of RAM.
So, if you believe that hibernating mode would be safe to unplug the devices, what about standby?

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,029
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: Windows "safely remove device" thingie
« Reply #18 on: April 14, 2007, 12:46:53 PM »
I should think so...

but when you need to do this "semi-forceful" removal, do run sysinternals' sync.exe. Shouldn't really be necessary when you do suspend/standby/whatever, I'm pretty sure windows does flush it's filesystem cache when you do that, but it doesn't hurt playing it as safe as you can.
- carpe noctem

Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,727
    • View Profile
    • Donate to Member
Re: Windows "safely remove device" thingie
« Reply #19 on: April 14, 2007, 03:16:59 PM »
Yup. Good advice.
Thanks.
So, that would be good news to all of us who suffer from that MS "bug" with the "unplug thingy":

1- Sync.exe,
2- than just go to standby mode, unplug,
3- and wake up your computer again.

Less than 20s. Problem approximately solved... I guess.


gjehle

  • Member
  • Joined in 2006
  • **
  • Posts: 286
  • lonesome linux warrior
    • View Profile
    • Open Source Corner
    • Read more about this member.
    • Donate to Member
Re: Windows "safely remove device" thingie
« Reply #20 on: April 14, 2007, 04:04:06 PM »
woah,
hibernation _could_ kill it, depending on how windows handles it.
if it's smart, it flushes the buffers, if not it just writes a ram-image to your harddrive (including the i/o buffers) and then shuts down
as already mentioned before, better play it safe ;)

Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,727
    • View Profile
    • Donate to Member
Re: Windows "safely remove device" thingie
« Reply #21 on: April 14, 2007, 04:10:33 PM »
if it's smart, it flushes the buffers [...] better play it safe ;)

Yup. Better play it safe.
AND I don't know *any other way to unplug my external device* in these cases... (Other than -- of course -- to actually wait for windows' capricious permission to finally allow me to unplug my HDs !)  :( 
You'd think MS would've solved these issues after all these years. Wonder if Vista solves it. Anybody ?


(edit : added the vista question)
« Last Edit: April 14, 2007, 04:12:46 PM by Armando »

ianmcc

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1
    • View Profile
    • Donate to Member
Re: Windows "safely remove device" thingie
« Reply #22 on: April 15, 2007, 04:49:04 AM »
Hi all,

This is my first post as I feel I should add my experiences to this discussion.

I have used all manner of USB drives over the last 3 years or so. I used a 20Gb Firefly USB drive for over 2 years, never using the "safely remove device" option.  I now use a laptop 160GB drive in a USB Caddy, and transport it between my work PC and Home PC every single day, again never using the "safely remove device" option.  I also us a USB Key, and Ipod and a Zune MP3 player.  I just cannot be bothered to use the "safely remove device" option and always just unplug the device.  For some reason I use the option when using the Ipod, although I am not really sure why!

Maybe I am just being lucky, but having worked in this manner for over 3 years, I am still to be covinced that the "safely remove device" option is really necessary.

Obviously you will all come to your own conclusion, but I just thought I would add my opinion to the discussion.


f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,029
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: Windows "safely remove device" thingie
« Reply #23 on: April 15, 2007, 08:54:29 AM »
Welcome aboard, ianmcc!

Quote
Maybe I am just being lucky, but having worked in this manner for over 3 years, I am still to be covinced that the "safely remove device" option is really necessary.
Yeah, you've been lucky :)

Your devices are probably set to "optimize for quick removal" (I think this is the default - at least I've usually had to set mine to "optimize for performance"). Also, if you unplug your device after there hasn't been disk access "for a bit", you're usually safe.

I still recommend using the safely remove hardware icon, though. One day you'll be unplugging a device at the wrong time, and that's not going to be nice. But okay, NTFS is pretty robust, so you'll most likely only lose the last few files you've been writing to, and filesystem metadata corruption can probably be repaired.

Sucks if the file destroyed is, say, the track database on an iPod.
- carpe noctem

mrainey

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 436
    • View Profile
    • Website
    • Donate to Member
Re: Windows "safely remove device" thingie
« Reply #24 on: April 15, 2007, 09:58:16 AM »
I've been lucky too, I guess.  I don't pay attention to the "thingy" at all.  What I do is watch the external device for apparent cessation of activity, count to ten, then unplug.  I've never had a problem.

Hibernation and system restore are both disabled, if that matters.
Software For Metalworking
http://closetolerancesoftware.com