ALWAYS close USB flash drive before removing?

E

Eddie

Do I always need to close or stop a USB flash drive before I remove
it?

I'm using XP. In XP's Device Manager there is an entry for Disk
Drives and when I look at the Policies tab for the flash drive, it
says:

"Optimized For Quick Removal. This setting enables
write caching on the disk and in Windows, so you can
disconnect this device without using the Safe Removal
icon."

My friends get upset if I don't use the Safe Removal process when
their USB memory is in my PC. Maybe they're repeating a mistake? Or
is there a reason which I'm missing that says I should always use
Safe Removal?
 
D

David Brown

Eddie said:
Do I always need to close or stop a USB flash drive before I remove
it?

I'm using XP. In XP's Device Manager there is an entry for Disk
Drives and when I look at the Policies tab for the flash drive, it
says:

"Optimized For Quick Removal. This setting enables
write caching on the disk and in Windows, so you can
disconnect this device without using the Safe Removal
icon."

My friends get upset if I don't use the Safe Removal process when
their USB memory is in my PC. Maybe they're repeating a mistake? Or
is there a reason which I'm missing that says I should always use
Safe Removal?

The main problem with removing USB drives without "safe removal" (or
umount on Linux) is that the OS could still have data in its write
buffers. If you remove the flash drive before the write is complete,
you will lose data, corrupting the file that is being written, and
possibly corrupting the FAT (and therefore lots more of the flash disk).

The "optimize for quick removal" makes windows save as little in the
write buffers as possible, minimising your risks, but you are still
risking data loss and file corruption. The other choice is to store
lots more in the write buffers - that makes the flash disk far faster
for writing, especially for writing lots of small files, but means
greater risk of corruption if you don't remove it safely.

So you should /always/ use safe removal, unless you haven't written
anything to the disk.
 
G

GT

Eddie said:
Do I always need to close or stop a USB flash drive before I remove
it?

I'm using XP. In XP's Device Manager there is an entry for Disk
Drives and when I look at the Policies tab for the flash drive, it
says:

"Optimized For Quick Removal. This setting enables
write caching on the disk and in Windows, so you can
disconnect this device without using the Safe Removal
icon."

My friends get upset if I don't use the Safe Removal process when
their USB memory is in my PC. Maybe they're repeating a mistake? Or
is there a reason which I'm missing that says I should always use
Safe Removal?

Windows doesn't always write immediately to a USB stick, but quickly caches
things and writes to the USB drive at its own speed (like a print queue) so
if you drag files across, then immediately remove the stick you might find
things missing or corrupted. If the stick has an LED, then you can tell when
its ready/finished.
 
A

Arno

Windows doesn't always write immediately to a USB stick, but quickly caches
things and writes to the USB drive at its own speed (like a print queue) so
if you drag files across, then immediately remove the stick you might find
things missing or corrupted. If the stick has an LED, then you can tell when
its ready/finished.

That is dangerous. It may delee or interrupt writes for a short
time due to other things. The only safe opton is to use safe
removal and o wait until windows says that the stick can be removed.

That said, if you have mostlysmall writes, just janking the stick
out oftnen works, but can also result in mor or less subtle data
corruption, up to an including loss of all data on the stick.

Arno
 
A

Arno

In comp.sys.ibm.pc.hardware.storage Eddie said:
Do I always need to close or stop a USB flash drive before I remove
it?
I'm using XP. In XP's Device Manager there is an entry for Disk
Drives and when I look at the Policies tab for the flash drive, it
says:
"Optimized For Quick Removal. This setting enables
write caching on the disk and in Windows, so you can
disconnect this device without using the Safe Removal
icon."

That is basically a lie by omission. You still need to
wait until all writes are complete. The difference is that
windows will try hard to write immediately, but a) writes
can take time and larger ones can take a lot of time
and b) some other things can still prevent windows to
write immediately. Often this works, but you may still
loose all data on the stick or get corruption if you trust
this statement.
My friends get upset if I don't use the Safe Removal process when
their USB memory is in my PC. Maybe they're repeating a mistake? Or
is there a reason which I'm missing that says I should always use
Safe Removal?

Your friends are right. There are some advanced journalling
filesystems that can reliably minimize corruption if you remove
an USB stick during a write, but Wndows is not using them
and neither FAT nor NTFS is safe to remove during a write.

Obviously a file tat is bing written during remmoval will
always have some corruption as result, there is no way around
that.

Arno
 
F

Flasherly

Do I always need to close or stop a USB flash drive before I remove
it?

Just remove it after done. Mine burnt out when I left it in -- end
LED light always flashed whether being written to not while it was
working.
 
E

Eddie

That is basically a lie by omission. You still need to
wait until all writes are complete. The difference is that
windows will try hard to write immediately, but a) writes
can take time and larger ones can take a lot of time
and b) some other things can still prevent windows to
write immediately. Often this works, but you may still
loose all data on the stick or get corruption if you trust
this statement.


Your friends are right. There are some advanced journalling
filesystems that can reliably minimize corruption if you remove
an USB stick during a write, but Wndows is not using them
and neither FAT nor NTFS is safe to remove during a write.

Obviously a file tat is bing written during remmoval will
always have some corruption as result, there is no way around
that.

Arno

Suppose I wait a few minutes after I moved a file to the flash
drive. Will the write cache be written out to the flash drive in
that period? Working like that is preferable because XP's Safe
Removal utility can be fiddly to launch.

I mean to ask, is it simply a matter of leaving ENOUGH TIME for the
write cache to be emptied by XP?

Or does the emptying of the write cache depend on OTHER FACTORS than
elapsed time?
 
A

Arno

In comp.sys.ibm.pc.hardware.storage Eddie said:
On 11:32 17 Nov 2009, Arno wrote:
Suppose I wait a few minutes after I moved a file to the flash
drive. Will the write cache be written out to the flash drive in
that period? Working like that is preferable because XP's Safe
Removal utility can be fiddly to launch.
I mean to ask, is it simply a matter of leaving ENOUGH TIME for the
write cache to be emptied by XP?

It is, but there is no reliable way to tell how much time is enough.
Or does the emptying of the write cache depend on OTHER FACTORS than
elapsed time?

The time the emptying takes can depend on other usage of the
filesystem, for example. Say you have a large weite request
that has aged in the background and reached the "must flush"
timeout, than that will be written before the USB stick is.

There are other conditions that can delay writing.

The problem is that there is no way to tell from the outside
and you will get corruption if you remove in the wrong Moment.
That said, it typically (low I/O load, no large writes, no
high CPU/hogh memory load tasks) works.

Arno
 
R

Rod Speed

David said:
The main problem with removing USB drives without "safe removal" (or
umount on Linux) is that the OS could still have data in its write
buffers. If you remove the flash drive before the write is complete,
you will lose data, corrupting the file that is being written, and
possibly corrupting the FAT (and therefore lots more of the flash
disk).
The "optimize for quick removal" makes windows save as little in the
write buffers as possible, minimising your risks, but you are still
risking data loss and file corruption. The other choice is to store
lots more in the write buffers - that makes the flash disk far faster
for writing, especially for writing lots of small files, but means
greater risk of corruption if you don't remove it safely.
So you should /always/ use safe removal, unless you haven't written anything to the disk.

Thats just plain wrong. If you have it optimized for quick removal and its
been a while since the write, its fine to unplug it without safe removal.
 
D

David W. Hodgins

Or does the emptying of the write cache depend on OTHER FACTORS than
elapsed time?

Suppose the antivirus program is downloading a large update, that
you are not yet aware of. The writes to the flash drive may, or
may not be completed quickly. The only way to be sure, is to use
the remove safely option.

The only time it's guaranteed to be safe without that, is if you
haven't written anything to the drive. Your friend is correct
that you should always use the safely remove. Even if 99% of the
time it works ok without it, it's his drive that could effectively
be erased due to fat corruption.

Also, using the "Optimized For Quick Removal" option increases the
number of small writes to the drive, which will speed up the wearing
out of the drive. Flash drives have a limited number of writes.

Regards, Dave Hodgins
 
D

David Brown

Rod said:
Thats just plain wrong. If you have it optimized for quick removal
and its been a while since the write, its fine to unplug it without
safe removal.

That is true, but how long is "a while"? It is highly dependent on the
size of the write(s), the type of flash disk, and the speed of the
transfer. Some flash disks have an LED or an indicator of some sort
that can help, but most don't.

Given the O/P's question, I think it's safer to recommend always using
safe removal, even if it is a little more paranoid than "use safe
removal or wait a while".
 
D

David Brown

Eddie said:
Suppose I wait a few minutes after I moved a file to the flash
drive. Will the write cache be written out to the flash drive in
that period? Working like that is preferable because XP's Safe
Removal utility can be fiddly to launch.

What do you mean, "fiddly to launch"? Unless you have done something
unusual to your XP setup, there's a little icon in the notification area
of the taskbar with a green arrow on it. Left click it, and choose the
usb drive you want to "safely remove". If windows keeps "helpfully"
hiding it, you can change the taskbar properties to turn off hiding of
unused icons.
I mean to ask, is it simply a matter of leaving ENOUGH TIME for the
write cache to be emptied by XP?

Or does the emptying of the write cache depend on OTHER FACTORS than
elapsed time?

It is basically a matter of time. The problem is that there is no
reliable way to tell how long you have to wait. Often it is only a very
short time, but it could be longer.

It is also possible that applications that have files open on the disk
will not take kindly to a sudden removal. That would only apply to
programs that are using it (and things like music players or photo
gallery applications might well try to use the flash disk without your
realising it), and I've no idea how it might affect them. But it is
safer to be "polite" and "safely remove" your disk.
 
R

Rod Speed

David Brown wrote
Rod Speed wrote
That is true, but how long is "a while"?

Irrelevant to your stupid /always/ claim.
It is highly dependent on the size of the write(s), the type of flash disk, and the speed of the transfer.

Not in the real world.
Some flash disks have an LED or an indicator of some sort that can help, but most don't.

Another pig ignorant lie.
Given the O/P's question, I think it's safer to recommend always using safe removal,

More fool you.
even if it is a little more paranoid than "use safe removal or wait a while".

A hell of a lot more mindlessly paranoid, actually.
 
R

Rod Speed

David said:
What do you mean, "fiddly to launch"? Unless you have done something
unusual to your XP setup, there's a little icon in the notification
area of the taskbar with a green arrow on it. Left click it, and
choose the usb drive you want to "safely remove". If windows keeps
"helpfully" hiding it, you can change the taskbar properties to turn
off hiding of unused icons.


It is basically a matter of time. The problem is that there is no
reliable way to tell how long you have to wait. Often it is only a
very short time, but it could be longer.

Not much longer.
It is also possible that applications that have files open on the disk
will not take kindly to a sudden removal. That would only apply to
programs that are using it (and things like music players or photo
gallery applications might well try to use the flash disk without your
realising it), and I've no idea how it might affect them.

No problem at all in fact.
But it is safer to be "polite" and "safely remove" your disk.

So you always wear a belt and braces so you dont end up exposing yourself ?
 
E

Eddie

All safe removal really does is wait to tell you it can be
removed if the buffer is not written out yet.

You say "All safe removal really does is wait to tell you it can
be removed if the buffer is not written out yet."

I thought the Safe Removal window actually *forced* the data to
be flushed out of the write cache?

Are you saying it is just a way of making the user wait until
flushing is done (but not start flushing any sooner)?
As for the optimized for quick removal setting, in use the
main difference is that this keeps the "copying..." visual
indicator window on screen until the copying is done, while
if you chose the other option the copying indicator window
will finish suggesting the copying is finished while all
that is necessarily done is all the data to be copied is now
in the windows buffer.

While writes can be delayed it is not by much, it would take
a fairly heavy use of the system to really delay by more
than the physical write speed and USB bus limitations cause.

IF your drive access LED works properly and you are familiar
with it, you can judge when writing is done by simply
observing several seconds of no activity, but certainly the
safest is to use the safely remove hardware feature.

The best thing to do is just respect your friend's wishes
and use it, regardless of whether it really matters... you
can't spend your life arguing with or educating people about
every little thing... and some of them will get offended.

Many times Safe Removal window says something like operatiom
failed to stop the drive or adaptor. Repeated tries don't seem to
improve this.
 
D

David Brown

kony said:
Several seconds with no I/O indicated.



None of these are a factor as you aren't timing it then
guessing when it's done. The two indictors when caching is
disabled are that the copy or move dialog window has
finished and the LED has remained indicative of no further
I/O.

That's true enough. The copy/move box is a fairly good indicator, if
all the caching is disabled - the final flushing to disk should be
finished within a couple of seconds of the box closing.

I'm not suggesting it is not generally safe to remove the disk a few
seconds after you expect the copy to be finished - in the great majority
of cases, it /is/ safe. I'm simply saying that there are circumstances
that could make it unsafe. Perhaps /you/ have write caching disabled
and "optimise for quick removal", but not everyone does - it is not
uncommon to use a flash disk to files from someone else's machine.

Using "safe removal" is a good habit, works everywhere, costs nothing,
and avoids accidents on the rare occasions when there might be extra
delays. This is advice to the OP (and others) who would like a nice
general rule. Those who know what they are doing will obviously use
"safe removal" as and when they see fit.
Most do have an LED and the only one I'd ever buy that
didn't, only lacks one because it sacrifices everything to
be very tiny. So yes there is a complication without an
LED, but if someone wants the ability to visually see when
I/O has stopped, the LED is a desirable feature to seek at
time of product selection.

I agree that an LED is nice, but in practice I have seen very few flash
sticks with one. Cost is the main reason few sticks have an LED, rather
than size, but either way they are rare in my experience. You certainly
can't rely on having one on your "average" stick.
Safer yes, but since data with any value should never be
kept on only one storage medium, the risk isn't much to be
concerned about.

While you and I know that, there are lots of users who never seem to
understand about backups and extra copies of data. It is certainly not
uncommon for "average" users to copy files to a flash stick as their
only backup. Thus the good rule of thumb for "average" users is the
extra safe one of always using "safe removal".
 
A

Arno

In comp.sys.ibm.pc.hardware.storage kony said:
On Tue, 17 Nov 2009 13:30:10 -0500, "David W. Hodgins"
BUT, are you really, REALLY sure? Or are you only placing
confidence in windows doing what it is supposed to do? It's
that a bit of the same thing as assuming the drive LED
access indicator is doing what it is supposed to do?

Windows will tell you that it is safe to remove the drive only
after it has a) written all buffered data and b) blocked the
device so no new writes can happen. In the absence of a programming
error, this is reliable.
Some days I'd trust an LED hard wired to a chip not running
windows, more than windows itself. ;)

For the sake of argument, let's assume that 99% is a
fictional number and count the ways that a pending write
could be cached still but the user unaware of this.
1) User is unfamiliar with the specific flash drive,
doesn't know what the blinking LED means.
2) Owner didn't pick a drive that has an LED to indicate
I/O or didn't wait a few seconds to be sure there was no
activity.
3) Owner never looked at the LED to confirm it works
properly, there's always that one drive in the whole case
that might be defective.

Well, a defective flash drive may lead to corrutpion anywaus.
And this is a real problem: I have had two defective ones, one
in a long therm overwrite experiment and one as a recovery
boot medium and both have had silent corruption of data, i.e.
no error message at all. This measn their reliability is
significantly below that of a floppy disk.

I currently have a second drive in the torture chair and
will do a writeuo if that gets silent corruption as well.
It's not worth considering. You won't wear out a USB flash
drive making backups or moving files around until long after
it's viable lifespan is over. Not even close.

In ordinary use no. I have tortured one Kingston 2GB drive
to death, which took about 3400 complete overwrites or
in the order of a month of continued writing. The problem
was that it then gave wrong data but no error messages. Seems
there is no CRC in these devices or it is switched off.

Arno
 
M

Man-wai Chang to The Door (28800bps)

My friends get upset if I don't use the Safe Removal process when
their USB memory is in my PC. Maybe they're repeating a mistake? Or
is there a reason which I'm missing that says I should always use
Safe Removal?

Follow standard procedure. :)

--
@~@ Might, Courage, Vision, SINCERITY.
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (x86_64 Ubuntu 9.10) Linux 2.6.31.6
^ ^ 20:41:01 up 5 days 9:46 1 user load average: 1.00 1.02 1.00
ä¸å€Ÿè²¸! ä¸è©é¨™! ä¸æ´äº¤! ä¸æ‰“交! ä¸æ‰“劫! ä¸è‡ªæ®º! è«‹è€ƒæ…®ç¶œæ´ (CSSA):
http://www.swd.gov.hk/tc/index/site_pubsvc/page_socsecu/sub_addressesa
 
R

Rod Speed

Eddie wrote
kony wrote
You say "All safe removal really does is wait to tell you
it can be removed if the buffer is not written out yet."
I thought the Safe Removal window actually *forced*
the data to be flushed out of the write cache?

It does both.
Are you saying it is just a way of making the user wait
until flushing is done (but not start flushing any sooner)?

If that is what he is saying, he is wrong.
Many times Safe Removal window says something like operatiom
failed to stop the drive or adaptor. Repeated tries don't seem to
improve this.

On one system I do occasionally get it saying that it cant currently be removed and another go allows it to be removed.

It never keeps saying that it cant be removed.

And I use that system every couple of days.
 
R

Rod Speed

David said:
That's true enough. The copy/move box is a fairly good indicator, if
all the caching is disabled - the final flushing to disk should be
finished within a couple of seconds of the box closing.

I'm not suggesting it is not generally safe to remove the disk a few
seconds after you expect the copy to be finished - in the great
majority of cases, it /is/ safe. I'm simply saying that there are
circumstances that could make it unsafe. Perhaps /you/ have write
caching disabled and "optimise for quick removal", but not everyone
does - it is not uncommon to use a flash disk to files from someone
else's machine.
Using "safe removal" is a good habit, works everywhere, costs nothing,
and avoids accidents on the rare occasions when there might be extra
delays. This is advice to the OP (and others) who would like a nice
general rule. Those who know what they are doing will obviously use
"safe removal" as and when they see fit.
I agree that an LED is nice, but in practice I have seen very few flash sticks with one.

Then you need to get out more. Most of us get the exact
opposite effect, very few flash sticks that dont have one.
Cost is the main reason few sticks have an LED, rather than size, but either way they are rare in my experience.

Then you need to get out more. Most of us get the exact
opposite effect, very few flash sticks that dont have one.
You certainly can't rely on having one on your "average" stick.

You dont need to 'rely' on anything, just do it differently if there is no led.
While you and I know that, there are lots of users who never seem to
understand about backups and extra copies of data. It is certainly
not uncommon for "average" users to copy files to a flash stick as
their only backup. Thus the good rule of thumb for "average" users
is the extra safe one of always using "safe removal".

Nothing like your original stupidity.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top