41

Is there any way to disable the "the disk was not ejected properly" message?

I use a KVM and need to switch between two systems and have a memory stick that is in the KVM. The problem is that it's very annoying to get the message every time I switch from one computer to the other. I know, I can unmount it (and probably should), but I switch all the time, so it's a inconvenience to unmount, and there is nothing sensitive on the memory stick.

  • 2
    Sorry, I have no answer. However keep in mind, that message is to remind you that data is held in memory and not yet written to the disk. Which is particularly important when you switch often. – DerMike Jan 7 '11 at 14:01
  • 4
    I've done this a long time and I have never lost anything. I'm not saying it won't happen, but I'm willing to take the risk. – Sindre Sorhus Jan 7 '11 at 15:19
  • 2
    Okay, I have to ask: anyone know why we got three near-identical questions within 10 hours—this one, 6090, and 6108 (and yes, the latter two have been closed as dupes). – Dori Jan 8 '11 at 1:38
  • 1
    @Dori It's the time after Christmas, so new Macs or Cameras with SD Cards :) Although I would like to point out that my question specifically was asking about the Write Cache, which is what the warning is usually about (ignoring issue like Symlinks/open system files on the drive) – Michael Stum Jan 8 '11 at 7:08
  • 1
    I hear what you are saying, that you would rather take the chance on losing the memory stick, I just thought I would let you know that it does happen; I found this forum because I didn't eject my memory stick before disconnecting and wasn't able to access the 1.8gb worth of movies that I just took. Luckily Disk Utility was able to fix it, this time. – cate Jan 8 '11 at 14:09
13

Much better to do this:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.UserNotificationCenter.plist

Which will just stop the UserNotificationCenter service from running, leaving your system files intact!

beware: as noted in the comments, this will disable all system notifications, including those when programs request access to system services like contacts

  • Will it continue to be unloaded after restarting my Mac? – Sindre Sorhus Apr 23 '11 at 15:39
  • 1
    Unloading a launchctl plist persists across restart, so I believe so. That said, I hardly ever reboot, so haven't tested it yet! – James Apr 23 '11 at 19:15
  • 2
    (I rebooted, and it has persisted fine :) – James Apr 29 '11 at 10:27
  • 3
    That solution has a negative side effect: It will also hide those "xy-application would like access to your contacts" popups. To revert it: sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.UserNotificationCenter.plist – user52466 Jul 2 '13 at 1:08
  • 3
    Yeah this is very dangerous. It will most likely stop you from getting notifications from the system. In 2011, notifications were not a big deal but they kind of are today in 2015. – Ahmet Alp Balkan Feb 10 '15 at 1:32
10
+25

Certainly not an elegant answer but, you can disable UserNotificationCenter.app found in /system/library/coreservices - replace it with another app or file with the same name. It will stop any warnings popping up (including that your drive is full) so watch out for that, but in my experience it does what you are looking for.

I actually did this to my mac a long time ago, and forgot about it until you asked you question. Credit to Macpadawon at http://macosx.com/forums/mac-os-x-system-mac-software/297194-disable-device-removal-message.html for the answer - same place I found my answer a couple of years back.

  • Wow. Nice catch. I certainly wouldn't do this to my own system, but it's nice to know it can be done. I suppose the app could be replaced with an empty file. – Harv Jan 18 '11 at 1:42
  • I've done it on three different macs with no issues, although most of the time I just unmount things as well. – Ciaocibai Jan 18 '11 at 22:23
  • 2
    At least you did not notice any issues, right? Sorry, couldn't resist. :-) – DerMike Jan 21 '11 at 11:20
9

This applescript will close them for you. Paste it into Script Editor and then Save as an application. Then grant access to that application in (System Preferences > Security & Privacy > Accessibility) Then you can use an application like ControlPlane https://www.controlplaneapp.com/ to run the application on wake thus closing them all automatically! ** Note: You will need to grant Accessibility access to ControlPlane as well.

