Slashdot Mirror


Slashdot Asks: Do You Need To Properly Eject a USB Drive Before Yanking it Out? (daringfireball.net)

In a story earlier this week, Popular Science magazine explored an age-old topic: Do people need to safely eject a USB stick before they pull it from their computer? The magazine's take on it -- which is, as soon any ongoing transfer of files is complete, it is safe to yank out the flash drive -- has unsurprisingly stirred a debate. Here's what the magazine wrote: But do you really need to eject a thumb drive the right way? Probably not. Just wait for it to finish copying your data, give it a few seconds, then yank. To be on the cautious side, be more conservative with external hard drives, especially the old ones that actually spin. That's not the official procedure, nor the most conservative approach. And in a worst-case scenario, you risk corrupting a file or -- even more unlikely -- the entire storage device. To justify its rationale, the magazine has cited a number of computer science professors. In the same story, however, a director of product marketing at SanDisk made a case for why people should probably safely eject the device. He said, "Failure to safely eject the drive may potentially damage the data due to processes happening in the system background that are unseen to the user."

John Gruber of DaringFireball (where we originally spotted the story), makes a case for why users should safely eject the device before pulling it out: This is terrible advice. It's akin to saying you probably don't need to wear a seat belt because it's unlikely anything bad will happen. Imagine a few dozen people saying they drive without a seat belt every day and nothing's ever gone wrong, so it must be OK. (The breakdown in this analogy is that with seat belts, you know instantly when you need to be wearing one. With USB drives, you might not discover for months or years that you've got a corrupt file that was only partially written to disk when you yanked the drive.)

I see a bunch of "just pull out the drive and not worry about it" Mac users on Twitter celebrating this article, and I don't get it. On the Mac you have to do something on screen when you eject a drive. Either you properly eject it before unplugging the drive -- one click in the Finder sidebar -- or you need to dismiss the alert you'll get about having removed a drive that wasn't properly ejected. Why not take the course of action that guarantees data integrity?
What are your thoughts on this? Do you think the answer varies across different file systems and operating systems?

311 of 521 comments (clear)

  1. yes, by Anonymous Coward · · Score: 5, Funny

    one should always eject before pulling out

    1. Re: yes, by Anonymous Coward · · Score: 3, Insightful

      And what mount options. And what filesystem. And how busy the OS is and it's settings.

      There are so many exceptions its best to just say always eject first. If you don't you are needlessly putting your data at risk.

    2. Re: yes, by Anonymous Coward · · Score: 1

      I've lost files to corruption after doing backups on a flash drive and removing the drive without ejecting. On Linux. Once I started ejecting, no more problems. It's a good best practice to always use eject.

    3. Re:yes, by Anonymous Coward · · Score: 5, Funny

      one should always eject before pulling out

      Also remember to use protection against virus

    4. Re: yes, by Anonymous Coward · · Score: 2, Informative

      That's just not true, there is a configurable timeout for this, 30 seconds by default.
      See vm.dirty_expire_centisecs.
      Some distros set a lower value or even mount removable drives sync, but that does cost performance.

    5. Re: yes, by Aighearach · · Score: 4, Insightful

      Horse shit.

      I don't give a rat's ass what the drive is doing when you remove it. If you want to plug it into a Pentax camera without having to reformat it first, you'll eject or unmount the drive before removal.

      Lots of other devices have this same problem. The drive records if it was properly ejected or not. You have to know for sure if you want the ability to use it with any compatible device on the next insert, or if you want to have to risk needing to re-insert it, and then eject, so that your device will trust you that the drive is in a known-good state.

      It is not enough to know what the drive is doing "at the time," you have to know what the drive will be doing in the future too.

    6. Re: yes, by dotgain · · Score: 2

      There's some truth to it, even a completely idle system seems to delay writing. Try it yourself: mount a USB stick, and copy some stuff to it. The LED on the flash stick often doesn't even start blinking until you issue the command to eject, when it finally starts writing.

    7. Re: yes, by Narcocide · · Score: 2

      It wasn't initially such a big problem until they changed the default behavior of write-back caching for such devices. Now days, it's best to sync && eject first. The chances of not everything finishing otherwise are higher the more data has been written to the device recently.

    8. Re: yes, by c6gunner · · Score: 4, Informative

      The drive records if it was properly ejected or not.

      No, it doesn't. The filesystem on the drive might, though, depending on which filesystem it's formatted with.

      This used to be an issue with many Linux distributions and NTFS in the past. If you tried to mount an NTFS filesystem which wasn't cleanly dismounted, it would throw an error at you and fail. For other filesystems it didn't matter.

    9. Re: yes, by stealth_finger · · Score: 1

      Only numbskulls ask this. There is no one yes or no answer. It depends on what the drive is doing at the time.

      Isn't that the point? You don't know what it's doing so just stop it.

      --
      Wanna buy a shirt?
      https://www.redbubble.com/people/stealthfinger/shop?asc=u
    10. Re:yes, by zwarte+piet · · Score: 1

      Ejecting right after pulling out is what we do here. Now get of my lawn!

    11. Re: yes, by zifn4b · · Score: 2

      Or just turn off write caching for USB devices. In fact, it's off by default in Microsoft Windows. There are two options for USB devices, Quick Removal (default) and Better Performance (write caching). More information.

      --
      We'll make great pets
    12. Re: yes, by oldmac31310 · · Score: 1

      nowadays.

      --
      http://www.acetonestudio.com
    13. Re: yes, by TheFakeTimCook · · Score: 1

      Or just turn off write caching for USB devices. In fact, it's off by default in Microsoft Windows. There are two options for USB devices, Quick Removal (default) and Better Performance (write caching). More information.

      That explains why it doesn't seem to matter with Windows; but at least earlier (up to at least 10.7) versions of OS X/macOS, you took a great risk just yanking removable storage (USB Sticks and USB HDDs) without "Ejecting" first.

      They MAY have fixed that behavior in later versions; but, having personally corrupted a USB HDD that way, I still feel better safe than sorry...

    14. Re:yes, by kelemvor4 · · Score: 1

      one should always eject before pulling out

      You are doing it backwards. You're supposed to pull out before ejecting.

    15. Re: yes, by zifn4b · · Score: 1

      Well, that's your fault for being an Apple user that doesn't know how computers should work

      This is and has always been the problem with generally available consumer *nix. OSX is based on NeXTSTEP Mach kernel + BSD btw. The expectation "use should be expected to know how computers should work" is the reason why Microsoft Windows has prevailed to this day as the majority market share of desktop operating systems. They don't expect that. Sad but true.

      --
      We'll make great pets
    16. Re: yes, by c6gunner · · Score: 1

      I'm aware of that. I don't actually eject anything in Linux because hitting my shortcut keys to open a terminal and then typing "sync" is much easier than grabbing for the mouse and clicking a bunch of locations to find the eject button. I was just pointing out that the particular issue he was describing is filesystem dependant. Of course any filesystem can experience corruption if you don't eject or sync before disconnecting, but only some of them actually "know" that there's a problem.

    17. Re: yes, by Aighearach · · Score: 1

      As the user you don't get to choose the filesystem type. If you reformat it to NTFS, your device will need to reformat it back to exfat for it to work again.

    18. Re: yes, by Aighearach · · Score: 1

      1) sync doesn't help the problem I described, that you didn't understand. Just for giggles I tested it and sure enough, the camera complains, "card not formatted."
      2) you can umount from the cli very quickly, even quicker if you have a fstab entry, and quicker still if you make an alias.

      There is no way around the fact that you have to know what you're going to do with it in the future to know if it needs to be properly unmounted, or not. If you know for sure that you're the one using it, and that it works with your devices even if not properly unmounted, then it won't hurt you to do it. But that doesn't mean you know it won't hurt anybody else.

      If somebody listens to your advice, they might find themselves out in the field with data they can't access until they go home, mount the drive, and unmount it again.

  2. Dont ask this on slashdot... by Anonymous Coward · · Score: 1, Insightful

    ask it in a Mac-Forum, with the question, how to disable the requester that pops up... much more fun...

  3. Depends. by msauve · · Score: 5, Informative

    No mention of the OS or file system. Assuming Windows - there's a setting for "Quick Removal," which disables write caching and makes it so "you can disconnect the device safely", and another for "Better Performance," which doesn't and may cause grief.

    --
    "National Security is the chief cause of national insecurity." - Celine's First Law
    1. Re:Depends. by BenFranske · · Score: 4, Informative

      This is true. My recollection is also that somewhere along the line Microsoft changed the default in Windows. Traditionally in Windows all mass storage devices, think HDDs, had performance enhancing features such as caching turned on which can cause delayed writes while media like floppies had it turned off. The problem is that when USB 2 came out and USB mass storage became feasible people started unplugging USB drives as soon as the copy appeared to be finished even if the OS was really still writing to the drive in the background causing a potential for data corruption. In this era we were teaching everyone to eject USB drives before removing as that would force a clearing of the write cache before giving the OK to remove the drive.

      Somewhere along the line (maybe Windows Vista?) it became apparent that the clumsy drive eject mechanism in Windows, combined with users frequently forgetting to do it, and the increasing popularity of flash drives made this a usability issue. At that point Microsoft changed how Windows handles USB attached mass storage devices and disabled or modified the performance features to flush the write cache as quickly as possible and keep copy dialogs on screen until the files were actually fully copied. At the same time a lot of flash drive manufacturers started putting access indicator LEDs on the drives so you could tell if the drive was being accessed. After this most Windows users stopped ejecting drives before removal and save for an especially odd case there seems to have been little data corruption which can be traced back to not ejecting the drive.

    2. Re:Depends. by Spazmania · · Score: 1, Interesting

      If your operating system was programmed well, the IO call writing to the USB drive would not return until all write buffers were flushed, would not permit large write buffers to a USB drive -and- nothing else would attempt to write the USB drive in the background.

      Your operating system was not programmed well. Quick Removal only gets close.

      --
      Moderating "-1, Disagree" is simple censorship. Have the guts to post your opinion.
    3. Re: Depends. by RaviBrounstein · · Score: 1

      If you are using encrypted media and just unplug you usually blow out your FAT

    4. Re:Depends. by dinfinity · · Score: 2

      I can't help but think there is a a simple interaction (and possibly partly technical) solution to this:
      Just indicate whether write buffers are definitely empty for a certain drive and ejection can be done safely if no other writes are started (an orange indicator next to the ejectable, for instance). It is silly that putting in a USB drive and yanking it out almost immediately is regarded as unsafe ejection or bad practice.

      I understand that theoretically another process can initiate a write as you are yanking it out, but in the vast majority of cases that doesn't happen and the user is very aware of what they're doing to the USB drive. Generally, people plug in a USB drive, actively read some stuff off it and write some stuff to it and are then done with I/O with the device. No background processes writing to the USB drive should be involved in those cases.

      Sure, provide the option to unmount (and turn the indicator green) for the peeps who want to be absolutely sure, but otherwise the 'orange' state more than suffices.

    5. Re:Depends. by willy_me · · Score: 5, Insightful

      Plenty of things could still go wrong. There is simply no guarantee that the OS will not be writing to the FAT due to some background process. Pull the drive at the wrong time and you corrupt the FAT. If one uses a journaling file system, yanking the drive becomes more feasible - but is still not a good idea.

    6. Re:Depends. by WatchMaster · · Score: 3

      I always format usb drives as NTFS because it is more damage-resistant than FAT32. Not immune, but more resistant to several types of errors due to journaling.

    7. Re: Depends. by Anonymous Coward · · Score: 1

      Hotplug and hotswap doesn't mean you should be able to remove a device whenever you want. It only means you don't have to power down the device.

    8. Re:Depends. by thegarbz · · Score: 5, Informative

      My recollection is also that somewhere along the line Microsoft changed the default in Windows.

      Yes, almost 17 years ago they changed that default. Windows hasn't enabled caching and the likes on removable drives since the release of Windows XP.

      The only benefit you get of the safely remove feature is that windows won't let you remove the drive if it is actively being written to. But either way you will know instantly if you end up with a corrupted file if you don't safely remove as you'll get an error message for whatever program was writing.

      Mr Gruber's scenario of hidden corruption just isn't a thing.

    9. Re:Depends. by Darinbob · · Score: 1

      For every OS, you need to do this safely. The USB drive may be in the middle of erasing a page, copying data, etc. If it's removed accidentally, well then maybe you're safe. But to do this on purpose is foolish.

    10. Re:Depends. by Joce640k · · Score: 4, Interesting

      I remember back in the 1980s when the Commodore Amiga used to say:

      "You MUST put the floppy disk back in or data loss could occur".

      (or something like that)

      If only modern operating systems had such technology.

      --
      No sig today...
    11. Re:Depends. by Joce640k · · Score: 2

      Maybe true, but...

      If you just yank it, the next time you want to use it you'll have to go through "The file system on this disk may be corrupt, do you want to run CHKDSK on it" followed by several dialog boxes that need clicking.

      Your idiotic "I'm going to yank it anyway" attitude just makes things worse in the long run.

      --
      No sig today...
    12. Re:Depends. by arth1 · · Score: 1

      But either way you will know instantly if you end up with a corrupted file if you don't safely remove as you'll get an error message for whatever program was writing.

      Most modern programs aren't made for power users, and tend to not present errors that a user cannot be expected to understand the impact of or do anything about. If a background file that you yourself didn't create cannot be written to, for example, chances are that you'll see nothing. There may be a log message in a different file which you also don't know or care about.

    13. Re:Depends. by Anonymous Coward · · Score: 1

      Was the Amiga able to sense a floppy is in the drive? PC floppies can't - the floppy controller doesn't even know if the drive is present or not, so if you disconnected your floppy drive (or the BIOS wrongly said there's one) you got a ghost drive in Windows.

      If only modern operating systems had such technology.

      They seem decent at warning that writes are ongoing on USB media

    14. Re: Depends. by Bing+Tsher+E · · Score: 2

      I remember when, on a Mac Plus, especially one with just one floppy drive, you could become subject to floppy-swapping hell. On an old mac, with that really derpy-stupid sound the drive made while ejecting the floppy, this could be a maddening experience. An example would be trying to run Microsoft Word off a floppy after booting the Mac system off another floppy. Triple down if you're wanting to edit a Word document on a third floppy.

    15. Re: Depends. by Anonymous Coward · · Score: 2, Insightful

      Half the time I try to eject a USB drive in Windows it just says no and gives no reason...I yank it. It works fine next time. No problem. Windows is retarded, don't listen to it.

    16. Re:Depends. by 93+Escort+Wagon · · Score: 1

      The only benefit you get of the safely remove feature is that windows won't let you remove the drive if it is actively being written to.

      No, it tells you after the fact “you shouldn’t have done that”, which is something quite different than not letting you do it in the first place.

      --
      #DeleteChrome
    17. Re:Depends. by Drethon · · Score: 1

      Some encrypted USB drives have minor problems with being ejected. I think they have some sort of session information that gets closed out when ejected possibly. Never had this cause major issues with the drive, just leads to windows wanting to disk check it every time I block the drive in after failing to eject it.

    18. Re:Depends. by Anonymous Coward · · Score: 1

      If your operating system was programmed well, the IO call writing to the USB drive would not return until all write buffers were flushed

      Do you have an idea what the word "buffer" means?

    19. Re:Depends. by arth1 · · Score: 1, Informative

      They seem decent at warning that writes are ongoing on USB media

      A problem here is that the USB devices themselves are lying, in part because the manufacturers want to sell them as really fast devices, because the consumers look at that. So buffering is cranked up, and the controllers lie, horribly.
      When the drive tells the OS that yes, everything is committed, it may still be in the controller buffer and not really written. So if you yank out the drive immediately after the OS says it's all done, you can get errors or missing data. And that's not the fault of the OS.

    20. Re:Depends. by thegarbz · · Score: 1

      followed by several dialog boxes that need clicking

      Err no. I haven't unmounted a disk in a good 10 years and the only time I ever see that message is drives that I then play with in Linux.

    21. Re:Depends. by thegarbz · · Score: 2

      No, it tells you after the fact “you shouldn’t have done that”, which is something quite different than not letting you do it in the first place.

      Err no it tells you before the fact and then doesn't proceed:

      "Problems Ejecting #########. Windows is unable to stop the device ########. Don't remove this device whilit is still in use. Close any programs using this device and then remove it."

      (And because it's a safe operation I just did it mid copy right now so I could post this error message here verbatim to let you know how wrong you are). Please don't speak so authoritatively on something so easily disproven.

    22. Re:Depends. by jellomizer · · Score: 1

      It really is the same for floppy disk or cassette tape.
      The key difference is with speed and caching.
      The old 8 bit systems for one didn’t multi task. So while the light was blinking then the program was writing to the disk when it stopped and you were at the prompt then it safe to take the disk out.

      When we have multitasking then the storage write may be interrupted with an other process, then we also have memory cashing which means the task thinks things are done while the os takes it time to save.

      On modern computers this is often very quick faster then you can react. However if your pc is sluggish then you really should wait for the os to confirm it is done.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    23. Re:Depends. by Aighearach · · Score: 1

      When you say "PC floppy," are you talking about IBM brand floppy drives, or something else?

      You may find the term doesn't carry the meaning you think it does.

    24. Re:Depends. by Aighearach · · Score: 1

      I don't care if my DSLR is naive or not, I just want it to accept the storage media and save pictures to it. I don't care if I "should have to" unmount properly; that isn't a feature that is going to drive my purchase of a camera or other device, so it doesn't get to have important pedanticisms. The fact is, if it isn't properly unmounted, and it is plugged into a device that is not a general purpose computer, it might not work. If you're sure it works in all your devices, then you don't have to care, but there isn't a general answer about not caring that is actually useful.

    25. Re:Depends. by jrumney · · Score: 1

      This is only true if it is the OS that is still writing. If all the data has already been written to the USB drive's cache, and it is the USB drives internal wear levelling that still hasn't finished, you're screwed.

    26. Re:Depends. by Spazmania · · Score: 2

      Do you?

      The buffer is where the data sits while waiting for the receiver to finish receiving and accept it. The write() call can return immediately while the OS sends data from the buffer in the background. The write call can block until the OS finishes sending data from the buffer. Either way there's a buffer that holds the data being sent until the OS is done with it.

      --
      Moderating "-1, Disagree" is simple censorship. Have the guts to post your opinion.
    27. Re: Depends. by c6gunner · · Score: 3, Informative

      If by "very old" you mean Windows 7, and by "odd FS choice" you mean FAT32 and NTFS, then yeah, sure.

      I get that message all the time on the work computers because nobody ever bothers properly dismounting the damn flash drives.

    28. Re:Depends. by tlhIngan · · Score: 1

      Mr Gruber's scenario of hidden corruption just isn't a thing.

      It can be.

      On Windows, where the default is Quick Removal, what happens is Windows disables write caching internally and doesn't let WriteFile() or Close() return until all the data buffers have been committed down to the media. This means when an application writes, the calls block (or the async I/O object is not signalled) until Windows is satisfied that it has pushed every byte of data down to the media. For USB devices, this means it sets the "Force Media Access" bit which tells the device to actually commit the data to the media. But, Windows assumes when the USB device replies, it's done (assuming no write caching done hidden from Windows). Windows is correct that as far as it can tell, it's done its job - the data has been pushed to hardware.

      But as anyone can tell you, Windows 98 had a fatal bug where new PCs would shut down so quickly that despite Windows flushing all the caches, it would still shut down faster than the disks would finish flushing their caches to disk.

      Similarly, if you know how SSDs work, you may want to wait a couple of seconds after the write completes so the controller can flush out the updated tables to media. Not doing so risks the controller tables being corrupted and drive nonfunctional, or the file being corrupted because of incorrect indices.

      Finally, a bad Windows app can cause extensive wear on removable media because of this - if you write a small buffer, that buffer will go to media. If it writes another small buffer, then it forces another write

      And on Linux and macOS, it's somewhat essential, since those OSes still enable write-back caching. Yanking the drive before unmounting will result in corrupt files or a corrupt filesystem.

    29. Re:Depends. by Joce640k · · Score: 1

      When does the OS say "all done"?

      --
      No sig today...
    30. Re:Depends. by Joce640k · · Score: 1

      Was the Amiga able to sense a floppy is in the drive?

      Yes, they managed to dedicate a whole I/O pin to that.

      http://amigadev.elowar.com/rea...

      --
      No sig today...
    31. Re:Depends. by thegarbz · · Score: 1

      Yes but all of that is completely irrelevant to the discussion since safely remove device does not take that into account.

    32. Re:Depends. by thegarbz · · Score: 1

      And you'll still be screwed after the device is safely removed. By the way the internal cache of the USB stick is tiny. We're talking milliseconds for this process to finish.

    33. Re:Depends. by Cederic · · Score: 1

      Sorry, where would this orange indicator be?

      Is this a physical indicator? I can't see the USB ports I attach devices to, they're behind a monitor. The cables are what I use. I don't look at the cable or device either.

      If it's a software indicator it's even less useful. I don't have any software consistently open in which such an indicator could be displayed. If I want to guarantee write buffers are cleared I have to open a new window and find the 'eject' option.

      I should really learn the console command for that. hmm. Ok, that's less straightforward than I'd hoped.

    34. Re: Depends. by Joce640k · · Score: 1

      Rubbish, I get it quite often (Windows 7).

      There's entire web pages dedicated to this, eg.:

      https://www.sevenforums.com/tu...

      --
      No sig today...
    35. Re:Depends. by Wrath0fb0b · · Score: 1

      If your operating system was programmed well, the IO call writing to the USB drive would not return until all write buffers were flushed, would not permit large write buffers to a USB drive -and- nothing else would attempt to write the USB drive in the background.

      It's not a matter of 'programmed well', it's a matter of which sync/ordering semantics are specified and documented. Your claim is similar to saying that a hot dog is not cooked well because it's not an omelette.

      Filesystems are generally specified as being async/non-atomic (modulo some syscalls like sync/fsync) and so well-written userland code will assume this. If you want different semantics, you can specify others -- there is a sync option in fstab, and various journaling/cache options for EXT and other filesystems. Alternatively, you can use SQL or some other abstraction layer that provides a even stricter set of guarantees.

      Knowing the right tool for the job is essential, and the first step is reading the documentation on the tool to see what it does and does not promise to do.

      [ And, as a side note, it's not clear that the "right" set of specifications for a USB drive is either sync/async. First of all, the bus by which a drive is connected is only tangentially related. Second, it's the application layer, not the transport layer that determines the constraints. For instance, if you were using a USB RAID to work with video files, async would likely be the right option as sync filesystem semantics are unnecessary to the application and could constrain performance. ]

    36. Re:Depends. by Spazmania · · Score: 1

      Your claim is similar to saying that a hot dog is not cooked well because it's not an omelette.

      If you put a hot dog on a bun and hand it to the customer without first grilling or microwaving or somehow warming it up, it's edible but it's not cooked well. More to the point, it is very unlikely to be what the customer desires.

      It's equally obvious that the default for a USB-based filesystem should be that it's in a state ready to be disconnected unless a user space program is blocked writing to it right this moment.

      If you want a USB raid for manipulating video files, you can set the drive to use non-default options.

      --
      Moderating "-1, Disagree" is simple censorship. Have the guts to post your opinion.
    37. Re:Depends. by arth1 · · Score: 2

      When does the OS say "all done"?

      Generally when the drive reports that the write has completed.
      If the drive isn't truthful about that, and reports success back to the OS before the actual commit, things can (and thus will) go wrong.

      Especially when combined with write amplification, where a well used solid state drive finds out it has to clear up some space and shuffle data around and re-initialize an entire sector before the actual write can be done - that can take a second or more.
      I am very skeptical when I see solid state drives that don't have occasional hiccups - it tends to mean that they do aggressive caching so people won't notice the blips, as they occur in the background, not blocking. And the worst controllers don't even push a journal to flash first thing, but keep some unwritten data in controller RAM for extra speed.

    38. Re: Depends. by Joce640k · · Score: 1

      Really? So what are all these web pages on about, then?

      https://www.google.com/search?...

      --
      No sig today...
    39. Re:Depends. by Joce640k · · Score: 1

      Yes.

      --
      No sig today...
    40. Re:Depends. by Joce640k · · Score: 1

      If one wants write caching and the like on a removable disk, then one should have to specifically enable it.

      And... it should be simple to do, not buried under 300ft of dialogs and registry edits. eg. A tickbox on the first page of device properties - "Enable write caching until ejected (Y/N)".

      Why? If you've ever tried to delete 10,000 files from a USB stick you'd already know why.

      --
      No sig today...
    41. Re:Depends. by Anonymous Coward · · Score: 1

      >Mr Gruber's scenario of hidden corruption just isn't a thing.

      Please, no. You're talking about on Windows. Mr. Gruber was talking about on a Mac and said so in his article.

    42. Re:Depends. by Carewolf · · Score: 1

      Was the Amiga able to sense a floppy is in the drive? PC floppies can't - the floppy controller doesn't even know if the drive is present or not, so if you disconnected your floppy drive (or the BIOS wrongly said there's one) you got a ghost drive in Windows.

      If only modern operating systems had such technology.

      They seem decent at warning that writes are ongoing on USB media

      Yes, it could even tell which floppy you put in. Each individual floppy got a separate drive name, so it could ask for data on specific floppies, and have it automatically work if you installed extra drives and put some floppies there (you could even upload a floppy to memory, and games would use it automatically).

    43. Re:Depends. by Carewolf · · Score: 1

      If your operating system was programmed well, the IO call writing to the USB drive would not return until all write buffers were flushed, would not permit large write buffers to a USB drive -and- nothing else would attempt to write the USB drive in the background.

      Your operating system was not programmed well. Quick Removal only gets close.

      That is bloody stupid. That is how you get 1980s IBM PC floppy performance.

      To get any kind of halfway decent performance you need asynchronous IO, otherwise you can't read one place while writing another, and while updating the UI.

    44. Re:Depends. by ctilsie242 · · Score: 1

      All SATA and SAS drives are designed to be hot plugged and swapped, although people don't do that. Just because the hardware won't physically fry due to a hot unplug doesn't mean the data will be fine.

      It would be nice if there were better mechanisms in operating systems to eject media. For example, an I/O signal to send to a process that no further writes can be done, with some way of telling the process how much stuff got written, so it could resume writing when the media is available, or otherwise exit gracefully. Hardware-wise, it would be nice to have an eject button, that once all the caches are flushed, that glows or otherwise signals that the media is ready for removal.

    45. Re:Depends. by Sloppy · · Score: 1

      Was the Amiga able to sense a floppy is in the drive?

      Yes, and the user could even hear it occasionally doing something mechanical, as part of the polling process.

      --
      As copyright owner of this comment, I authorize everyone to defeat any technological measure which limits access to it.
    46. Re:Depends. by kelemvor4 · · Score: 2

      Maybe true, but...

      If you just yank it, the next time you want to use it you'll have to go through "The file system on this disk may be corrupt, do you want to run CHKDSK on it" followed by several dialog boxes that need clicking.

      Your idiotic "I'm going to yank it anyway" attitude just makes things worse in the long run.

      Not if you're using a reasonably current version of windows. Honestly, until this idiotic thing got posted to slashdot I had forgotten about having to "eject" storage devices back in the day. Maybe it's a concern if you're using osx or some flavor of *nix. It is not a concern with windows.

      Also, every usb device I own, and I have a large bag (probably 30 of various sizes) of them from tech conventions and the like... every one has an LED on it to indicate if read/write is going on. If the bright light is flashing, don't pull it. It's not rocket surgery. The article and ensuing discussion is a waste of electricity to post on the internet, and a waste of oxygen to feed the brain cells of the people thinking about it. The very definition of "slow news day" I guess.

    47. Re:Depends. by Khyber · · Score: 2

      "If you just yank it, the next time you want to use it you'll have to go through "The file system on this disk may be corrupt, do you want to run CHKDSK on it" "

      Uh, no? Haven't seen that in about 15 years. I NEVER eject drives. Hell I hot-swap SATA all day. I never get asked to run a damn thing.

      --
      Still waiting on Serviscope_minor to wake up to fucking reality and realize that Jessica Price isn't going to fuck him.
    48. Re: Depends. by Khyber · · Score: 1

      Those are all incompetent people that don't know shit about computers (sevenforums is a place rife with ignorance and lacking knowledge)

      Try again with a source full of competent people. The only thing that ever triggers a "scan this disk" is when I move SD cards from my camera to my computer. Guess what? Other devices don't always fully support certain features of certain file systems. Sure you can write to it, but it might not have the capability to fully-update the entry that says if the drive was properly ejected or not (most cameras don't do this, in fact.) This happens weekly with almost every SD card I use with my Kodak Z981 or my Canon Rebel.

      --
      Still waiting on Serviscope_minor to wake up to fucking reality and realize that Jessica Price isn't going to fuck him.
    49. Re:Depends. by prunus.avium · · Score: 1

      Okay. Now think of the average home user. Do you *really* think Joe Average will know how to find that option? Will he understand what the option means? Does he even know what "caching" is?

      This type of question always rustles my jimmies simply because the experts know what it means and how it works but the average user is clueless. And wants to remain so. We all need to remember Eric Raymond's other essay on the "Luxury of Ignorance". It's still very applicable today.

      In other words, this is a (at least) two part answer):

      To home users - and Managers - Yes, you always need to eject the drive before removing the USB.

      To IT professionals, you already know the answer.

    50. Re:Depends. by Xtifr · · Score: 1

      Yes, it's such a drag to have your application come back and allow you to continue working quickly. So much better to have it make you sit around waiting with your thumb up your ass while the entire IO operation completes.

      Thanks but no thanks. I'll take the very minor inconvenience of an eject operation (with an occasional delay while the system finishes writing before completing the eject) over the constant inconvenience of waiting on IO.

    51. Re: Depends. by c6gunner · · Score: 1

      Not quite. The flash drives are "controlled" and only ever get plugged into one of three different location: workstations on the main network, workstations on a small secondary network which is completely disconnected from anything else, and laptops which never get connected to any network (actually have all networking physically disabled).

      The drives are just a way of passing data across an air gap, between devices which are all controlled by the same organisation. Nobody is using these flash drives as personal storage at home and then plugging them in at work.

      I definitely do have concerns about some of the security practices at work, but this isn't one of them.

    52. Re:Depends. by dinfinity · · Score: 1

      Sorry, where would this orange indicator be?

      In Windows, the system tray and the devices and drives overview of explorer would be the most sensible places to put it.

      I don't have any software consistently open in which such an indicator could be displayed.

      Oh no, this completely invalidates my idea. Cederic has no use for it. Quick, call it all off!

    53. Re: Depends. by Joce640k · · Score: 1

      Nope.

      I often get it on a USB stick that's permanently plugged into my PC (as a 'daily backup' device). Windows only needs to freak out a bit and the dialog will appear.

      --
      No sig today...
  4. You can't always eject first on Mac by Anonymous Coward · · Score: 5, Insightful

    I can't count the number of times I've tried to eject a USB drive, and Mac OS tells me it's "unable to eject the drive because it's in use."

    Usually it's because Preview.app held onto some file descriptor for its stupid thumbnail of recent documents - not the list in the file menu, the one that pops up when you right-click on Preview in the Dock.

    Apple used to promote the idea that the user is in charge. When I click "eject," the damn thing should eject!

    1. Re:You can't always eject first on Mac by houstonbofh · · Score: 1

      Apple used to promote the idea that the user is in charge.

      Yeah, like cdroms that dont have eject buttons, and if you're old enough to remember that a floppy drive is, same crap there. I more surprised that Apple does not lock the usb-ports so you CANT unplug a thumbdrive without asking for authorisation from the mighty System7...

      I remember when a PC power switch was actually a SWITCH and not a software interrupt! It had 4 big mains power wires.

    2. Re:You can't always eject first on Mac by HiThere · · Score: 1

      That happens on Linux, too, with various window managers.

      I've never been certain whether this is dangerous or not. (I tend to play it safe.) It shouldn't cause any trouble, but you *might* end up with a corrupted file system if you just pull it out.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    3. Re:You can't always eject first on Mac by fisted · · Score: 1

      Yeah and what a crappy design that was, with the power wires going all the way through the case to the front panel.

    4. Re: You can't always eject first on Mac by Bing+Tsher+E · · Score: 1

      Actually, that design meant that power was isolated to that set of wires. Which, granted, sometimes meant those wire ends slid onto spade lugs on the power switch with little or no insulation.

      A computer that can kill stupid fucks who open the case to meddle isn't all bad, however.

    5. Re:You can't always eject first on Mac by 93+Escort+Wagon · · Score: 1

      I remember when a PC power switch was actually a SWITCH and not a software interrupt! It had 4 big mains power wires.

      Oh, yeah? Well I remember when the ESC key was an actual physical key on the keyboard, not an array of illuminated diodes on some silly touch-sensitive narrow one-line screen.

      --
      #DeleteChrome
    6. Re: You can't always eject first on Mac by crashumbc · · Score: 1

      high power wires to the front of the case then back to the PS, is fucking stupid. Just from a design standpoint.

    7. Re: You can't always eject first on Mac by Bing+Tsher+E · · Score: 1

      "Reach around to the back of the case" mini-tower design is equally, if not more stupid.

      And the design was just 'project the power switch up to the front on one cable' from the users, and even the installers point-of-view there was no 'to the front then to the back.'

    8. Re:You can't always eject first on Mac by Aighearach · · Score: 1

      Do they at least have an eject command like most *nix? On linux it is usually /usr/bin/eject and you can use the -t flag to close it.

      And if it is busy, then you can lsof /dev/cdrom

    9. Re:You can't always eject first on Mac by Aighearach · · Score: 1

      an array of illuminated diodes on some silly touch-sensitive narrow one-line screen.

      That sounds really horrid, I'm so glad I've never even seen such a device.

      I think I'd probably make a custom keyboard before even touching a keyboard like that.

    10. Re:You can't always eject first on Mac by dotgain · · Score: 1

      I'm guessing you're defining "never" to mean "not in my 20 year life time"

    11. Re:You can't always eject first on Mac by thogard · · Score: 1

      I figure hat MacOS from 10.10 is doing something with a virtual file system that is screwing with normal behavior. When I do a "ls /Volume/USB" I often get "." and nearly every time I run "ls -ls | sort" I get "ls: .: Invalid argument".

      I've got a few Sandisk USB sticks that flash for about 3 seconds after OS X said the drive is ejected. I wish it would beep once but I expect the OS thinks the buffers are flushed and the USB stick is updating its metadata. If the drive is removed then, sometimes they never work again.

    12. Re:You can't always eject first on Mac by cyn1c77 · · Score: 1

      I can't count the number of times I've tried to eject a USB drive, and Mac OS tells me it's "unable to eject the drive because it's in use."

      Usually it's because Preview.app held onto some file descriptor for its stupid thumbnail of recent documents - not the list in the file menu, the one that pops up when you right-click on Preview in the Dock.

      Apple used to promote the idea that the user is in charge. When I click "eject," the damn thing should eject!

      You can generally solve this issue by killing the Finder app, as well.

    13. Re:You can't always eject first on Mac by fisted · · Score: 1

      No, that's what we have now. Maybe you're too young to have experienced the pre-ATX time?

    14. Re:You can't always eject first on Mac by Mike+Frett · · Score: 1

      If it does that in XFCE you kill "tumblerd" and it'll eject then. =)

    15. Re:You can't always eject first on Mac by Khyber · · Score: 1

      I bet I could open your PC case right now and find goddamned spaghetti wiring all over your interior. As if ONE EXTRA SET OF WIRES from the PSU is that much of a problem when you've already got cables running from the PSU all over hell and back.

      Tell ya what, you can gripe when the PSU just has one cord going to the motherboard, and when the necessary cables for the other peripherals all carry data and power on the same cable.

      Till then, you're really just griping without any actual hindsight. Hell, I actually wonder if you've ever opened up any case at all. Pre-ATX days (my 8088 for example) had neater wiring than most computers TODAY. And yes, it had that nice bulky primary power switch with four bulky ass wires.

      --
      Still waiting on Serviscope_minor to wake up to fucking reality and realize that Jessica Price isn't going to fuck him.
    16. Re:You can't always eject first on Mac by HiThere · · Score: 1

      I think it's better to track down what's holding onto the USB. Occasionally I've had a process running in the background that really should prevent the device from being ejected. More commonly, of course, I've just had a terminal window open that was using something on it as the "current directory". The second case should be easy to just eject, the first case...better kill the process first.

      In either case I could just reach over an pull the device out...the question is "Can I do that without corrupting the files or file system?". And in both cases I prefer to handle the process properly.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    17. Re:You can't always eject first on Mac by fisted · · Score: 1

      I bet I could open your PC case right now and find goddamned spaghetti wiring all over your interior.

      You would not be wrong, but apparently it doesn't stop you from missing the point.

      As if ONE EXTRA SET OF WIRES from the PSU is that much of a problem when you've already got cables running from the PSU all over hell and back.

      Tell ya what, you can gripe when the PSU just has one cord going to the motherboard, and when the necessary cables for the other peripherals all carry data and power on the same cable.

      I think you need some basic electrical education, maybe hit up youtube etc, even that might be enough to teach you the subtle difference between low voltage wiring and cables directly connected to mains; both in terms of safety and other unimportant things like fire hazards etc.

      It is not like joe sixpack is going to disconnect power when replacing a hard disk or what not.

      "But the computer is off, what could go wrong?"
      -You

      Till then, you're really just griping without any actual hindsight.

      Without actual hindsight? I don't think you meant to say this, but hindsight is really where all this comes from. But don't let this get into your way of pulling absurd statements and assumptions out of your ass.

      Hell, I actually wonder if you've ever opened up any case at all.

      And I wonder whether you have ever opened a PSU, because even the PCB inside it *has to have* (in the EU at least, not sure about 3rd world shitholes like the US) a clear separation between primary and secondary side, with extra insulation such that nothing may even get close to the primary side.

      And now you're coming along with the "great idea" of extending the primary side to the outside of the PSU across the interior of the case to the front panel and then back, where two of those wires are always live, even when your "nice bulky switch" is off. Great job.

      Instead, smarter people came along, relocated the physical switch back into the PSU where it belongs at the same time as finally managing to implement useful things like software power off, wakeonlan.

      Up until here, I was gonna blame everything you wrote on the Dunning-Kruger effect, but after noticing that your only argument against it is that you personally like the feel of that big bulky switch, I have to clue you are, in fact, retarded. I kind of feel sorry for you.

    18. Re:You can't always eject first on Mac by houstonbofh · · Score: 1

      I'm guessing you're defining "never" to mean "not in my 20 year life time"

      Thinking of digging out my old Win95 gaming monster with a per-production Pentium Pro 166, 3DFX Voodoo2 graphics, Barracuda SCSI drives in an InWin case with a real switch on the front!

    19. Re:You can't always eject first on Mac by fisted · · Score: 1

      Well I've seen enough XT and AT that had their switch at the front. It's almost like this detail wasn't formally specified and manufacturers did whatever they thought made sense.

    20. Re:You can't always eject first on Mac by fisted · · Score: 1

      How does that matter? The crappy design is running mains through to the front panel. It has been done.

      Why does it matter which specific manufacturers did it?

    21. Re:You can't always eject first on Mac by fisted · · Score: 1

      I've seen it on basically every tower-case AT computer I've had the displeasure to open (maybe a dozen) in what would be mid to late 90s in Germany. No, I don't remember make and model. From memory, one was a 386SX with 33 or 66 Mhz and one was a 486DX with 100 MHz. I think there was also a Pentium 90 among them. Each case (typically big towers) would have a super bulky 230V-rated actual power switch connected directly to the power cord.

      I won't be doing extra research on which manufacturers did it and which did not do it since I ultimately don't care whether or not AC on /. believes me.

    22. Re:You can't always eject first on Mac by fisted · · Score: 1

      The "ATX era" beginning in the mid 90s does not mean that the "AT era" ended at that point. I've seen AT crap being used well into the early 2000s. Nobody abandoned their AT computer just because the ATX spec was released.

  5. This isn't a debate by Murdoch5 · · Score: 4, Informative

    Depending on the write method in use from the OS, you either have transferred the full contents of what you wanted, or you haven't. In the later, ejecting will finish the write cycle and in the first you're good to go. There is one other rare problem that can arise and that's file-system corruption. and you run the risk of it by just pulling your USB key out, although with any modern file-system, such as EXT4, BTRFS, ZFS, even NTFS, that chances of seeing corruption are rare.

    1. Re: This isn't a debate by tepples · · Score: 5, Informative

      What is "âoesyncâ"? [1]

      Even if you do type sync before ejecting, that doesn't keep some other process from opening and writing another file on the volume in the seconds between when you type sync and when you actually pull the plug. To prevent the possibility of corruption, you need to unmount the volume (and possibly remount it read-only) before disconnecting the drive.

      [1] Rhetorical.

    2. Re: This isn't a debate by drinkypoo · · Score: 5, Insightful

      What is "ÃoesyncÃ"? [1]

      A sign that Slashdot's text handling is pathetic.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    3. Re: This isn't a debate by Hognoxious · · Score: 3, Funny

      It's either the Maori name for New Zealand or what Toilet & Douche re-branded themselves as a few years back.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    4. Re: This isn't a debate by CaptainDork · · Score: 1

      It's a sign of operator error.

      We're nerds.

      Work around it.

      --
      It little behooves the best of us to comment on the rest of us.
    5. Re:This isn't a debate by CaptainDork · · Score: 1

      Tell that to an old Windows NT server.

      I plugged up an EHD for backup; ejected it; and it bitched, topping out the error log over and over again.

      It thought the yanked EHD was performing poorly.

      --
      It little behooves the best of us to comment on the rest of us.
    6. Re: This isn't a debate by johnw · · Score: 1

      ITYM

      sync; sync; sync;

    7. Re: This isn't a debate by drinkypoo · · Score: 1

      It's a sign of operator error.
      We're nerds.
      Work around it.

      It's too bad Slashdot isn't run by nerds, apparently. If it were, they would have had a burning need to fix it.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    8. Re: This isn't a debate by Joce640k · · Score: 1

      Yeah, I can't wait for the day when slashdot posters can use all of Unicode for their missives. I love all those fun little graphic symbols.

      Not.

      (OTOH you'd think they'd be able to find/convert quote marks when they receive a message).

      --
      No sig today...
    9. Re:This isn't a debate by Joce640k · · Score: 1

      It thought the yanked EHD was performing poorly.

      It was correct.

      --
      No sig today...
    10. Re: This isn't a debate by CaptainDork · · Score: 1

      "Burning need," is code for, "rabid greed," from /. perspective.

      What's your guess for ROI of a fix?

      --
      It little behooves the best of us to comment on the rest of us.
    11. Re:This isn't a debate by CaptainDork · · Score: 1

      Touche'

      --
      It little behooves the best of us to comment on the rest of us.
    12. Re: This isn't a debate by drinkypoo · · Score: 1

      Yeah, I can't wait for the day when slashdot posters can use all of Unicode for their missives. I love all those fun little graphic symbols.

      It's a simple process to whitelist the useful Unicodes, and disallow the rest. An equally simple count of which Unicodes people are trying to use will tell you which to consider. This is not rocket surgery. It's simply not giving a shit.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    13. Re: This isn't a debate by thogard · · Score: 1

      In the days before System V, the sync call needed to be called 3 times. Once to write the data, once again to write the metadata (like atime and directory entries) and a 3rd time to write the the metadata of the metadata.

    14. Re: This isn't a debate by Joce640k · · Score: 1

      Why does Slashdot need special curly quotes and apostrophes? Are Mac owners really so disgusted by ordinary ASCII ones?

      If we give them that they'll want a different font (which nobody but Mac owners can distinguish from the existing one) and lower contrast color schemes, too.

      --
      No sig today...
    15. Re: This isn't a debate by Joce640k · · Score: 1

      It's much simpler than that to convert them to ordinary ASCII quotes and apostrophes so you don't have to upgrade your ASCII database.

      (or any of the other problems that can appear when you undertake a large switch to Unicode).

      --
      No sig today...
    16. Re: This isn't a debate by ArsenneLupin · · Score: 1

      A sign that Slashdot's text handling is pathetic.

      No. It's a sign that the Anonymous Coward who wrote âoesyncâ is an idiot who shouldn't be trusted with a keyboard. Or a troll. Or both.

    17. Re: This isn't a debate by DCFusor · · Score: 1

      You're right, it's pathetic. It should detect stupidity like those quotes and reject them upfront instead of mis-displaying them, or I mean, displaying them the way one dictatorial opsys insists is the one true way.

      --
      Why guess when you can know? Measure!
    18. Re: This isn't a debate by drinkypoo · · Score: 1

      I'll give you that as a contributing factor, but slashdot should handle those people more gracefully. Also, smart quotes often appear in pasted content, so the problem is bigger than just people with defective browsers, and defective minds sufficient to prevent them from changing preferences.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    19. Re: This isn't a debate by ArsenneLupin · · Score: 1

      Also, smart quotes often appear in pasted content,

      In the present case, however, I doubt that the user had to copy-paste the word sync. 4 letters. It's quicker to type it.

      so the problem is bigger than just people with defective browsers

      And defective webservers (where people might copy-paste such content from). However, as far as I know, nowadays even Wordpress no longer does this nonsense. Other web servers still might. Or might pull similar stunts using CSS (transparent "glass" layer over whole page so that you can't paste anything). Best is to bring it to the webmasters' attention, so that he can update / change his software.

    20. Re: This isn't a debate by drinkypoo · · Score: 1

      Lots and lots of major websites use smart quotes. It's very common on news sites, especially. Not handling them gracefully is inexcusable.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    21. Re: This isn't a debate by ArsenneLupin · · Score: 1

      Lots and lots of major websites use smart quotes. It's very common on news sites, especially. Not handling them gracefully is inexcusable.

      Hmmm, but with the recent legal climate, it might not be so advisable to change Slashcode for the express purpose of facilitating "stealing" valuable content from news sites ("Leistungsschutzgesetz", etc.). Better find a different excuse.

      ... or maybe Slashdot could use a different string than âoe for smartquotes? Unicode character 0x1F4A9 might be appropriate :-)

  6. With Windows you can't tell by Anonymous Coward · · Score: 1

    The problem of the safe drive ejection approach is having to wait for Windows (and I've found it's invariably Windows) to release a lock on a file because some program might have been using it at some point, then not giving you any capacity to tell just which program and file it might be so you can take care of it yourself. Then you just have to yank it anyway.

    1. Re:With Windows you can't tell by Hognoxious · · Score: 1

      I've had Nautilus on Linux do it sometimes.

      There's an "eject anyway" button but on my version it doesn't work.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    2. Re:With Windows you can't tell by houstonbofh · · Score: 2

      Me: *Tries to eject flash drive.*
      Windows: "Cannot eject drive as files are still being used."
      Me: *Closes Explorer window that was open to a folder on C and not any folder on the flash drive, and tries to eject again.*
      Windows: "Drive can be safely removed."
      Me: "WTF?"

      Windows: "Windows is applying Updates. Do not turn off your computer."

    3. Re:With Windows you can't tell by houstonbofh · · Score: 1

      Time for the skinny elephants...

    4. Re:With Windows you can't tell by NoZart · · Score: 1

      Weirdly enough, i never had problems yanking USB from windows machines (from xp onwards - before you only needed to look at the screen angry to make the computer crash). OSX on the other hand managed to wreck quite a few sticks so i had to reformat them. (This is 3 years back though when i had to support Apple in our company, might be fixed by now.)

    5. Re:With Windows you can't tell by Cid+Highwind · · Score: 1

      Me: *Tries to eject flash drive.*
      Windows: "Cannot eject drive as files are still being used."
      Me: *Closes Explorer window that was open to a folder on C and not any folder on the flash drive, and tries to eject again.*
      Windows: "Drive can be safely removed."
      Me: "WTF?"

      Just another "feature" shamelessly plagiarized from Mac OS!

      --
      0 1 - just my two bits
    6. Re:With Windows you can't tell by omnichad · · Score: 1

      Me: *Closes Explorer window that was open to a folder on C and not any folder on the flash drive, and tries to eject again.*

      Well what if that external drive had an autorun.inf or autorun.ico? Have to get that and display the right icon. Oh, and then that triggers a virus scan of the drive icon. But that only takes a few seconds, right?

  7. Service Technician by Anonymous Coward · · Score: 3, Informative

    I repair computers and macs for a living and have been doing so for more than 20 years.

    Is it safe to yank a USB drive?
    No, but the severity varies by OS.

    On Linux or Mac? Somewhat, or at least safer than Windows, but I'd go ahead and unmount it anyway just to be safe.
    On Windows? No. You can do it, but you're taking a gamble every time that doing so will break the partition tables. You might be able to fix that and get the data back off of it... or you might not.

    Now, will I do it anyway, knowing the risk?
    Absolutely, and especially on windows. I keep a drive just for moving diagnostic tools or software to windows computers while inside the OS and occasionally, windows decides it doesn't want to unmount it, so I'll yank it anyway. But that's with the understanding that everything on that drive can go 'poof' any time I do it and everything on it is backed up.

    In short:
    If you value what's on that drive, you shouldn't... but you should have more than the one copy on the drive of whatever you're moving around anyway.
    If you don't have backups, it must not have been important.

    1. Re: Service Technician by Anonymous Coward · · Score: 2

      Microsoft does update a partition table when it sees it for the first time. It's an awesomely bad idea, but hey: Microsoft

    2. Re: Service Technician by guruevi · · Score: 1

      Microsoft OS keeps the modified partition table in memory until it gets cleanly unmounted or there is "time" to write it out.

      There is no guarantee (what we're used to in real OS) that your operation was atomic.

      --
      Custom electronics and digital signage for your business: www.evcircuits.com
    3. Re: Service Technician by lgw · · Score: 1

      Microsoft OS keeps the modified partition table in memory until it gets cleanly unmounted or there is "time" to write it out.

      Partition table? Really? That thing that is written once and never changed? You keep using that word, but I don't think it means what you think it means.

      --
      Socialism: a lie told by totalitarians and believed by fools.
  8. Risk by xonen · · Score: 1, Insightful

    It's akin to saying you probably don't need to wear a seat belt

    No, no and no.

    As you may know, risk = damage x chance.

    When i don't wear a seat belt and get in a crash, i might die or suffer severe injuries. That's big damage.

    When i loose a file, i lost a few bits. I usually couldn't care less. It might be a photo or mp3 file. It might be a failed backup. Worst case it's a fortune worth of bitcoin. But i won't die from it.

    Don't make analogies that just aren't true. Don't pretend a lost bit is the same as a broken body part. And to be on-topic - i usually just `yank` my thumb drive out whenever i want. When i feel it's really important i might once in a blue moon go the official way. I'm perfectly capable of calculating the risk that i take. Saving many seconds on repeated actions weigh up against that one time i was to quick and spend a minute re-copying a file.

    It's just the next episode of FUD - same as the 'experts' done with passwords. Just so now they have an excuse to blame the user if a flash storage fails (which they do): 'you probably yanked it out'.

    --
    A glitch a day keeps the bugs away.
    1. Re:Risk by angel'o'sphere · · Score: 2

      As you may know, risk = damage x chance.
      Only if the damage is monetary and you are in the insurance business. Otherwise risk and chance are two orthogonal axis.

      E.g. the typical prisoner dilemma: you are sentenced to life time prison. You get offered to either stay and accept the sentence or walk through two doors: one door gives you freedom, the other door execution.

      The chance is 50% for either freedom or death. The risk is death, and not an abstract number multiplied from two other numbers.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    2. Re:Risk by houstonbofh · · Score: 1

      When i loose a file, i lost a few bits. I usually couldn't care less. It might be a photo or mp3 file. It might be a failed backup. Worst case it's a fortune worth of bitcoin. But i won't die from it.

      Funny you should say that. When it comes down to it, the biggest killer on this planet is a lack of money. So that loss of bitcoin could kill you if you needed food. Or if you owed the mob. Or if you needed an operation insurance would not cover. Many wars in the world about about nothing more them money.

      If money really means nothing to you, you must have quite a bit of it by world standards.

    3. Re: Risk by Kjella · · Score: 1

      The worst case is almost always that you die. You can die of a heart attack, a car crash, lightning strike, whatever. We have dismissed them because they are highly improbable. If it was 50-50 thereâ(TM)s a âoerealâ chance youâ(TM)ll die. It only looks like a 1D model after youâ(TM)ve evaluated the other dimension.

      --
      Live today, because you never know what tomorrow brings
    4. Re: Risk by Bing+Tsher+E · · Score: 1

      thereÃ(TM)s a Ãoerealà chance youÃ(TM)ll die.

      It's not lethally dangerous to fix the defective configuration in your iGadget.

    5. Re:Risk by DamnOregonian · · Score: 1
      I think you need to learn what an analogy is.

      And to be on-topic - i usually just `yank` my thumb drive out whenever i want.

      Nevermind. You're fucking hopeless.

  9. Sigh. by ledow · · Score: 4, Insightful

    If you haven't written anything to the USB, yes, it's completely safe. Any filesystem that's writing data just because of your passive reading of the disk is a) stupid, b) should have recovery for such, c) shouldn't be writing anything important (e.g. a last access time, maybe?)

    If you have written anything to the disk, and it's synced to disk (i.e. activity light is idle) then, yes, it's safe. This may be dependent on OS and whether you can see any activity light. Modern OS should mount without write-caching for external drives unless told otherwise, and any half-decent filesystem should survive a forcible unmount in such circumstances

    If the USB is still busy churning after you copied files to it, and you yank it? Yes, you're gonna lose data.

    That a bunch of "nerds" can't figure this out after all the years we've had USB disks etc. (I remember starting with them in 95 OSR2 / Linux 2.0 personally?) really worries me.

    Same as floppies before it. Floppy only being read-from? You can yank it. Floppy was written to but has now gone idle? You can yank it. Floppy was written to and it still pulsing / flashing? Leave it alone.

    1. Re:Sigh. by tepples · · Score: 1

      If you have written anything to the disk, and it's synced to disk (i.e. activity light is idle) then, yes, it's safe.

      The activity light comes back on just as your brain sends the signal to your arm to pull the plug. Still safe?

    2. Re:Sigh. by hcs_$reboot · · Score: 1

      +1

      --
      Slashdot, fix the reply notifications... You won't get away with it...
    3. Re:Sigh. by tepples · · Score: 2

      Secondly, why is the computer doing things that you're not telling it to do?

      People tend to forget what they have told the computer to do in the background, such as index text files for full-text search and index image files for thumbnail browsing.

    4. Re:Sigh. by houstonbofh · · Score: 1

      If you haven't written anything to the USB, yes, it's completely safe. Any filesystem that's writing data just because of your passive reading of the disk is a) stupid, b) should have recovery for such, c) shouldn't be writing anything important (e.g. a last access time, maybe?)

      That would be windows that by default updates the partition table when it sees a new disk. And while I agree with you, it is still the way it is...

    5. Re:Sigh. by rnturn · · Score: 1

      Wouldn't those be read-only activities? I can't imagine that interrupting that would corrupt the contents of the USB drive.

      --
      CUR ALLOC 20195.....5804M
    6. Re: Sigh. by Bing+Tsher+E · · Score: 1

      I was always disappointed by what happened when I dragged the 'hard drive' icon to the trash can on a classic MacOS system. There should be loose 6-32 screws rolling around on the tabletop after the dust settles.

    7. Re:Sigh. by thegarbz · · Score: 1

      That a bunch of "nerds" can't figure this out after all the years

      The bunch of nerds are stuck in the past not realising that for the past 17 years the most popular OS in existence has disabled write caching on removable drives by default and you can yank away as much as you want.

      It's not a case of not figuring it out, it's a case of not reviewing a 20 year old assumption.

    8. Re:Sigh. by yes-but-no · · Score: 1

      yes safe, if your brain can send a faster abort signal to your arm to prevent yanking while LED flashing.

    9. Re:Sigh. by ledow · · Score: 1

      Linux generally mounts disks "noatime" for precisely this reason. And if you cut out in the middle of an access-time-write, the filesystem at worst has an incorrect access time.

      Windows does not store access times on NTFS or FAT ("To save system resources in Vista, Microsoft disabled the Last Access Time Stamp").

      So... no... it doesn't... and no, not all OS do this. Not since the 90's really.

    10. Re:Sigh. by DamnOregonian · · Score: 2

      And if you cut out in the middle of an access-time-write, the filesystem at worst has an incorrect access time.

      And herein lies our problem. Blind, proud, and dangerous ignorance.
      There are a lot of layers in a file write. Even more layers when it's to a flash drive with built in wear-leveling.
      You presume to know what the underlying filesystem, vfs cache, block scheduler, device driver, and the device itself are doing. In short, you are insane.
      You do *not* want to pull power off that device simply because it's not receiving data to write from the PC anymore.

      You are otherwise correct that atimes aren't commonly in use.

    11. Re:Sigh. by DamnOregonian · · Score: 1
      Your ignorance is terrifying. As if whether or not the OS cache is write-through or write-back is the only factor in play. Keep yanking away. If you wait long enough, where long enough is some completely unknown amount of time, you'll even avoid getting your dick stuck in your zipper.

      I bet you're one of those assholes who doesn't think they need a blinker.

      It's not a case of not figuring it out, it's a case of not reviewing a 20 year old assumption.

      And this is a case of you reviewing a 20 year old assumption based on the incorrect assumption that you are qualified to review it. Let me give you a tip- you're not.

    12. Re:Sigh. by thegarbz · · Score: 1

      Your ignorance is terrifying.

      Nope, just well through through and risk assessed.

      As if whether or not the OS cache is write-through or write-back is the only factor in play.

      It is the dominant factor for any write that isn't presented to the user. Any other write is typically shown via a progress bar and if those writes fail you get an error message. Try it sometime. Yank that drive after your copy is done and bask in the glory that no data has been lost. If you're actively using an application than the yank also results in an error message giving you the opportunity to save the file again.

      I bet you're one of those assholes who doesn't think they need a blinker.

      Why would you think that? The blinker serves a very real safety purpose of alerting other drivers to what you are doing. Incidentally if I'm on a country road by myself with no one in sight I don't use the blinkers either. It's just as pointless as ejecting a drive. Instantly labeling people who think about the application of what they are doing as "arseholes" is far more of a reflection on you than the people you label.

      And this is a case of you reviewing a 20 year old assumption based on the incorrect assumption that you are qualified to review it. Let me give you a tip- you're not.

      LOL okay mate we'll go with your crazy doom and gloom scenarios. Maybe, if you're really lucky then one day you can come and say I told you so, but 17 years of no dataloss makes anything you say at all completely irrelevant as you have utterly failed to apply a risk assessment to your actions.

    13. Re:Sigh. by DamnOregonian · · Score: 1

      It is the dominant factor for any write that isn't presented to the user. Any other write is typically shown via a progress bar and if those writes fail you get an error message.

      Wrong.
      The devices you are talking to are little computers in unto themselves. They are designed to be hot swappable- *after* they've been told to stop doing the work they have queued up, and to finish up any background tasks required for the medium. There's a reason clicking that little eject button de-enumerates the USB device.

      Why would you think that?

      See above. People often think blinkers are unnecessary. They're wrong. Their brains lack the critical thinking to fully understand the problem space, though they think they do.

      LOL okay mate we'll go with your crazy doom and gloom scenarios.

      It's not a doom and gloom scenario. I'm well aware you may never run into a problem. Certain types of writing heuristics are more dangerous for a 'write and yank' than others, and if yours is just copying an excel spreadsheet to the thing, waiting 10 seconds, and yanking, you're probably OK. You're still misusing the device as the manufacturer and protocols dictate, and you're still an idiot for suggesting that to other people without understanding why your specific scenarios are less problematic than scenarios that may cost people lost data.

    14. Re:Sigh. by thegarbz · · Score: 1

      Wrong.
      The devices you are talking to are little computers in unto themselves. They are designed to be hot swappable- *after* they've been told to stop doing the work they have queued up, and to finish up any background tasks required for the medium. There's a reason clicking that little eject button de-enumerates the USB device.

      Right back at you. Those "background tasks" finish in milliseconds and do not sit there in some mythical long idle queue waiting for the OS to signal that the USB driver has been unloaded.

      You're still misusing the device as the manufacturer and protocols dictate

      Actually I'm using the device entirely as designed. "Optimised for quick disconnect" is such for a reason. No need to wait 10 seconds. As I said with write-caching disabled the time between being given the 100% complete signal and you actually yanking is milliseconds for the device to actually finish what its doing. About the only risk you still have is that an application actively has a file open. At that point yanking will net you a lovely error message.

      You see, in the early days this shit was actually a problem. Slow wear leveling algorithms, write caching, poor USB drivers, generally poor (in the windows world) handling of hot-swappable hardware, filesystems that would fall over if you look at them the wrong way, it all was very real 20 years ago. Then people realised that something needed to be done, and did something about it.

      As the manufacturer intended? The modern manufacturer intends a device to be connected to a fallible bus by idiots. They expect USB sticks to have a bundle of keys dangling off them and to randomly plop out. They expect cheap arse Chinese USB hubs to not provide the required power or report to the OS correctly. They expect removable drives to be used by kids on a bed when their friends come and jump on it. In the past 20 years we have seen very actively manufacturers designing devices to counteract the very real abuse they get. Software writers do too.

      I am using the device exactly as the manufacturer intended, and you'd need to actively go out of your way to experience silent data loss as a result. Like using your right blinker and then turning left without giving way to a car that had no idea what you were doing.

    15. Re:Sigh. by DamnOregonian · · Score: 1

      Right back at you. Those "background tasks" finish in milliseconds and do not sit there in some mythical long idle queue waiting for the OS to signal that the USB driver has been unloaded.

      It isn't some mythical idle queue. The interface to the backend flash controller chips is almost always asynchronous. You're also writing 512 byte blocks to devices with 4K or larger sectors. The full delay for the transmission of data to the flash controller and it completing all the tasks can be in the order of seconds, not milliseconds.

      Actually I'm using the device entirely as designed. "Optimised for quick disconnect" is such for a reason. No need to wait 10 seconds. As I said with write-caching disabled the time between being given the 100% complete signal and you actually yanking is milliseconds for the device to actually finish what its doing. About the only risk you still have is that an application actively has a file open. At that point yanking will net you a lovely error message.

      Nope. You are still operating at the wrong layer. Like I said, you're not even aware of what you don't know. Disabling write-back caching at the OS is only half of the problem. Some devices, like disk drives, have extra commands that can be sent to ask their media controllers to behave purely synchronously. Backend flash controller devices often do not.

      You see, in the early days this shit was actually a problem. Slow wear leveling algorithms, write caching, poor USB drivers, generally poor (in the windows world) handling of hot-swappable hardware, filesystems that would fall over if you look at them the wrong way, it all was very real 20 years ago. Then people realised that something needed to be done, and did something about it.

      You're entirely out of your depth.
      Let us present the simple scenario of modifying a single 512 byte sector.
      The flash drive cannot do this. There are multiple ways it can accomplish this, depending on what the media looks like. It can simply write that 512 byte blocks to an erased sector that it has available if it knows the surrounding 512 byte blocks are not used. If they are, we enter a new branch. What's the best way forward, do we read the flash sector, erase it, and then re-write it? Or if we can, do we read, and write somewhere to an available erased sector?
      All of this simply does not trickle back all the way up to the application layer synchronous writing calls, even with all OS caches disabled.

      The modern manufacturer intends a device to be connected to a fallible bus by idiots.

      Objection: Speculation.

      I am using the device exactly as the manufacturer intended

      No, you're not. As evidenced by the fact that the first person to decry this article was someone from *SanDisk*. You may know them as the chaps who make these fucking devices.
      Sorry buddy, you're an idiot and you're too dim-witted to see it.
      What you do may be safe for your workloads, but it's not safe in general, and isn't recommended because the people who understand how it all works are quite simply smarter than you. I know that hurts, but suck it the fuck up and move on.

    16. Re:Sigh. by Khyber · · Score: 1

      "In short, you are insane."

      Insanity is doing the same thing over and over again while expecting a different result from the ones that have occurred.

      Given your consistent horrible mis-use of the word, I'm going to say that by definition, you are the insane one.

      --
      Still waiting on Serviscope_minor to wake up to fucking reality and realize that Jessica Price isn't going to fuck him.
    17. Re:Sigh. by DamnOregonian · · Score: 1

      Insanity is doing the same thing over and over again while expecting a different result from the ones that have occurred.

      Nope. That's something said by ignorant humans who fill their brain with sound bites and cliches instead of actual knowledge.

      Given your consistent horrible mis-use of the word

      Given your apparent ignorance of the definition for consistent, as well as insane, you mean...

      I'm going to say that by definition, you are the insane one.

      And definition...

      Don't you have a ditch to dig somewhere, man?

    18. Re:Sigh. by tepples · · Score: 1

      yes safe, if your brain can send a faster abort signal to your arm to prevent yanking while LED flashing.

      Is there any evidence that the brain can do so?

    19. Re:Sigh. by omnichad · · Score: 1

      yes, it's completely safe. Any filesystem that's writing data just because of your passive reading of the disk is a) stupid

      Due to answer A, it is indeed not safe. Seems to be everywhere.

    20. Re:Sigh. by omnichad · · Score: 1

      Enable hidden files. The index is written to the drive itself on Windows. Never seen a thumbs.db file?

    21. Re:Sigh. by thegarbz · · Score: 1

      It isn't some mythical idle queue.

      I didn't say the queue was mythical. I said the "long queue" was mythical. It is actually incredibly short working blocks at a time. This is also precisely why writes take longer than reads as seen by the OS. It's a very short queue that is cleared within milliseconds. You're write about the size, but dead wrong about the time. But no need to take my word for it, just look at the hardware since the flash memory based devices that are resistant to dataloss on unexpected loss of power have ... a capacitor, and one that provides milliseconds of power.

      Nope. You are still operating at the wrong layer. Like I said, you're not even aware of what you don't know.

      Nope, I'm operating on the only layer that is relevant. You're right though, you're not even aware of what you don't know and you don't appear to know how irrelevant to this discussion that lower layer is given you don't understand the timings involved.

      What's the best way forward, do we read the flash sector, erase it, and then re-write it?

      You are technically right. What you fail to realise is this operation completes in milliseconds with a queue that is only a few k deep on a device that transfers data at many MB/s.

      Objection: Speculation.

      There's nothing speculative about seeing the changes in hardware and software governing removable devices over many years. Not just for flash but also quick disconnect.

      Sorry buddy, you're an idiot and you're too dim-witted to see it.

      And to the crux of it. You provide no understanding and nothing but useless insults. I on the other hand have poured over the details of these controllers in detail because unlike you ivory tower dimwits who think you understand what goes on in low level my job actually involves interfacing with devices without your fancy higher level protections. Come back when you've had to directly read and write to a flash memory controller while adding interrupts to delay your code to prevent precisely the scenario you speculate the person you're talking to knows nothing about.

      I know that hurts, but suck it the fuck up and move on.

      You're free to move on whenever you're ready to admit what a wrong arsehole you are boy. In the mean time I'm going to be sitting here aruging against you against the spread of your ignorance until Slashdot archives this story.

  10. Ports can get damaged, somehow. by happyfeet2000 · · Score: 1

    Back when I was in tech support I noticed an increase in computer USB ports damaged when yanking the USB out. I know the plural of anecdote is not data, but still...

    1. Re:Ports can get damaged, somehow. by Anonymous Coward · · Score: 1

      Perhaps they were just rougher users

    2. Re:Ports can get damaged, somehow. by Excelcia · · Score: 1

      So you're suggesting that pulling out the USB device before logically ejecting causes physical damage to the port? How is this even remotely linked? It's absurd. Are you suggesting there is an electro-mechanical lock inside that engages when the device it inserted and remains engaged until the device is logically ejected? From sure knowledge I can tell you there certainly isn't.

    3. Re:Ports can get damaged, somehow. by Hognoxious · · Score: 3, Funny

      The physical damage occurs when you go "Oh, fuck!" and try to ram it back in before the computer notices.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  11. Depends by AlanObject · · Score: 5, Informative

    I used to write a lot of 8GB+ file system images to 16GB SanDisk devices using an Ubuntu 14.04 system. The caching it did was immense. The dd or the cp command finished in less than 60 seconds but when I did a umount command on the volume it would block for about 5 whole minutes or more while the cache emptied.

    These particular USB drives have a blue activity LED on them so it wasn't hard to figure out what was going on.

    In that use case yanking the USB would have been a big no no.

    1. Re:Depends by Anonymous Coward · · Score: 2, Informative

      I used to write a lot of 8GB+ file system images to 16GB SanDisk devices using an Ubuntu 14.04 system. The caching it did was immense. The dd or the cp command finished in less than 60 seconds but when I did a umount command on the volume it would block for about 5 whole minutes or more while the cache emptied.

      These particular USB drives have a blue activity LED on them so it wasn't hard to figure out what was going on.

      In that use case yanking the USB would have been a big no no.

      This is why dd has the argument "oflag=sync". I suppose you could also use "oflag=nocache", never tried it myself, but the man page suggests it has the same effect.

      Likewise it's easy enough to add "&& sync" or "&& sync && umount /your/device" to the end of a cp command. If you want to monitor it with a glance once in a while, try iotop.

      I have also noticed that if I perform a copy with my GUI file manager the copy notification stays on until it's really completed. On a big copy a USB device will have bursts of speed with slowdowns in-between as blocks are overwritten (a flash drive's charge accumulator takes a bit of time). This is with KDE's Dolphin file manager, though I doubt it's unique.

    2. Re:Depends by houstonbofh · · Score: 1

      operating systems that don't (windows by default)

      Which windows? That default changed with the versions...

    3. Re:Depends by thegarbz · · Score: 1

      That default changed with the versions...

      Yeah 17 years ago.

    4. Re: Depends by guruevi · · Score: 1

      Dd is by default synced. Most likely op used some advice that setting async on everything made things faster (a lot of older ripoff-of-a-copy Linux guides give that advice to put it in for every fstab and mount option).

      --
      Custom electronics and digital signage for your business: www.evcircuits.com
    5. Re:Depends by vtcodger · · Score: 1

      " it doesn't matter."

      It wouldn't were it not that the USB device very likely has a mind of its own. Primitive, but a mind nontheless. Rumor has it that It moves stuff around and tinkers with its internal address tables constantly in order to improve your user experience. Your user experience is presumably very important to it.

      I think one likely wants the stupid thing to finish what its up to before removing its power. Hopefully, typing umount or eject and waiting for the command to finish means that the drive has gone to sleep.

      --
      You can't see ANYTHING from a car, You've got to get out of the goddamned contraption and walk...Edward Abbey
    6. Re:Depends by fibonacci8 · · Score: 1

      I'm sure all of them fit. Just not more than one at a time.

      --
      Inheritance is the sincerest form of nepotism.
    7. Re:Depends by novakyu · · Score: 1

      I believe that for cp command.

      dd command, you are full of crap. You can't (or at least shouldn't) dd to a disk device that is mounted. There shouldn't be anything for umount command to unmount when you are done with dd, not to mention that unless you backgrounded dd process, dd command doesn't to caching—and you can always send a USR1 signal to a running dd command to tell it to tell you how many bytes have been transferred.

    8. Re:Depends by AlanObject · · Score: 1

      You are right about the dd command. My error. I did lots of both kinds of copies as circumstances required.

    9. Re: Depends by buchanmilne · · Score: 1

      This is what I was complaining about earlier about Ubuntu. The kicker? Finish up with cp or dd and then walk away for an hour, or maybe a day. Try to eject the disk and only then will it finish writing. It's just absurd how even friggin Microsoft can get something so basic right but Ubuntu won't even pretend it's a problem. I mean it's not like it's just me and one other guy on slashdot who use flash drives or anything.

      oflag=nocache, I think that's right for dd to disable write caching

      Uh, last I checked, without WSL, Windows has no built-in equivalent of dd.

      If you are not experienced enough to know what dd does, maybe you should use one of the graphical front-ends distros provide for inexperienced users; there are worse things you can do with dd than abort writing an image to a removable flash drive (like writing the image to the wrong device).

      The OP said he "used to write a lot of 8GB+ file system images to 16GB SanDisk devices", which probably means there was no filesystem mounted, so your cp examples are invalid. In most cases, filesystems on removable devices will be mounted with the 'sync' option, so your cp example is also wrong.

  12. I vacum my computers by CranberryKing · · Score: 2

    all the time. Have carpeting too. The case is open often and a beer is balanced somewhere nearby that it probably shouldn't. Not the same as forgoing a seat belt at all.

  13. RAM caches by dissy · · Score: 5, Informative

    Depends how many places "confirmed" saved data can be cached in RAM.

    Spinning hard drives have their own cache, which isn't written to the actual disk until either the cache is "full enough" or you instruct it to do so.
    This data will be lost if you power the device down before the cache is flushed to disk, after the drive reported the data saved.

    Flash sort of depends, an SSD for example tends to do the same thing, but there are different ways it can go about it.

    Older SSDs can only write 4k blocks, it wasn't possible to write less data.
    So to write for example 300 bytes, the controller has to pull in a 4k block to its RAM, edit those 300 bytes, and write out the entire 4k block again.
    Pull power before this is done and your 300 bytes are gone.

    "Removable" USB flash drives, the better ones at least, tend to not report data as saved before it really is, just to help avoid this problem. There is little hope for a non-technical person to know what their particular flash drive is doing however, and not even obvious to technical people either.

    On top of that, your OS likely caches data to be written to any disk in RAM, completely independent of what the disk itself is doing.

    If one is absolutely certain how all of these caches function, and can be completely assured all data is written in a method that doesn't rely on the disk claiming it is or isn't, then in that case it would be safe to power down the device.

    For average and above average users, that will just not be true.
    Even for experts, outside of a small set of cases like highly customized and tuned systems, it may be true the expert knows what is going on, but would tell you from that knowledge it wouldn't be safe and is a silly risk to take, with a high cost of data loss in exchange for a couple of seconds of time saved.

    Hell, even I am still in the habit of issuing three 'sync' commands in a row before an unmount command, and that's despite the knowledge the unmount command will do a 'sync' call of its own!

    But as this advice is for average or below people, as bad as it is, isn't the worst things commonly done.
    Average or below people rarely even make backups, which has a far higher cost when (never IF) a drive fails. Corrupting a couple files on a single USB drive compared to not having any backups is like complaining your car only has 5 airbags instead of 6 while driving it off of a cliff...

    1. Re:RAM caches by dissy · · Score: 4, Informative

      Yes, by older I mean roughly 20 years ago, some of the initial nand devices on the market.

      These days a 128-256kB nand page size is typical.
      I also recall Intel at least saying something about 512kB on some of their higher end offerings, but don't remember what class of devices that was about or if it's one of those "coming soon" things or not.

      Fortunately even though the page size keeps going up, the flash write speeds also are going up, so it doesn't tend to take that much more total time to commit a write by the controller chip.

      The window of opportunity for data loss doesn't change a lot because of that, but the amount of data that can be lost if you yank power during that window can be greater.

    2. Re:RAM caches by Walter+White · · Score: 1

      So to write for example 300 bytes, the controller has to pull in a 4k block to its RAM, edit those 300 bytes, and write out the entire 4k block again.
      Pull power before this is done and your 300 bytes are gone.

      I think it may be worse than that. For some devices you have to erase the entire block before it can be written so if power is removed at the wrong time, the entire 4K block can be lost. (My experience is with NOR flash chips used in embedded system and may not be applicable to SSDs and flash drives.)

      I believe that one difference between enterprise and consumer SSDs is that the enterprise SSDs have a capacitor or battery or something to insure sufficient power to complete this process should power be removed at the wrong time.

      As to the original question... I prefer something more reliable than "most of the time you'll be OK."

    3. Re:RAM caches by dissy · · Score: 1

      I believe that one difference between enterprise and consumer SSDs is that the enterprise SSDs have a capacitor or battery or something to insure sufficient power to complete this process should power be removed at the wrong time.

      That is a very good point as well.
      You are correct about the enterprise SSDs having backup power capability that consumer SSDs do not have.

      One of our servers here has a mix of SSD and hard disk storage, both SAS-2 and on an IBM ServeRaid controller.
      The SSDs are "IBM 99Y1329" 400gb, and have some funky type of capacitor providing backup power to flush the RAM cache if need be. They call them "Organic Capacitors" which I have to admit to not hearing about before this particular SSD.

      I don't recall the exact price but I think those little bastards were a few hundred bucks each when new.
      The RAID controller is also specifically made to utilize them differently than the regular SAS HDs in terms of what data is stored there, and the controller has its own battery attached to protect its cache RAM.

      There are good reasons for all of that extra tech (and extra cost) in most enterprise grade solutions just to protect your data.

      As to the original question... I prefer something more reliable than "most of the time you'll be OK."

      My protip: If your data is so unimportant that saving a few seconds is acceptable, then imagine how many minutes you would save by simply not copying the data to a flash device in the first place!
      Of course not copying the data at all will yield a 100% chance your data won't be there, but as those odds are already acceptable this is clearly not a problem.
      Then you'll have quite a lot more time to spend whatever is deemed more important than the data existing.

  14. Bad design by inking · · Score: 2

    My thoughts are that this is bad design and will hopefully be fixed in some future revision.

    1. Re:Bad design by evanh · · Score: 2

      Yes it is bad design - called write-back caching. It's one of the dumbest of ideas for removables, sits alongside auto-run.

      Removables should always immediately flush all write data, as in use write-through caching. I doubt it will ever be fixed though, it's been that way for 500 million years already.

    2. Re:Bad design by houstonbofh · · Score: 1

      It is. It is called "The Cloud!" It has all new bad design!

  15. Should Have Guidelines for Program Behaviour by mykepredko · · Score: 1

    You *should* be able to just yank out a USB drive but there's always the chance that a program has a file open and has modified it but not closed it which means, depending on the file system, the file (and maybe the drive) is corrupt until it is closed.

    I would think that the idea application behaviour when it comes to files the guidelines should be:
    a) Opens the file to read the contents and store in memory. Once this is done, the file is closed.
    b) Searches and operations are done on the copy in memory.
    c) When the program/user decides the changes to the copy are correct, the file is open, written to and then closed.
    d) If the application wants to update the file and the (thumb) drive isn't accessible, the user is prompted.

    I know that I will get pushback on this as there will be the question what if the program is too big for memory? My response is that this is not 1983 and there should be either enough DDR to store the entire file or cacheing will make sure that the application can access all of it. Even if the file is cached, then the performance of the app searching the file in cache should be faster than doing lseek's on an open file. I'm trying to think of cases where the guidelines above are not appropriate and the only case I can think of is databases, but chances are that's on a network resource rather than a thumb drive.

    Regardless of whether or not you think my guidelines are appropriate, you can't guarantee that all applications accessing the thumb drive close files after they've accessed them. You could go through and close all applications that are accessing files on the thumb drive, but that doesn't include operating system functions (early versions of NTFS in WinNT never did updates when you thought they would, they got put in a queue and would be done sometime down the line) or virus search apps work the way you want them to.

    So, always click on "Eject".

  16. YES, eject first by thePsychologist · · Score: 5, Informative

    Ever think of testing this for yourself?

    It's easy. Create a half a dozen or more files of random numbers or use existing large files. I created six files of a million random integers in Python. End result, six files of about 6.9MB each. Create an md5 checksum file when you make them.

    Copy them to a USB stick, and then yank the stick right when the light stops blinking. Plug the USB stick back in. Watch and learn. Easily reproducible phenomenon are:
    * Not all files even appear when the stick is plugged back in
    * Some of the files might appear, but give I/O errors and won't even be complete
    * A Few might pass the checksum integrity test

    I'm on Linux Mint, but I have seen the results on other OSes as well. The OS caches the data to be written sometime, presumably to speed up file operations. There's a reason why eject exists.

    --
    "What lies behind us, and what lies before us are tiny matters compared to what lies within us." Ralph Waldo Emerson
    1. Re:YES, eject first by Anonymous Coward · · Score: 1

      Try "stethoscoping" it. Plug in a set of poorly-shielded headphones next to a front-facing usb port; chances are the read/write operations can be head loud and clear as a oscillating buzz.
      In my case it seems to align with what you're describing. The operations don't always end precisely with the indicator light and a few faint blips can be heard right after it's off.

    2. Re:YES, eject first by thegarbz · · Score: 1

      Ever think of testing this for yourself?

      Yes: Look at the settings, notice that caching is disabled by default in Windows and has been since Windows XP was released, and yank away as soon as any file operations are done in explorer or whatever program you just used to save.

      I'm on Linux Mint

      Yes Linux has a bit more trust in the quality of hardware. The most common OSes in the world on the other hand do not cache on removable drives and better still if you do get corruption you will get a big warning message for whatever program was currently writing.

    3. Re:YES, eject first by thegarbz · · Score: 1

      Ever think of testing this for yourself?

      Yes I do it all the time. Bottom line is modern OSes don't cache writes on removable drives so when your file copy operation is finished just yank that cable out and move on with your life.

      The only risk you have is yanking in the middle of an active write and that procedure will net you a lovely error message that a write operation has failed, usually "System cannot find the file specified."

      You won't be silently missing parts of your file system. Oh unless you are using Windows 2000. Also why is your Linux caching writes on removable drives? Do you hate your data that much?

  17. Linux? by Anonymous Coward · · Score: 1

    Not a problem taking it out, but you have to recompile the kernel before you put it in.

  18. Yanking USB Drives by SenseiTim · · Score: 1

    I have accidentally pulled USB drives without unmounting them, fortunately without apparent damage to the files. But I don't make a habit of it!

  19. Just pulling it out is simply dumb by angel'o'sphere · · Score: 2

    First of all: an annoying dialog pops up and an annoying beep comes, you have to close the dialog, probably even with the mouse because ESC or ENTER does not work.

    Secondly, you probably have forgotten that a file is open in Excel or whatever and it is half modified but not fully saved.

    Why not eject it and be safe, respectively be not annoyed?

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    1. Re:Just pulling it out is simply dumb by houstonbofh · · Score: 2

      Pulling it out: doesn't work for data safety, doesn't work for contraception either.

      But which one is the average slashdot user going to be doing daily?

    2. Re:Just pulling it out is simply dumb by thegarbz · · Score: 1

      First of all: an annoying dialog pops up and an annoying beep comes

      Err back in the Windows XP days yes, and even then it wasn't a dialogue, just a tooltip that disappeared.

      Secondly, you probably have forgotten that a file is open in Excel or whatever and it is half modified but not fully saved.

      Assuming that users is that silly, just plug the drive back in again.

      Why not eject it and be safe, respectively be not annoyed?

      You're the one complaining that you had to interact with a dialogue box. By not ejecting I save myself clicks.

  20. It's not only about recently written data by cyba · · Score: 1

    More sophisticated SSDs perform static wear leveling (moving old data to different locations on the disk) in the background. To improve performance, firmware on some disks does this without ensuring atomicity of each operation. It means that in case of unexpected power loss you could end up with seriously broken filesystem. Cheap pendrives are probably not affected by this, but you should be careful when connecting e.g. external SSD via USB.

  21. Trust the people designing an OS know a little... by The+MAZZTer · · Score: 1

    ...more than you do. I say this every time someone claims to know better than the OS designer. For example, memory defragmenting applications, RAM boosters, memory cleaners... if they did good, it would be probably built into the OS already.

    This is a similar case, but even easier to rationalize. The designers went out of their way to warn you and chastise you for yanking out a USB device. They spent time and effort adding these messages in. I would assume they are valid just from that alone.

    Windows in particular I can talk about. Many USB thumb drives are slow especially when you sort by lowest price on NewEgg/Amazon and buy one based on the size of the disk alone. So Windows will avoid using the actual device in real time if it can, instead using a cache. If you write data to the device, the data goes to the write cache first, which is then written to the device as fast as possible in the background. This means that file copy dialog will close BEFORE the data is written to the drive.

    Now, you can access the properties of the drive and change Windows to not use a cache specifically to make it safer to yank the drive at the cost of making things slower. But either way, why? Just choose the Eject option and let Windows tell you when it's safe to remove the drive. Then you can be sure your data is done being recorded. It also lets you know if there is an application still actively using the drive, which is better than yanking it and seeing the application crash or lose data.

  22. My question is, why don't USB drives self-eject? by berchca · · Score: 1

    Why don't USB drives self-eject? I mean, beyond memory size and speed, and the ability to buy one in the shape of sushi, USB drives haven't evolved since their introduction. It would seem like adding a button on the drive itself--one that calls to the system to let it eject--is waaaay overdue (considering the current, boorish way of doing it, which involves using your mouse or keyboard and way too much thought and effort).

    Free idea right here. Sandisk? PNY? Hello?

  23. Catastrophic health care cost by tepples · · Score: 1

    Worst case it's a fortune worth of bitcoin. But i won't die from it.

    That depends on how your country handles health care finance.

  24. Call me a big effin idiot, but... by Bobrick · · Score: 1

    I never, ever "safely" eject, I always yank it out when it's done with a transfer (if transfer there was). Amount of drives/keys/data lost so far is zero.

    1. Re:Call me a big effin idiot, but... by QRDeNameland · · Score: 1

      My rules for ejecting detachable drives are basically this:

      Rule 0: Always have a backup of any files you care about on a separate physical media.

      Rule 1: If it spins, always safely eject it.

      Rule 2: If it's solid state, feel free to just yank it out. Worst case scenario, you bork the filesystem and reformat, and you still have the files because of Rule 0.

      The only times I've ever had any problem with yanking out a thumb drive/SD card are the few occasions I accidentally pulled it out while it was writing, or when I've had a dodgy drive spontaneously go offline due to a bad connection/firmware issue/whatever.

      I'm sure there are other edge case exceptions where you would always want to safely eject a thumb drive; some people mentioned using encryption, but for general use, if you already have good backup practices, the risk is pretty much negligible.

      --
      Momentarily, the need for the construction of new light will no longer exist.
  25. Am I on Fucking Buzzfeed? by bill_mcgonigle · · Score: 4, Insightful

    What are your thoughts on this? Do you think the answer varies across different file systems and operating systems?

    You're kidding, right?

    --
    My God, it's Full of Source!
    OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
    1. Re:Am I on Fucking Buzzfeed? by hcs_$reboot · · Score: 1

      No, SuperUser and Slashdot merged.

      --
      Slashdot, fix the reply notifications... You won't get away with it...
    2. Re:Am I on Fucking Buzzfeed? by weilawei · · Score: 1

      This is pretty stupid, even by Slashdot standards.

  26. You must unless you want to deal with lost data by Artem+S.+Tashkinov · · Score: 4, Interesting

    Safe eject/removal is the only way to guarantee that file buffers are flushed and metadata is in a consistent state.

    If you're OK with losing files, or having chunks of your free space marked as occupied, then don't use safe eject.

    1. Re:You must unless you want to deal with lost data by DaMattster · · Score: 1

      This is true. Especially when write caching is nearly ubiquitous.

    2. Re:You must unless you want to deal with lost data by thegarbz · · Score: 1

      Safe eject/removal is the only way to guarantee that file buffers are flushed and metadata is in a consistent state.

      If you're OK with losing files, or having chunks of your free space marked as occupied, then don't use safe eject.

      I'm not OK with getting hit by a car, yet I still J-walk. Likewise just because you yank the drive doesn't mean you will lose data. This was an issue back in the 90s when OSes write cached on removable drives, but seriously if you're not mid-write to the device then yank away. If you are mid-write you'll get an error message and typically get the opportunity to put the drive back in and go again.

  27. Might as well.. by Junta · · Score: 2

    Err on the side of caution. Etiher:
    You don't need to because the system isn't caching writes, in which case the result is instant
    The result is slow, which means you need to do the 'eject' procedure.
    Practically speaking, modern OSes have gotten the point, a small usb attached storage device is at high risk to be yanked out, so they disable write caching by default.

    --
    XML is like violence. If it doesn't solve the problem, use more.
  28. You'd think. Theory vs practice. Undervoltage by raymorris · · Score: 1

    You'd think the partition table would be pretty darn safe since it's rarely updated. Yet, I've had to help people recover from lost partition tables many times. You can do forensics to discover where the partitions were, such as by looking for blovks that match the beginning of a filesystem, and for the first partition, testing the defaults.

    One potential reason for this is that electronics designed to work at five volts can do literally ANYTHING when they have 2.5 volts supplied. You may notice some devices go a little crazy when the battery is very low. As you disconnect a drive, there are several milliseconds in which the chips get lower than specified voltage.

      Also the data lines are of course digital - on or off. As you pull the plug out and the contacts scrape against each other, an oscilloscope with show they connect and disconnect several hundred times - turning on and off, generating random ones and zeroes. There are some features designed to *reduce* these risks.

    1. Re:You'd think. Theory vs practice. Undervoltage by vtcodger · · Score: 1

      "Which is why the drive keeps moving it around in the course of wear leveling."

      Exactly. The partition table (if there is one) is in the Master Boot Record which is the first record on the device. Address 0. Even though it's rarely written, it's a solid candidate to get overwritten/lost if anything goes wrong.

      --
      You can't see ANYTHING from a car, You've got to get out of the goddamned contraption and walk...Edward Abbey
  29. It used to work in XP by necronom426 · · Score: 1

    I always have write caching turned off. Windows has the Quick Removal option, so why would it be there and be called that if it wasn't there to allow you to pull it out?
    I never ejected a flash drive in XP and never had a problem. In Win 7 I almost always do, as it doesn't seem to work properly, but at work we have a Win 10 laptop and 90% of the time it doesn't allow me to eject (warning message pops up), so I have to either reboot (yeah, right), or just pull it out and hope for the best.

    Why don't flash drives work the same as floppy disks? We never had a problem ejecting those.

    1. Re:It used to work in XP by jittles · · Score: 1

      I always have write caching turned off. Windows has the Quick Removal option, so why would it be there and be called that if it wasn't there to allow you to pull it out? I never ejected a flash drive in XP and never had a problem. In Win 7 I almost always do, as it doesn't seem to work properly, but at work we have a Win 10 laptop and 90% of the time it doesn't allow me to eject (warning message pops up), so I have to either reboot (yeah, right), or just pull it out and hope for the best.

      Why don't flash drives work the same as floppy disks? We never had a problem ejecting those.

      Write cache is the default. I don't know if you can even disable it in Windows 10 but there was an OS bug that made it difficult to eject USB drives. That has recently been fixed.

  30. Re:My question is, why don't USB drives self-eject by Junta · · Score: 1

    Because adding a button and indicator to show completion means cost and ruining the 'minimalist' design point they are going for. Further, they know consumers will likely ignore that anyway, and that OSes have given up write-caching for removable storage anyway.

    --
    XML is like violence. If it doesn't solve the problem, use more.
  31. Scraping the connections to delicate chips by raymorris · · Score: 1

    "Unlikely" might be a better word than "absurd". The physical cmos chips associated with ports are delicate. They don't like voltages that are too high, too low, or change to fast.

    As you pull a connector out, the power and data pins scrape against each other, causing them to connect and disconnect a hundred times in a hundred milliseconds. Having power switching on and off randomly while the data lines are active transferring data can be bad.

    It's probably not LIKELY to cause damage if you do it once, but the possibility isn't absurd.

  32. Re:Trust the people designing an OS know a little. by Junta · · Score: 2

    Well, here it's a bit of an evolved situation, and one that evolved with the general state of storage.

    Once upon a time, OSes didn't bother to cache writes, they just wrote to disk and were done. Computer could just turn off at any time (parking hard drives manually aside). Memory was too scarce.

    Then memory was more plentiful and OSes became more sophisticated, disk IO then presumed caching, and shutting off your system without proper shutdown was exceedingly high risk. Removable media came into fashion with this sort of accepted behavior, so they had to be very verbose about users doing it wrong.

    Fast forward a bit and the industry realizes that they can't expect clean ejects/shutdowns, so they make better filesystems, maybe losing data but at least not be corrupted and disable write cache on usb disks by default, causing slower apparent behavior, but resilient to yanking out.

    It's always a good idea to err on the side of caution, but the current OS designs around ejecting media are less critical because they've decided it is a lost cause.

    --
    XML is like violence. If it doesn't solve the problem, use more.
  33. Re:My question is, why don't USB drives self-eject by loonycyborg · · Score: 1

    You mean making them work like CD-Rom drives? I guess they didn't want to make them work like that to make things simpler.

  34. There's a risk to not "ejecting" a USB drive by Anonymous Coward · · Score: 1

    Some operating systems treat removable devices differently: By disabling write caching, they reduce the risk of having outstanding writes when the user believes that the drive is idle. With modern filesystems, there's theoretically the possibility of keeping the drive in a consistent state even if it is yanked from the computer mid-write. FAT32 however, which is still the most commonly used filesystem on USB thumbdrives, is not a modern filesystem. There's also a difference between a valid filesystem state and data corruption. It would take a completely transaction-based filesystem to remove the need for unmounting a filesystem, and the USB drive would need to also be designed to complete some work even when it is unexpectedly removed from the computer. So, while it is technically possible to make hard- and software that does not need a clean unmount, in actual practice you're going to corrupt the data, the filesystem and possibly even damage the hardware at some point if you don't tell the OS to "eject" the drive.

  35. Would you Power Off before Shut down? by mykepredko · · Score: 1

    Just thinking about this, it's really the same question - when you power down your PC/laptop/whatever, do you hold the power button down for five seconds to shut it down or do a "System Shutdown"?

    It's really the same thing when you apply to USB thumb drives.

    1. Re:Would you Power Off before Shut down? by houstonbofh · · Score: 1

      Just thinking about this, it's really the same question - when you power down your PC/laptop/whatever, do you hold the power button down for five seconds to shut it down or do a "System Shutdown"?

      It happens every time Windows decides to update while on batteries... :)

  36. Eject is just below delete by wolfheart111 · · Score: 2

    Windows is funny like that.

    --
    [($)]
  37. Eject programmers from HMI design by Impy+the+Impiuos+Imp · · Score: 1

    This is the result of OS programmers throwing wrappers around internal APIs instead of designing a product.

    How about the OS make yankable the default state, with an indicator light on the task bar, window bars, etc. For that matter computer makers can put a tiny LED by the front panel USBs to signal this too, assuming you can even see it amidst glowing coolness everywhere.

    Tbe user knows they are done copying, so can wait for the OS to signal so.

    --
    (-1: Post disagrees with my already-settled worldview) is not a valid mod option.
  38. Now Apporoved by majopr educational institutions! by Hognoxious · · Score: 3, Informative

    I don't have a clue, but I'm sure Wikipedia does!

    --
    Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  39. What are my thoughts on this? by QuietLagoon · · Score: 4, Informative
    Simple: wow, I am surprised how low the once great Popular Science has sunk. Oh, you mean about the USB stuff... well...

    ...The magazine's take on it -- which is, as soon any ongoing transfer of files is complete, it is safe to yank out the flash drive ...

    The problem is that you do not know when the transfer is complete. The UI's representation of it shows when the UI is done with the transfer, but that does not necessarily mean that the OS is finished with the transfer. So Popular Science is correct in that you have to wait until the transfer is complete, they are just incorrect about what tell-tale to use to determine that status.

    1. Re:What are my thoughts on this? by TeknoHog · · Score: 3, Interesting

      The problem is that you do not know when the transfer is complete.

      I'm also baffled about this level of idiocy in a /. article. I guess things that were obvious to us geeks 15-20 years ago are completely new to today's "digital natives".

      That said, these things only became obvious to me when I moved to Linux back in the day. I learned about things such as mounting filesystems and a lot of other fundamental machinery that must be going on in Windows too, but it's hidden from the user. But there are these occasions when you absolutely need to unmount.

      Back in the days of Windows 3.1, writing to floppies would halt everything else, and it would be clear when the transfer was complete. There was not much multitasking or write caching going on anyway, so it was OK. Today we take those for granted, but in turn it means we need to be explicit about ejecting devices.

      The point about spinning hard drives is somewhat orthogonal, though. Simply unmounting the drive won't power it off. So you often need to yank the plug out while the drive is spinning. This can be hard to do safely with small drives and short cables.

      --
      Escher was the first MC and Giger invented the HR department.
    2. Re:What are my thoughts on this? by thegarbz · · Score: 1

      The UI's representation of it shows when the UI is done with the transfer, but that does not necessarily mean that the OS is finished with the transfer.

      What is this a post from the 90s? OSes handle external drives differently from your internal HDDs. write caching is disabled and changes are instantly committed to disk without delay. Hitting the 100% point and yanking the drive has been safe for data since Windows XP was released.

    3. Re:What are my thoughts on this? by thegarbz · · Score: 1

      Today we take those for granted,

      No we don't. We haven't for the past 17 years. File operations are completely the second they are completed on removable drives. Only internal drives do agressive performance optimisations like write caching that creates a disconnect between the state of the write and what is shown to the user.

    4. Re:What are my thoughts on this? by DamnOregonian · · Score: 2

      No, you simply don't understand what it's reporting. And that's ok, you're a generally ignorant human.
      You see, kiddo, the modern OS has many layers stacked upon each other.
      Your application submits I/O to a syscall, the syscall hands it off to the VFS subsystem, which then hands it off (maybe) to the filesystem, who then hands it off to the I/O scheduler, who then hands it off to the device driver, who then hands it off to the device. Here's where it gets extra cool- your device may be ultra dumb (floppy, single FIFO, blocking) to a TCQ SATA/SCSI device, to an eMMC performing wear leveling, sector size emulation, and coagulation in the background.
      In the middle, we have all kinds of potential transforms, reordering, and write-combining. It's a mess, really. The software machinery involved for high-speed I/O would blow your mind, I think.

      We try very hard to make sure people smarter than you are designing the systems so that this whole thing doesn't go awry. We do understand though that you can be easily confused by this UI widget saying it's done, when that eMMC chip in that USB flash drive is erasing a sector to concatenate your last bit of data with the incomplete sector write of the preceding bits, and so we have offered you a mechanism by which to safely eject these devices. If you're too stupid to use that feature, we can't help you further.

    5. Re:What are my thoughts on this? by zwarte+piet · · Score: 1

      The smart devices have their on board cache, often multiple layers of caching, like in the case of an ssd a cache in ram caching a cache in very fast flash caching the main flash. Some of these also have super caps on board to provide that second of power to flush at least the ram cache.

    6. Re:What are my thoughts on this? by DamnOregonian · · Score: 1

      Beyond that, the devices are emulating behavior that who's behavior doesn't translate linearly to the operating system.
      Flash devices do not operate atomically on 512 byte sectors. USB drives do.
      The flash devices typically have 4K (or larger) write sector, and 16K (or larger) erase blocks.
      A lot of magic must be performed in order to write a 512 byte sector to the middle of a 4K already-written flash sector that can only be erased along with 16K worth of sectors around it.
      These are still being done when the controller returns and says 'I can accept more data, now.'

    7. Re:What are my thoughts on this? by DamnOregonian · · Score: 1

      Nope. It was a lot of words to say, 'you don't understand what it's reporting'.
      It is reporting the progress of that userspace transfer to the kernel, nothing more, nothing less. It doesn't account for any OS cachine, device cache, or asynchronous device behavior.
      That makes it somewhat confusing, it's true, but that's what it reports. And it does not lie in that reporting.

    8. Re:What are my thoughts on this? by zwarte+piet · · Score: 1

      Yeah, these things have more processing powder than most pc's from a while back.

    9. Re:What are my thoughts on this? by zwarte+piet · · Score: 1

      powder, lol

  40. Re:My thought by houstonbofh · · Score: 1

    Why is it doing background operation without notifying the user?

    Because the data-mining is supposed to be a secret!

  41. Re:My thought by Anne+Thwacks · · Score: 4, Informative
    You might be using a file system called FAT - which stands for "File Allocation Table" and is only partially connected with overweight files and the concept of bloatware.

    The FAT is a table (bit map of sectors in use) which says which parts of the disk are in use, as well as where the files and their parts are stored. There are also flags saying if the file system (partition) is in use, and if it has been modified - and probably other things (I was last involved in this in about 1990).

    When you eject, the system stops making the changes you requested (reads and writes), and updates these tables to a consistent state (well maybe not all that consistent, if its Windows, and completely inconsistent if DOS 4.0), and then clears the dirty (modified) and Open (in use) flags for each partition.

    If the eject procedure fails to complete, and the dirty flag is set when you next try to use it, the OS will try to clean up the mess - it may succeed, or trash the data, and report success, or it may fail and tell you the system is dead.

    With USB sticks, the data you see is not the real data. Because of the need to hide the bad blocks, and hideously long write time, the OS sees virtual data, and operates on virtual data. The real data is different. A single bit change (eg clear the dirty bit) could end up requiring three or four copy and write operations, operating on massive amounts of logically unrelated data, unknown to the OS. If you trash those, the OS for the CPU in the USB stick will be utterly bamboozled, and you have no interface to tell it to do a factory reset, so you USB stick is dead.

    (Actually, the underlying interface to the USB stick is SCSI, and there probably is a SCSI command that would unbrick it, but you can be damned sure that the manufacturer won't tell you what it is, because if he did, you would not go out and buy another USB stick, would you?)

    --
    Sent from my ASR33 using ASCII
  42. is it 1998? by Hugh+Jorgen · · Score: 1

    why the fuck is this a topic of discussion in 2018?

  43. I usually do by jason777 · · Score: 4, Interesting

    I always eject it, but sometimes it says its in use and won't let me. But I want to pull it out NOW, so too bad its getting yanked out.
    I also use a program called Hotswap! that ejects alot better than the windows one, AND lets me do sata drives and things that normally don't show up in the windows eject.

    1. Re:I usually do by thegarbz · · Score: 1

      AND lets me do sata drives and things that normally don't show up in the windows eject.

      This is the great irony. The things that show up in the Windows Eject are also the things that are safest to simply yank because they have write caching disabled. The same cannot be said about SATA drives where you may have absolutely no idea if data has been committed to disk or not.

    2. Re:I usually do by jbmartin6 · · Score: 2

      This drives me nuts. Windows STILL has no mechanism to tell me which process is supposedly using the drive. So yes, it gets yanked. Windows claims the drive CAN'T be ejected. Go to hell Windows, I say it can.

      --
      This posting is provided 'AS IS' without warranty of any kind, implied or otherwise.
    3. Re:I usually do by jason777 · · Score: 1

      I'm pretty sure Hotswap! flushes the cache and makes it safe. But you do need to have it plugged into a controller thats hot swappable. I do this with sata drive that plug into the caddy built into my case.

  44. It's there for a reason by quonset · · Score: 1

    Just like a parking brake on a car is there for a reason, the option to safely eject a USB drive is also there for a reason.

    But don't let that stop all the experts on here and elsewhere from saying otherwise.

  45. Re:Trust the people designing an OS know a little. by houstonbofh · · Score: 1

    ...more than you do. I say this every time someone claims to know better than the OS designer.

    As someone who has actually written software and contributed to many projects; No! Do not trust me! I still remember when a major release of my software hit slashdot, and one of the first comments was "Why can't I see any logs?" Yes, I made a stupid build error that hosed logs. I was able to push a new release the next day with that fix, but it took someone not trusting me to find it first.

    Also, the Metro Interface proves that the designers are often drinking better stuff than we can afford.

  46. Re:My question is, why don't USB drives self-eject by houstonbofh · · Score: 2

    You mean making them work like CD-Rom drives?

    You mean where the button ignores you and does not eject the disk. Or starts to and teases you and then closes again? Like that?

  47. Sync and unmount. by Ungrounded+Lightning · · Score: 4, Informative

    Copy them to a USB stick, and then yank the stick right when the light stops blinking.

    Two functionalities are key: Sync and unmount.
      - Sync forces the filesystem to complete all in-RAM updates to blocks, write the blocks to the driver, and forces the driver to flush all pending writes to the backing store. Issuing a "sync" kicks off activity that insures the data for the current state is all on the backing store when the activity is completed. (And manually issuing two of them insures the first one is completed before the second command returns.)
      - Unmount also tells the filesystem to get all files closed, go to such a state (including updating a flag saying it isn't mounted, if that is part of the filesystem) and write this all to the store.

    Unixes and linux are usually configured to issue syncs periodically. So if you write new stuff to your filesystem, and your filesystem/driver combination isn't one that tries to always force the data to the store right away, you'll see the activitly light go out when there's still important stuff in a last few buffers which AREN'T written yet. (For a new file, on some filesystems, that will include the metadata about the file, which got finalized when it got closed and thus is the last thing changed.) Pull the store now and important stuff about these new files is incomplete or missing, even if they've been closed (so the last buffer of data is complete and queued to be written).

    When this happens, if you wait around a short time, and the periodic sync will force it out to the store. But it might be so few blocks that you don't see the activity light blink. Pull the store after that and it will have the file data and metadata for the new, and closed, files. But the filesystem image will still be in a "mounted" state, so remounting it will require at least some filesystem scan (very short for journaling filesystems) and may generate a gripe from the OS.

    Unmount (then sync;sync, though unmount seems to do that for you these days) and you guarantee that the backing store is clean and ready to go. Eject does that for you (or gripes if it can't because there are sill things in use by live apps) before it actually ejects the storage medium or tells you you can safely remove it.

    --
    Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
    1. Re:Sync and unmount. by drinkypoo · · Score: 1

      Unmount (then sync;sync, though unmount seems to do that for you these days)

      And it always has done, on every Unix and Unixlike I've ever seen. On the other hand, there have been Unixlikes which don't sync before shutting down, which is why on SCO Xenix it used to be the habit to sync twice before issuing the 'haltsys' command. That way, the time you spent typing sync the second time would let the first sync finish :p

      I sometimes like to sync before I umount, just so that I know how long it took to sync. But it should never be necessary on a modern system.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    2. Re:Sync and unmount. by Ungrounded+Lightning · · Score: 1

      On the other hand, there have been Unixlikes which don't sync before shutting down, which is why on SCO Xenix it used to be the habit to sync twice before issuing the 'haltsys' command. That way, the time you sent typing sync the second time would let the first sync finish

      On the really early unix boxes (like the one I had in the mid-80s). the ritual was "sync;sync;sync;halt".

      First sync dumps most of the stuff. But various hair including adding the "sync" to the log of superuser activity immediately made things out-of-date again. Second sync pushes that out, too. But its logging just grows the file a little more. Third sync ditto but it's just there to make sure the second sync is fully done before the halt gets launched.

      --
      Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
  48. You need to be careful ... by CaptainDork · · Score: 2

    ... so just eject the goddam thing.

    --
    It little behooves the best of us to comment on the rest of us.
    1. Re:You need to be careful ... by thegarbz · · Score: 1

      You need to be careful of cars, so don't ever cross a road. So just use tunnels.

  49. Software fix by gurps_npc · · Score: 4, Interesting

    The computer should simply have a symbol on the taskbar/similar area that says when it is safe to remove the drive or not.

    --
    excitingthingstodo.blogspot.com
    1. Re:Software fix by RhettLivingston · · Score: 3, Insightful

      The problem is, it could change back to unsafe as you're pulling it. Computers operate at speeds way to fast for this. You'd have to do something like have a green light, yellow light, red light system where writes wait until a yellow light has been shown for a couple of seconds before they start. That would destroy performance.

    2. Re:Software fix by Stormbringer · · Score: 1

      Mine does. I run TrinityDE; USB drives show up as icons on the desktop. When I context-click "Safely Remove", the system syncs and unmounts the drive if there's no busy-connection holding it open. The drive's icon disappearing from the desktop is my signal that the drive is cleanly unmounted and safe to pull out.

    3. Re:Software fix by thegarbz · · Score: 1

      The computer can't know. This can change in an instant.

    4. Re:Software fix by DamnOregonian · · Score: 2

      Oh, I hope it does more than sync and umount, because that isn't enough to guarantee the disk is in a safe state to remove. It must also disconnect it.
      The back-end storage chips on most USB sticks have rather complicated behavior to make those flash chips behave anything like a disk drive, and that behavior often requires the controller keep working in the background. Only a complete moron pulls the power from a USB stick before safely ejecting it. Sure, he may dodge the bullet most of the time, but you only have to zip up your pecker once to realize you were taking a stupid risk not checking in the past.

  50. Lost a 5 TB Drive by rally2xs · · Score: 1

    ...by simply disconnecting it from USB. Completely corrupted. Got it back by reformatting, but the data was toast. You simply yank it out with a risk of losing everything on it. Stupid computer says its in use, I simply shut down, disconnect, reboot. I won't ever just disconnect again.

  51. That doesn't really help by Solandri · · Score: 5, Insightful

    Because all it does is change the choice to "Do I eject the drive properly, or do I check to make sure "quick removal" is enabled and then yank the drive?" Unless you already know it's been set (i.e. you personally set it previously for this drive for this instance), the latter takes more time than ejecting.

    The #1 cause I've seen for corruption of data/partition information on USB flash and external HDDs is yanking it out too quickly, just before the copy has finished. In theory a journaling filesystem like NTFS should be immune to damage from this. But for some reason it occasionally seems to corrupt the partition table making the entire contents of the drive inaccessible unless you're skilled enough to repair it manually (usual cause seems to be the partition type number got changed).

    That's a 10 minute or so repair process if you know what you're doing. If you don't, it's probably 30-60 minutes downloading the tools and stumbling around trying to figure it out. And if you obeyed Windows when it popped up the "You need to format this disk before you can use it" message when you plugged the drive in again, and formatted it, now you're looking at several hours for file recovery with no guarantee you'll be able to recover everything. (They really need to add a second line to that message saying that formatting will destroy any existing data.)

    All this risk and time wasted just to save a few seconds by not ejecting. So I advise people to always eject the drive before yanking it. The seatbelt analogy is very appropriate. It takes very little time to do, but the rare consequences if you don't do it can be devastating.

    1. Re:That doesn't really help by OakDragon · · Score: 1

      Car analogy for the win.

  52. Always safely remove but by NormAtHome · · Score: 1

    I've also found that the quality of the drivers for the USB 2/2.1/3/3.1/ESATA port also matter on how well the eject process works or doesn't. (Intel USB ports with genuine Intel drivers works the best in my experience) I'm still using Windows 8.1 but I'm aware that many hardware vendors of USB 3/3.1 chips don't make drivers for Windows 10 and just rely on the generic Microsoft drivers which I've seen have performance issues and other strange problems.

    Another problems I've often seen in Windows 8.1 (but not sure if Windows 10 has the same issue or not) is that some system process locks the drive and prevents an eject command and I've often times waited an hour or more and still can't eject the drive. I've tracked down the process using Process Explorer and killed it and then been able to eject the drive; however a significant number of times that USB port then fails to work until reboot.

    All in all I'd have to say that while USB and ESata are great there are still lots of issues that are not resolved when it comes to Windows and removable drives and Intel / Microsoft (and any other chip vendors) have failed to address these lingering problems.

  53. Re:sync; by Wheely · · Score: 1

    sync && sync

  54. Re:My thought by Darinbob · · Score: 4, Insightful

    The solid state USB drives essentially have their own mini OS that controls things. You have to give that a chance to get to a reliable state.

  55. Re: My thought by guruevi · · Score: 3, Insightful

    The OS should set those flags whenever the write operation has completed, not wait until a "clean shutdown" happens. There are lots of things that can happen between the file write and the time the partition gets unmounted (eg power or controller failure), not accounting for technical issues is a flaw.

    --
    Custom electronics and digital signage for your business: www.evcircuits.com
  56. Unmoutning is not enough by xarragon · · Score: 1

    For spinning disks, you should also power down the drive before disconnecting it. Failing to do so will force the disk to perform an emergency head parking, using the inertia of the spinning disk platters. This causes abnormal wear on the drive and shortens the lifespan.

    Under Linux you can power down the disk using this command:

    $ sudo udisksctl power-off -b

    I use this alias in my .bashrc file:

    alias diskpoff='sudo udisksctl power-off -b'

    Example: $ diskpoff /dev/sdb

    1. Re:Unmoutning is not enough by jetkust · · Score: 1

      You should also shut down the computer. Reseat all connections in the motherboard. Wait 3 days. Have an electrician check the voltages. Once he gives the go ahead, reinstall the operating system. Then go into a clean room temperature controlled at 16 to 19 degrees Celsius and 50% relative humidity. Only then shall you remove the usb drive. But remember, you should never read from that drive again, as you will risk completely destroying it. And will have to restart the entire process.

  57. Drag To The Trashcan? by Bing+Tsher+E · · Score: 1

    Do macusers still eject media by dragging it to the trashcan? I always found that a pretty humorous metaphor about what the 'mac experience' thought of the world outside it's bondi-blue enclosure.

    1. Re: Drag To The Trashcan? by Bing+Tsher+E · · Score: 1

      The 'throw it away' metaphor isn't mind-blowing. It seems staggering stupid the first time you see it in play.

  58. I never do by DarrellBFI · · Score: 1

    ...and I've never seen anything adverse when I don't.

    --
    Social Media Mgr at Bluefield Identity
  59. Re: "What is âoesyncâ"? by adrn01 · · Score: 1

    Google translate failed to properly auto-detect language, but guessing Greek returns "That's why"

  60. Re:My thought by Kaenneth · · Score: 1

    transactional writes.

    a well designed system shouldn't allow a bad state to be possible (barring cosmic ray/claw hammer type external events)

  61. Eject safely. by antdude · · Score: 1

    I always tell my computer to safely eject to finish its usage. However, it bothers me when SOME OSes won't let me safely eject because it says it is in used. I check and I see nothing in usage. These were with external USB HDDs. :(

    --
    Ant(Dude) @ Quality Foraged Links (AQFL.net) & The Ant Farm (antfarm.ma.cx / antfarm.home.dhs.org).
  62. Follow the advice given by viperidaenz · · Score: 1

    Follow the advice from the OS. That's the software that is controlling the physical writes to your USB device. It's the software that's caching not only the file data, but the filesystem data too.
    If you didn't need to eject your USB device before pulling it out, the OS wouldn't tell you you've done something bad when you do it.

  63. Re: My thought by PetiePooo · · Score: 1

    The OS should set those flags whenever the write operation has completed, not wait until a "clean shutdown" happens. There are lots of things that can happen between the file write and the time the partition gets unmounted (eg power or controller failure), not accounting for technical issues is a flaw.

    Where's my mod points when I need them

    I'd long wished that removable media was ROW (read-remount on write) and automatically switched back to ROI (read-only on idle). Once it automatically changed read-enabled state, a system tray (or menu bar on macs) icon could indicate when it's safe to unplug.

  64. I just pull the damn thing out. by gestalt_n_pepper · · Score: 1

    An frankly, anyone who would design a drive to work any other way should have been fired.

    --
    Please do not read this sig. Thank you.
    1. Re:I just pull the damn thing out. by jetkust · · Score: 1

      Truth. Pretty much how I feel about it. People saying they corrupted their drive because they pulled the damn thing out are just assuming that had anything to do with it. Anytime I had a usb drive go corrupt (maybe 2-3 times) they were all mysteriously sandisk drives, which I don't really use anymore.

    2. Re:I just pull the damn thing out. by DamnOregonian · · Score: 1

      Fortunately, it would appear that the people in charge of such decisions are a lot smarter than you.

    3. Re:I just pull the damn thing out. by gestalt_n_pepper · · Score: 1

      If by "smarter, " you mean "tolerant of bad design" and "utterly unaware of real life human behavior or how the human nervous system works," then I guess you're right.

      --
      Please do not read this sig. Thank you.
    4. Re:I just pull the damn thing out. by DamnOregonian · · Score: 1

      No, I mean smarter.
      The design is as such for reasons that are clearly beyond your comprehension. That doesn't make it bad. It makes you ignorant.
      If you can't be bothered to use the product correctly, that's fine. But you're the idiot, not them.

  65. My experience.. by Colourspace · · Score: 1

    Lost the valuable contents of a flash drive 10 years ago due to not doing this (still on XP at the time I think). My brother thought I was an idiot for 'ejecting' a drive when I mentioned it a short while later as he had 'never had a problem just yanking it straight out' - good for him - I lost two days work. Interesting to note Win10 doesn't seem to offer the option anymore so (not being an OS guy) I wonder whats changed in that respect?

  66. The malware rule by Tablizer · · Score: 1

    You should always do it properly because there may be malware half-way writing itself when yanked, and damaged malware can prevent reading of the drive. Most malware wants to snoop, not crash.

  67. Like driving without a seat belt? Really? by bheerssen · · Score: 1

    First, this is nothing like driving without a seat belt. If I yank a thumb drive from my computer without "safely" ejecting it, I am not going to suffer any personal injury. The worst that could happen is I maybe have to reformat the drive. Big deal.

    --
    (Score: -1, Stupid)
  68. Re:My thought by thegarbz · · Score: 1

    While you are technically correct, all of this happens before a write operation is completed in Windows. When that little bar hits the 100% mark you can happily yank away without any concern for your data.

  69. Writing a huge file to a spinner USB drive by Babel-17 · · Score: 1

    Or just when the drive had just gone done being busy with lots of reads and writes. I was reading just a while back that even some spinning drives are over provisioned, and the drive might use that as a cache. I guess it could get iffy if the drive got yanked while it was finalizing the process. One other thing. IIRC a drive with a good controller will do some housekeeping by way of checking its integrity from time to time. It might "resent" being interrupted while marking a sector bad and transferring its data to a good one.

  70. Re:My thought by Darinbob · · Score: 1

    Of course. Good luck knowing if the USB drive you have is well designed or not.

  71. I just remembered, disable write caching by Babel-17 · · Score: 1

    Go into Device Manager in Windows and if you disable write caching for the USB drive (set it for Quick removal) Windows indicates you no longer need to use the Safely Remove Hardware Notification icon. Well, that's the theory anyway, the drive's controller may in fact be doing something that shouldn't be interrupted.

  72. YES!!! by FudRucker · · Score: 1

    in linux for sure, for example you mounted a USB thumbdrive, and maybe use the commandline or midnight commander's two panel file manager to select and copy files over to the thumb drive, or any file manager for that matter, then close the file manager, and you run the umount command, notice it hangs and does not give you back your command prompt? its because it is either not actually done writing the files over or the journal, and if you just yank it out the files on that thumb drive will more than likely be corrupted, just wait until the commandline prompt comes back before unplugging the thumbdrive

    --
    Politics is Treachery, Religion is Brainwashing
  73. Dumb question by thadtheman · · Score: 1

    When you ask to eject the system does one thing. It unmounts. When the system unmounts it does three things: 1) It checks for open files. 2) It syncs aka It flushes the buffers. 3) It makes sure the drive is in a state that it can be disconnected--any work the devicee is doing is done. Aside from 3. 1 turns out to be very important. Often times when I eject, I'm told I can't. When I issue a lsof ( list open files ) command on that drive, I get the some process which I go through. Sometimes it's some sort of zombie. Most of the time I have a shell that is open on a directory in that drive. But some of the times I have a file open in a process that I forgot about. Other times it's a process that opens a file in it's background that i don't know about. Then unmounting the drive saved me from losing data or corrupting a program accidentally, by making sure the programs using that drive were all properly shut off. Asking the system to ejeect saved my ass. As for 2. I've practices like flushing buffers come and go. There was a reason that buffering and flushing were implemented. maybe in this go around, that reason is no longer valid and you may not need to eject to make sure that buffering is properly flushed. Fine. But what I've learned is that it is likely that sometime in the future, the next generation of even faster practices will require you to once again have to be sure that the buffers are flushed. Teech goes that way, back and forth between practices. THe safer thing to do is to request an eject from the OS.

    1. Re:Dumb question by Punknubbins · · Score: 1

      All external storage has some volatile receive buffer space in ram, or even on chip cache. And while 1 and 2 in your list are likely unimportant, for the most part, the biggest problem is if you disconnect power before the device has a chance to optimize the data and write it out to the persistent storage. Depending on the speed of the storage controller, how big the on-board buffer is, and how much work it is doing to optimize the write, and how fast the actual write can be performed, it can take several hundreds of milliseconds or more to finalize the last write operation. Look at modern spinning drives and you will see some that have a few hundred megabytes of cache, and it can take several seconds for the cache to be written to disk even after the OS believes the transfer has completed. The only real solution is to add rechargeable power backup to the device so that you can guarantee that even if the drive is disconnected it can finish writing the data in memory to disk before it shuts down.

    2. Re:Dumb question by DamnOregonian · · Score: 1

      Inaccurate.
      The system unmounts, and then disconnects the device. This is so that the device can finish up any tasks it may be doing before the user violently removes its power source.

  74. Wrong Question by SeattleLawGuy · · Score: 1

    From the user POV, the question is whether the data is important. If it's important, of course you eject it safely, just in case somewhere in the dozens of layers of engineering involved between generating the data and writing it to disc, there's some issue that arises that happens not to work correctly if you pull it out unsafely.

    If it's unimportant data, who cares?

    From the engineer's POV, you have to assume some users will pull it out unsafely, so you make it as safe as possible to remove it unsafely, balancing that against the need to keep the write speed from being unacceptably slow.

    --
    Real lawyers write in C++
  75. Stop assuming users will follow simple procedures! by Punknubbins · · Score: 1

    The truth is that if a device manufacturer is hiding a background process out of sight of the user and the OS then it should be built with suitable backup power, in the form of a small battery or ultra capacitor, to guarantee that the data in ram is flushed to persistent storage. I understand that this would be easier to do with flash drives then external spinning disks, but you could still probably make a spinning disk reliable with a small lithium ion cell, like a 14500, hidden in the case. Any "routine" or "common sense" procedure that can be eliminated with a simple hardware fix is not in the best interest of the end users. It is the same reason microwaves automatically shut off when you open the door instead of having a warning in the manual that you may suffer microwave burns if you fail to turn off the microwave before removing your food.

  76. You know that dentist's saying? by Hallux-F-Sinister · · Score: 2

    Eject anything that there's a provision in the OS to eject (meaning un-mount from the filesystem, in the UNIX sense,) before electrically disconnecting it by unplugging it from the system. Anyone who tells you to do otherwise should not be listened to, because he/she/they/it/etc. does not know what he/she (etc.) is talking about. Even if the device has an activity light on it, data could become corrupted, or the device could be damaged, or both, if you unplug it unexpectedly.

    The problem most people fail to consider is that on a device with an indicator (an LED, generally) you have no idea when the device is actually working, and no idea when it's about to receive data. For example, you think your USB device is not in use, not being written to, not receiving data, and that it is therefore safe to unplug it. So you grasp it with a thumb and forefinger, and begin to pull. Your reflexes are typical of a human being, meaning you are capable of discerning events of as short as between a 10th and a 30th of a second in duration, and also that limitation restricts the speed with which you can respond to visual stimulus. So let's say you start to tug on the device. At that moment, your computer decides it's a good time to write data to the device. The computer sends a signal and the device realizes the computer is talking to it, (if I can anthropomorphize it a little,) and it then dutifully sends a pulse of electricity to light up the LED. HOWEVER, by the time the light from the LED reaches your eye, strikes your retina, travels to the occipital lobe of your brain, where it is processed and passed to your cerebral cortex, and you become conscious of the fact that the light has come back on, it's too late to stop the muscles of your fingers, hand, and arm, which are already yanking the device out, as data was being written to it.

    Further, you have no way of knowing absolutely that you can depend on the little LED to come one ANY amount of time before writing to the device commences. None. Beyond that, some USB thumb drives, like some PNY and SanDisk I've seen, literally HAVE no indicator LED so there's no real way to know whether the thing is being written to, or if it's even mounted somewhere on the filesystem or not, without actually consulting the filesystem itself through, for example, looking in your file-manager/browser to see what's mounted, or dropping to an xterm and issuing the "mount" command, or doing something similar with a disc-management utility.

    It may seem unlikely the thing would spontaneously start writing without the computer actievly working on something, but you don't actually KNOW if it is working or not, LED lamp or no, and it would only be safe to assume if you somehow knew exactly what your computer's kernel's filesystem driver was doing, knew at any given moment what was being prioritized and what put off until later, etc. Also, there could have been files that couldn't be FINISHED being written until some portion of the middle of the file was ready to be written. Perhaps a file began being written, and then some issue arose and the program or application concerned had to pause to ask you something, and couldn't proceed, but that application had been relegated to the background, was minimized, etc.

    There's a saying that goes, "only floss between the teeth you want to keep." Similarly there's a saying that goes "only pull a flash drive out of a USB port when there's no important data on either the computer, or the flash drive, and you don't care about what happens to either." (Never heard that one until today? Well, it's a relatively new saying then, but it is a saying now, so...)

    Incidentally, computers and peripherals used to come with instructions to shut everything OFF before plugging or unplugging ANYTHING, even a peripheral like a printer or a keyboard. Not powering everything completely off could result in damage to the equipment, or risk of electric shock, fire, or rattlesnakes armed with sub-machine guns suddenly falling from the ceiling and atta

    --
    Our reign has gone on long enough. Indeed. Summon the meteors.
  77. Re:Stop assuming users will follow simple procedur by DamnOregonian · · Score: 1

    Really? Because in my opinion, the truth is that you should just use the device as the manufacturer recommends, which is properly shut down the device before removing its power.

  78. Re:Anyone with basic knowledge of operating system by DamnOregonian · · Score: 1

    Bingo. Mod this coward up. He's got more knowledge than 80% of the registered dotards commenting on this article.

  79. Of course, unless you want to randomly loose data! by ReneR · · Score: 1

    That we even discuss this. The feature is there to flush all the write caches. When you "eject / safely remove" after copying hundreds of MB or even GBs worth of data this "eject" will usually even take a while until all the write caches are actually written to the medium. Where do you think the data goes when you just pull it out? Yeah, right, straight into the /nowhere/ nirvana, ... This article / discussion is living proof that humankind becomes more stupid.

  80. Why is this even a question? by sjbe · · Score: 1

    It should never even be an issue. It should on ALL systems by default be safe to yank the drive at any time without concern of a corrupted file system. If your file was still copying during the yank then the file should not show up (it wasn't complete) and maybe throw a warning that the transfer was no completed but there should be no further issues. If the file system can't handle this then it is a shit file system. Seriously, we KNOW that people are going to yank the USB drives and they should be designed accordingly. In 2018 there is really no excuse for this not working the way people expect it to work. The entire point of a portable USB drive is to be able to use it quickly and with minimal hassle. Having to do a software eject is an anachronism that we shouldn't have to deal with anymore.

    If you want to do some special write caching for performance reasons that should be possible but have to go through special steps to enable and even more special steps to not revert to the default safe-to-yank setting.

  81. It shouldn't even be a concern by sjbe · · Score: 1

    Just like a parking brake on a car is there for a reason, the option to safely eject a USB drive is also there for a reason.

    That reasons should have been relegated to the dustbin of history a long time ago. There really is no excuse for it to not be safe to yank a USB drive at any time. The only consequence from doing so is that any files that were not completely copied should be deleted and a warning message thrown. If the file system and/or hardware cannot handle being yanked at any arbitrary time then it is poorly designed because it is no secret that people WILL yank these things. If the result is file system corruption then it is a shit file system.

    Insisting that people jump through hoops to accommodate shit hardware and software design is inexcusable. If someone wants faster performance from write caching then they can take extra steps to enable it but the default should always be safe-to-yank arbitrarily.

  82. How I explain it to my IT customers... by Applehu+Akbar · · Score: 1

    If you only read from the drive this time, it’s perfectly safe to just yank it out. But data you have written to a mounted drive is like people lining up at a dock to get onto a boat. If the captain doesn’t sound the horn and yell “All Aboard” before pulling away, the last few people in line are going to jump into the water where they expected the boat to be.

  83. A useless message when you ask to remove by MycoMan · · Score: 1

    In my experience people give up doing the formal 'eject' drive process because Windows (any version) will often tell you that it can't eject device because it's in use. But it won't give you a clue as to what's using it. It's yet another useless Windows message that gives you no useful course of action. Users are stuck - so of course Windows teaches them to yank anyway. To have background processes that are doing things that users can't see is fine - I suppose - but when the user wants their USB stick back, those background processes better speak up - in the foreground - and say what the hell they're doing with your USB stick.Even better - offer the user a way to say "I want my USB back and I want it back NOW",
    Of course - if writing a file - then the writing process has to complete. And if UI components actually presented credible information about when actual writing is happening and then when it's actually done, then people would have reason to learn to yank after it's all done. But then how many dialog boxes with progress bars (or some other progress representation) run all the way to the end and then just sit there? 15 seconds of copying and then 10 minutes of hang - with no useful clue to the user as to what the hell's going on. So, again - you teach users to yank anyway.

  84. depending by sad_ · · Score: 1

    on linux, depending on the filesystem and mount options; copy a large file on a usb meduim which has an activity led.
    when the shell prompt returns, unmount the filesystem and depending on factors mentioned above you will see a lot of activity happen on that drive before the umount commands returns.

    --
    On a long enough timeline, the survival rate for everyone drops to zero.
  85. It's a question of percentages and value by SuperKendall · · Score: 2

    any modern file-system, such as EXT4, BTRFS, ZFS, even NTFS, that chances of seeing corruption are rare.

    That's all well and good until the "rare" event actually happens to some data that mattered to you.

    If you place any value on your data at all, you will not want to chance even a "rare" data loss or corruption.

    Save rolling to dice to power or hardware failures, not easily protected actions like removing a USB device from a computer.

    Although I do have a humorous aside - I have an external USB reader that loses connection every time my Mac goes to sleep, so every time I wake it up I am greeted with a message that I didn't eject a card properly if I left one in the reader. Since those are just reading images from a camera and I'm never writing, that doesn't really matter much (plus I reformat in-camera after comping images off, so even file system corruption does not matter...)

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:It's a question of percentages and value by omnichad · · Score: 1

      Although I do have a humorous aside - I have an external USB reader that loses connection every time my Mac goes to sleep, so every time I wake it up I am greeted with a message that I didn't eject a card properly if I left one in the reader

      This is a bug in several of the more recent OS X revisions. I have external hard drives all doing the same thing. Wouldn't be surprised if this happened with an internal drive too.

    2. Re:It's a question of percentages and value by SuperKendall · · Score: 1

      It doesn't happen with other external USB drives for me, just for this one SD card reader (which admittedly is kind of old and should really be replaced, it's not even USB 3.0!!).

      --
      "There is more worth loving than we have strength to love." - Brian Jay Stanley
  86. two types of USB users by mr.dreadful · · Score: 1

    Those who have had a drive go bad, and those who will. Why not do everything to try and preserve your drive and data?

  87. Nice filesystem you got here. by Hydrian · · Score: 1

    Nice filesystem you got here. Be a shame if anything happened to it.

    --
    No good deed goes unpunished.
  88. Re: My thought by thegreatbob · · Score: 1

    At least out of the ones i've purchase in recent history, every one has had a power/activity indicator light.

    --
    There is no XUL, only WebExtensions...
  89. Yes by danlor · · Score: 1

    Without question. Every time you can.

  90. In short, I don't trust computers. by jtalle · · Score: 1

    Mac, PC, Linux, got 'em all.

    I've had enough problems with thumb drives, hot swap, card readers, cameras, and memory cards, that I'd rather just kick the eject as a conditioned habit.

    I don't trust computers. It's like everything they do is intentional. Even when we tell them to do something, they're just going along with us for the moment.

    Remember, there really is a Skynet satellite!

  91. My main complaint with ejecting drives... by gosand · · Score: 1

    Despite this rather nonsensical article which really doesn't warrant thoughts or opinions, I have a fundamental issue with this whole eject concept.

    There is no "eject". You are unmounting the drive. The term eject has always bugged me because it does nothing of the sort. People think it's OK to just yank out the device because they don't actually understand what is going on. Which... I understand, with the wide number of people using computers you can't realistically expect them all to really "get it". It's part of the arguably necessary dumbing down of computers and their functions. What does surprise me is how terribly this function has been implemented to the point that articles like this exist.

    But for something like Popular Science, or for Geek's sake SLASHDOT, it's embarrassing that this is even a topic.

    --

    My beliefs do not require that you agree with them.

  92. IMF agents don't eject USB drives by Danathar · · Score: 1

    I don't recall secret agents on TV or movies (like IMF members) politely doing software eject on USB drives while on missions. They usually just yank them out (after getting the data they need) before of course escaping with guns blazing....

  93. Luck by cwsumner · · Score: 2

    You can get away with risks sometimes. But if you push your luck too often, your "luck" will get used up!

    And there is no law that says it won't go bad the very first time, or the second, no matter how long the odds.

    Murphy's Law rules the world... 8-}

  94. Why is this even a thing? by mark-t · · Score: 2

    Yes, unmount the drive before taking it out.

    If the usb driver doesn't cache writes, then unmounting the device before removal will not take any extra time, and has cost you nothing, while if it does cache writes, removing before unmounting could corrupt the data on the device.

    Seriously, it takes like 2 seconds if it would have been safe to do the other way and will save you untold hours of grief later if it wasn't.

  95. Reality Check by Whatchamacallit · · Score: 1

    I've fixed a heck of a lot of scrambled flash drives using the "testdisk" utility and recovered data that appeared lost.

    Always unmount / eject even on Windows but especially any *nix including macOS. If Windows says it cannot eject, go figure out why then safely eject it. In some cases it's because you have an Explorer or Command Prompt / Powershell working directory set to the external drive. Or some security tool is running a scan, etc.

  96. Poor UI - just yank it. by ripvlan · · Score: 1

    On my little USB "stick" I've never property ejected it. And I'm not about to start.

    As for my HDD USB drive - even though the cache policy is disabled-write-cache - I have more important data on it (usually a Backup) - so I do "properly" eject it.

    But let's face it - the UI for these things is horribly wrong if it makes a difference. Is the plug locked into the computer? No. It's just a cord or stick that one can easily Yank on It. There is usually a light that blinks if the device is busy. If it isn't busy - just yank it. That's all I've waited for.

    If it makes a difference then manufacturers should change the blinky lights, or lock the cord into the plug until you Eject it. Remember Floppy Disks? It was locked while writing - attempting to press the eject button made horrible noises so you knew you screwed it up !!! (whether that was the intended UI or not).

    I've used Tape drives that pressing Eject is a queued operation - meaning "I intend to eject this" and you wait until it is done -- and only then does the tape pop out.

    So --- if this was honestly critical they'd have trained us all better. I say Just Yank It.

  97. Ancient argument by cellocgw · · Score: 1

    C'mon, must be a few people besides me that remember the "difficult transition" users had to deal with when you couldn't just hit the power switch on your PC: you had to run "Shutdown." Almost as though there was a real OS (cough Unix cough) inside that wanted to do logging and cleanup before killing power.
    Sure, you can yank the plug on your OSX or Win10 machine but it will quite properly reprimand you on the next boot sequence, and with reason.

    Same goes for ALL drives, whether USB or not, that you want to physically disconnect.

    --
    https://app.box.com/WitthoftResume Code: https://github.com/cellocgw
  98. No by cyber-vandal · · Score: 1

    I've done it hundreds of times on Windows with no issues as have millions of others.

  99. Yes. I know from experience. by superdave80 · · Score: 1

    While doing some work as a sometimes-IT-administrator for a small company, I saw firsthand what happens when you yank a USB drive too soon. We had just been bought by a larger company and were transitioning over to their systems, and had to download a large database from across the country. This file took close to an hour to download, and we just had to sit around and wait for it before we could proceed.

    Bad idea #1 was the large company IT guys deciding to download it directly to the USB drive instead of the hard drive first (we were going to transfer to another non-networked computer via USB once we downloaded it). Bad idea #2 on my part was seeing the progress indicator go away and yanking out the USB drive to bring it over to the other computer. I can still see the looks of "NOOOOOOO!!!" on their faces.

    Yep, file hadn't quite finished transferring to the USB drive. Proceeded to re-download to the hard drive this time for another hour wait.

  100. Depends a lot on what applications access the data by welshie · · Score: 1

    If your only use of the USB drive is to copy files to and from it, you're unlikely to remove it when it's still copying files, because there's usually some on-screen progress device.

    If you are using an application that done random writes to a file on the filesystem, such as the older Microsoft Office file formats, then you'll have the file at risk all the time the document is open, even if you've recently hit 'Save', because Microsoft Office writes a lot in the background, even when it's not 'saving'.

    The exact same problem happens when handling files on a network share when a VPN drops. If you forget to close the document before dropping the VPN, then the file's internal storage tables can become corrupt in a way that requires specialist recovery software to repair.

    This could have been one of the reasons why Microsoft Office changed their file formats.

  101. Um... by sootman · · Score: 1

    What's a "USB drive"?

    Sent from my iPad

    --
    Dear Slashdot: next time you want to mess with the site, add a rich-text editor for comments.
  102. Irrelevant by Agripa · · Score: 1

    Since the operating systems and USB drives routinely ignore the standards which should prevent data corruption, using any ejection function is irrelevant. The same goes for SATA devices and various Flash drives.

    And who cares what the OS says if removing the USB drive could corrupt it. Does that mean that they USB drives do not support idle time scrubbing? What a surprise that they are so unreliable then.