ELi5: Why does pulling a USB drive out before you select “eject” matter?

643 views

ELi5: Why does pulling a USB drive out before you select “eject” matter?

In: 1

10 Answers

Anonymous 0 Comments

Answer: if in the chance data is still being accessed or written to the drive the data could be corrupted. If you eject it first, it makes sure any connection is stopped first to prevent that.

Anonymous 0 Comments

If the computer is in the middle of writing a file you’ll have data loss. If there is nothing active happening with the thumb drive then generally there isn’t a risk.

Anonymous 0 Comments

I believe if you are using [windows 10 or 11](https://www.theverge.com/2019/4/8/18300734/microsoft-safely-remove-eject-usb-flash-drive-not-needed-windows-10) you don’t need to eject. You need to eject on all macs because they use some sort of caching that still needs to be written to the drive and if you pull it without ejecting you may lose data

Anonymous 0 Comments

Your computer has an order it does things in, on occasion writing the data to the flash drive might not be what it immediately does when it is told to do that.

If you pull the drive out *without* ejecting it and this is the case you will either:

A: not write anything to the drive.

B: only partially write to the drive and make a corrupt file.

C: pull the current from it while it’s being read as a device and possibly damage a sector on the disk, possibly losing some data.

If you *eject* the disk the computer goes “oh I need to do this thing to something that needs to be removed, I better do that *now*” and will immediately write whatever data to the drive instead and then stop recognizing the drive to prevent damage as you unplug it.

Anonymous 0 Comments

It’s possible that changes are happening to the information on the USB drive.

If you innrupt it while it’s trying to rewrite a file, then the file can be total scrambled eggs.

If you innrupt it while it’s trying to update the address book (keys that tell what and where files are stored), then there’s no organization whatsoever to the drive, and all the files are essentially lost.

If, for some bizarre reason, the computer is trying to rewrite the actual script of the drive (the part that says ‘hey, I’m a USB drive, and this is what I do’), then it’s a complete disaster. The USB drive could no longer be a USB drive with that. Just a useless charm for your keychain.

For the *majority* of situations. It’s not that big of a deal to simply unplug a USB when you’re not actively using it. Most of the common problems regarding these issues have been engineered away. The computer will try working with the USB in such a way that an interruption will cause minimal damage.

But you definitely don’t want to unplug it while trying to load something from a USB, and absolutely not anytime during a save to the USB.

Unless… maybe you have a cheap USB you’re not afraid to break and a strong curiosity?

Nobody is stopping you from attempting an experiment. Perhaps find a very large resolution image online, something that may take a second or so to save to the USB. That would buy you enough time to yank it out mid-save.

Corrupt files, especially image files, can occasionally yield some [intriguing results](https://petapixel.com/2013/04/23/photographer-thankful-to-laptop-thief-for-new-creative-direction/). Although, a number of possible failsafes might prevent any meaningful outcomes.

At the very least, you can gain some first-hand intel towards answering your question.

At your own risk, I have to say. I’m sure your computer will be fine. I would do this to my own computer with confidence. It’s only the USB I’d worry about. Still, there can be a risk.

Anonymous 0 Comments

Computers “cheat” – to make things appear a lot faster than it is, they will claim things have been written to a disk when as a matter of fact, it’s not entirely so yet. Some operations are “pushed out”, sometimes seconds, sometimes minutes using a temporary storage in memory called “cache”.

On some OSes you can specify not to use a cache, but it will write to USB sticks appear slower. This is trust about the internal hard-drives too – it’s why you should not kill power to the computer but do a proper shutdown. Modern computers will survive this but you can lose data – in the really olden days, if you killed the power to the PC all of a sudden there were relatively good chances it wouldn’t boot again, have unrecoverable errors on the drive etc.

When you tell the system “I’m done with this” it flushes the cache and other tricks used to make the device appear faster than it is. Depending on the size of your system, speed of the USB and total amount of data you’ve pushed to the USB, it may take a little while for all the cache to be flushed – so you need to wait until the system says it’s ready. Old USB sticks are REALLY slow – and hence this delay can be long on those.

With all this said – if you’re not writing to the disk, ie. you’re reading data someone sent you, it really doesn’t matter. But it’s good having the habit of properly “ejecting/removing” the device using the OS’s software settings regardless – you never know. Worst case is data loss and in rare cases total loss of the content of the USB (let’s get rid of vFat as a shared format – PLEASE!).

Another issue is if you have something running in the background that uses the USB without you knowing it. Removing it suddenly can cause system hangs and other funny stuff this way – or if you’re lucky just a big crwhateverash of you had going. Picking the “remove device” properly tells the software to stop using it, and you avoid this kind of crazy error situation.

Anonymous 0 Comments

Pulling out a USB drive without ejecting it can result in data corruption or loss. Ejecting the drive allows the operating system to complete necessary tasks and ensure data integrity. It’s important to always eject USB drives to prevent potential issues.

Anonymous 0 Comments

If you have a very old OS (i.e., DOS), when your program asks the OS to save some data, the OS stops your program until it’s done saving the data.

Newer, more technologically sophisticated OS’s temporarily “sort-of-save” or “cache” the data in memory because it allows the program to be quickly un-blocked. This is very fast, but memory needs power to keep its data. So it’s only “sort-of-saved” and only becomes “properly permanently saved” when it gets to the disk, which takes a very long time.

If you abruptly cut power to the system or the disk, the “sort-of-saved” data might not get permanently saved. Worse, it might only be “partly saved”. When you try to read “partly saved” stuff later, you have bad problems: A program might not understand a “partly saved” file, or worse, the OS itself might not understand a “partly saved” filesystem (the OS bookkeeping that tells it what files are called, what folder they are in, and where their data is located).

Selecting “Eject” warns the OS that you are about to remove the drive, and it should permanently save everything. You shouldn’t take out the disk until the OS reports that you can safely do so (i.e. it’s finished saving everything that some program has requested to be permanently saved, fully updated its own bookkeeping, and started telling any program that wants to write more data “Sorry, that disk is no longer available”).

Of course it’s physically possible for you to remove a drive without ejecting it in the OS and waiting for the “all clear.” If you do this, any data you put on the disk within the last few minutes is at great risk. And all the data that’s on the disk is at medium risk. Sometimes it will come out OK, there is less risk if you’re writing small files (e.g. spreadsheets, documents, a few photos) and not large ones (videos, backups, large photo albums).

There’s always some risk if you don’t use the Eject button and then wait for the OS to tell you it’s OK to remove the disk, so everybody should do that.

Anonymous 0 Comments

Operating systems lie to you, they report a file was copied to external storage when in reality they silently transfer it in the background. When you “eject” the drive you a forcing it too copy any unfinished files thus getting the “device is busy” message. Remove it without ejecting properly and you risk having an empty/corrupt file. In most cases enough time has passed that all transfer tasks are complete so no data corruption occurs if removed improperly.

Anonymous 0 Comments

Imagine you are letter a letter on a piece of paper with a pen, then I yank that paper from you. If I’m lucky, I yanked it when your pen was raised from the paper, and I just end up with an incomplete letter. If I’m unlucky, I yanked it right when your pen was pressed down, and I end up with a big line through the page, ruining the letter. That’s you, yanking the USB drive out of the socket while Windows is trying to write data.

Now imagine I’m dictating to you what to write down. Naturally you can’t write as fast as I can talk, so you remember the last few words that I told you in your short-term memory, and use the gaps between sentences to catch up. But you never explicitly tell me you’re doing this, and you always catch up eventually so there’s no need for me to slow down, so what you’re doing is invisible to me. I’ll just assume that if I’ve finished dictating a sentence, then you’ve finished writing it down. But let’s say I finish a sentence then immediately yank the paper from you. The letter might be incomplete, but I didn’t know because you kept that hidden from me. Instead, I should tell you I want to take the paper, and wait for you to tell me it’s ok before I do. That’s Windows write caching, and safely removing the USB device.