tell application "System Events"
tell process "NotificationCenter"
    set numwins to (count windows)
    repeat with i from numwins to 1 by -1
        tell window i
            set temp to value of static text 1
        end tell
        if temp contains "Disk Not Ejected Properly" then
            click button "Close" of window i
        end if
    end repeat
end tell
end tell
  • Beautiful, I prefer this to completely disabling Notification Center. – NetOperator Wibby Apr 12 '18 at 15:11
-2

your answer is here. Just replace a file with the one mentioned at the end of this article and jobs done. Nothing has changed in Sierra or High Sierra.

Disabling OS-X Device Removal Warnings In Yosemite

-2

UPDATE!

OMG! QuantumG is a genius! Here is a hack (and I mean a real life hack) for disabling just this annoying message and leaving the rest of the notification system intact...

http://quantumg.blogspot.com/2015/04/disabling-os-x-device-removal-warnings.html

Warning: This is a pro-tip and not for the faint of heart! It requires hacking your Mac OSX system files and could result in you breaking your Mac.

Edited for clarity.

The issue with flash drives or other USB drives is this; whenever you write data to a drive... ANY drive on your system, the data is first written to a buffer in memory. Later, when the computer gets around to it, it will flush the buffers to the device (hard drive, SSD, or any USB device). That may be instantaneous (at least to us mere mortals) or it may take a few seconds. The possible delay means that if you yank a USB device before the buffers have flushed you may end up with a corrupted drive, or a set of corrupted files on the drive.

If you only read from a device, then there is NO NEED to flush the write buffers before you yank to your heart's content because they are empty and don't need to be flushed to the device.

So... The annoying MAC OS X warning is most probably NOT relevant. It is only important to do so if you have recently written to the device, and haven't given it enough time to flush the buffers (a few seconds, max). It is NEVER necessary to wait for the buffers to flush if you are only reading from the USB device.

Therefore Apple NEEDS to provide a way to disable individual messages for power users. Don't treat everyone as a n00b who can't be relied on to know how their computer works.

And to those who complain that I'm wrong, and there is a way to disable the messages by disabling the ENTIRE NOTIFICATION SUBSYSTEM are just plain wrong. Disabling the entire notification subsystem isn't an acceptable solution, just as removing the battery from your cell phone is NOT an acceptable solution to receiving too many telemarketing calls. The notification subsystem is important and shouldn't be disabled just because the OP finds one of the many myriad of messages to be annoying.

This is a problem that can only be adequately solved by Apple providing a way for users to opt out of specific messages.

  • 1
    So, I'm not sure this ramble really qualifies as an answer to the question... however an answer was already provided that does exactly what you are rambling can't be done - the messages can be disabled. However, as this does not attempt to provide any answer to the question, I'm going to flag this for deletion. – Charlie74 Jan 4 '16 at 23:54
  • @Charlie74 It's an attempt to make a point, so I'm not deleting it. I will edit out the vague chit chat towards the end. If OP wants to be clear, feel free to provide a positive explanation of why OS X is POSIX certified - en.wikipedia.org/wiki/POSIX#POSIX-certified and not POSIX-based. – bmike Jan 12 '16 at 17:35
  • @Charlie74 I clarified my answer, but to defend myself I never said it couldn't be done. I merely suggested that disabling the notification subsystem in order to stop one of the maybe hundreds of issues of which your mac may need to notify you, isn't an acceptable solution. It's only slightly better than "Stop using your Mac and the silly message won't bother you anymore". Only Apple can offer an acceptable solution, and they haven't yet. – Phillip H. Blanton Oct 29 '18 at 22:49
  • This approach does not work due to binaries needing to be signed. Disabling code signing would be worse than disabling the notification system. – Edward Anderson Nov 29 '18 at 12:35
  • I agree with Edward. So there is still NOT A VIABLE SOLUTION. – Phillip H. Blanton Mar 1 at 20:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .