No more "the disk was ejected improperly"!

Discussion in 'OS X Mavericks (10.9)' started by stooovie, Oct 11, 2013.

  1. stooovie macrumors 6502a

    Joined:
    Nov 21, 2010
    #1
    In 10.9 GM, when you yank a USB drive or a memory card, you no longer get that dreadful "The Disk was ejected improperly" warning dialog. You get no warning at all. Seems like OSX can finally properly handle this.

    When you disconnect a hard drive without ejecting, you will get a warning, but it's just a notification, no modal dialog box.

    Finally!
     
  2. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #2
    The proper way is no warning? The proper way is to always eject the drive. Even Windows 7 displays a little notification. The only OS released within the past 15 years that you could just pull out the drive without any problems (as long as the drive was idle) was Windows XP. Everything else can cause data corruption.
     
  3. stooovie thread starter macrumors 6502a

    Joined:
    Nov 21, 2010
    #3
    I'm quite sure if there was corruption going on, Apple would continue displaying the message every time. It does warn you with actual hard drives, but with USB sticks and cards, writing should always be cached anyway.

    Whatever the case, the warning does nothing to alleviate the problem anyway - casual users don't care/pay attention/know what's going on anyway and advanced users eject properly.
     
  4. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #4
    Cached writing is where the data loss comes from. If you're working on a Word doc on the drive, then click save, it may not be written to the drive when to pull it out without ejecting it. XP has the caching turned off by default so that when you click save in Word, the document is immediately written to the drive instead of waiting in a ram buffer. I've had to explain the need to always eject the drive to people who have lost documents and files they were working on by simply pulling out the drive without ejecting.
     
  5. lcmazza macrumors regular

    Joined:
    Apr 3, 2012
    #5
    I think caching for external drives should always be disabled. There's no real performance gains, because the data has to go to drive anyway and they're pretty fast today. If the drive is not fast, then that's the device's problem, not the os'. Don't you think?
     
  6. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #6
    That would be nice, but Windows 2000, Vista, 7, 8, and their server counterparts all have it enabled by default. It's enabled within the Mac OS X kernel and some Linux kernels. I think the decision to have it enabled or enabled by default comes from the older days when USB 1.1 was the fastest thing around.
     
  7. freedevil macrumors 6502a

    freedevil

    Joined:
    Mar 7, 2007
    #7
    I get a notification with my firewire to thunderbolt.
     
  8. CyBeRino macrumors 6502a

    Joined:
    Jun 18, 2011
    #8
    Nonsense.

    Caching exists entirely for the performance gains. It allows the OS to worry about getting the data to disk, in the most efficient way it can manage, while you do other things.

    USB sticks are typically not very fast, so they actually benefit most from this caching. Unfortunately USB-sticks also tend to get yanked without being properly ejected because people don't understand this mechanism, so in practice with those it's better to disable write-caching and just be slow about it.
     
  9. PeterHolbrook macrumors 6502a

    Joined:
    Sep 23, 2009
    #9
    I don't actually understand what this discussion is about. As far as I can see, the only thing that has changed in Mavericks regarding USB removal without ejection is that the previous centred warning has been replaced by a notification:

    "Disk Not Ejected Properly. Eject "SANDISK" [or whatever its name is] before disconnecting or turning it off." And you need to close the message anyway.

    So, in fact, NOTHING has changed as far as cached writing and possible data loss go.
     
  10. lcmazza macrumors regular

    Joined:
    Apr 3, 2012
    #10
    You can't be more convincing by just reaffirmimg a concept. Be more technical.
     
  11. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #11
    Why else would is be enabled on all but one major OS? Microsoft and Apple know more about it than we do. Their judgement follows many technical papers and studies about this.
     
  12. lcmazza macrumors regular

    Joined:
    Apr 3, 2012
    #12
    They also knew that compressing inactive memory in real time could improve memory management, because that exists for about 20 years on dozens of utilities. But only now, only *one major os (OS X) has this feature implemented successfully.

    So, if you want to do it and you know that you can do it well, why not definitely do it?
     
  13. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #13
    While compressing inactive memory has gains, it also has losses. Mostly on slower speced systems that have a limited memory bus. The Windows kernel didn't even support memory compression until version 6.1 (Windows 7). Then there are some that would argue that OS X's memory management is very poorly implemented. Just remember that the end consumer rarely knows what best for their machine because they lack knowledge about all of the variables that need to be included in the decision making process.
     
  14. Sky Blue Guest

    Sky Blue

    Joined:
    Jan 8, 2005
  15. CyBeRino macrumors 6502a

    Joined:
    Jun 18, 2011
    #15
    Well, the OS can be more efficient in writing to disk if it can wait a bit before doing so, because it can line up writes in a more sequential manner. This is the prime reason write caching improves performance (beyond lessening the wait for the user) when using spinning rust disks: those disks write much faster when doing so sequentially as opposed to randomly. (Even when writing a single large file, fragmentation can cause the writes to be in random locations.) The downside to this, is that the write "completes", so far as the user is concerned, well before the data lands on the disk. So if the user thinks, "it's done", and turns off the computer (by turning off the power) or removes the disk, the result can be a corrupted filesystem because in reality the computer was still writing to the disk. And depending on what it was writing the result can be anywhere between an incomplete file and an unusable filesystem.

    Remember way back when, when computers couldn't shut themselves off and instead told you 'it is now safe to turn off your computer'? This was why.

    Now, the above doesn't really apply to USB sticks much because there is little (some, but not much) gain in writing sequentially. So in that case write caching is done to improve the user experience by speeding up the user-facing action. There is no technical reason in this case, it's just treating a USB stick as any other storage device and caching the writes. Write-caching is the norm.
     
  16. lcmazza macrumors regular

    Joined:
    Apr 3, 2012
    #16

    So, the implementation of "ejecting" I think is wrong. If the external drive icon at least changed the color when it could be removed safely, it would make our lives a lot easier.

    Here's a great idea for an update! No more ejecting. :cool:
     
  17. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #17
    Ejecting is still required as write caching is still used. It is especially important on FAT32 drives as those lack a robust filesystem that can recover easily from write errors and because Mac OS X must unmount them or the whole drive partition table could be lost.
     
  18. lcmazza macrumors regular

    Joined:
    Apr 3, 2012
    #18
    There's no need to remove the eject function. I only think this should be more intuitive. If the drive is idle for the user but still has write operations to be completed, it should be red. If it finishes the job and can be safely removed without the need for a manual ejection, then it turns green. Green means you can physically remove the drive with no need for manually ejecting it first.
     
  19. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #19
    Such an ability doesn't exist and cannot exist without the unavoidable delays to the end user and the system. It would have to mount and unmount the drive before and after every write to the drive.
     
  20. lcmazza macrumors regular

    Joined:
    Apr 3, 2012
    #20
    No. That would be just an indication.
    The way it is presented right now if you physically remove the drive even though there are NO write operations to be completed and NO open handles pending,the OS complains anyway. It is not intelligent and should be.
    There's no need to mount and unmount the drive. If it's idle, the user will see very simply. If the user physically removes the drive while it's green, then the OS forces the unmount and does not warn the user, because there's nothing to warn about.
     
  21. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #21
    HFS+ and FAT32 drives on Mac OS X need to be unmounted. If they are not unmounted their file tables are not updated with the latest files and will lead to abandoned files that can't be removed without repairing the disk. NTFS has this problem as well, but it doesn't present itself to Mac OS X because of its read only setup. The file table update only happens when the drive is unmounted, never any other time. Thus, there are always pending write operations in the drive, even when the drive is seemingly idle. If the way you are proposing was properly written into OS X, the drive would always show as red, even when the drive's status LED was not showing any activity.
     
  22. lcmazza macrumors regular

    Joined:
    Apr 3, 2012
    #22
    I see. Well, it seems more complicated then it should be, then.;)

    Thanks.
     
  23. colourfastt macrumors 6502a

    colourfastt

    Joined:
    Apr 7, 2009
    #23
    I would think that 90% of the users of this forum have never used an RLL or ERLL HDD and had to "park" the HDD's heads prior to turning off the computer.
     
  24. wweber macrumors newbie

    Joined:
    Oct 12, 2013
    #24
    Kernel panic

    Tried it with a USB stick, and bam - yanking it out crashed 10.9 GM.
    But I got a kernel panic only the first time. After that it just gives me a notification.
    I guess a proper eject is still a good idea.
     
  25. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #25
    I'm starting to think that the lack of a message is a bug.
     

Share This Page