Contribute
Register

[Guide] Fix issue of "Disk not ejected properly"

Status
Not open for further replies.
Joined
Aug 4, 2015
Messages
83
Motherboard
iPhone 5s
CPU
E3-1230 v3
Graphics
nVidia Geforce 8600GT
Mac
  1. iMac
  2. MacBook Pro
Mobile Phone
  1. Android
  2. iOS
Overview

On OS X/Mac OS X, some people may suffer from the issue that the external disk was not ejected properly after sleep. This problem dates back to the period of the coming of Mavericks, even on a real Mac!
Unknown.png


Overview of the tools/solutions


AFAIK, there's two solutions to fix this problem till now:


  • Install Jettison from Mac App Store.
  • Use sleepwatcher to unmount the external devices before system go to sleep.

But for me, install Jettison is not free of charge, and this application will place icon on the right corner of the statue bar once get installed, which is not a good solution from my point of view.

The latter one is open source and free of charge, which means I can know clearly what this application/daemon has done and add as many functions I want to it. With the help of sleepwatcher, there's various script to unmount/mount disk upon sleep, but none of it is so easy to read and some require sleep time delay settings, that's really strange! That's the reason why I started to create my "own" version of script to fix this issue. I optimized the whole progress as well as the installation progress. No more wake/sleep delay time settings! No more complicated command line, no more wake script, just one sleep script for unmount the external devices, once you resume from sleep, all the external devices will mount by system spontaneously. After following this guide step-by-step, no more "Disk not ejected properly" error will occur upon sleep.

Download the latest fixUSB.sh by entering the following command in a terminal window:
Code:
[/B][COLOR=#333333][FONT=Consolas]git clone https://github.com/syscl/Fix-usb-sleep[/FONT][/COLOR][B]

Note: If it was the first you execute command "git", please install it by the tips from OS X online(Click "Install"), and then run the above command line again.

This will download the fixUSB.sh to ~/Fix-usb-sleep/ and the next step is to change the permissions of the file(add +x) so that it can be run:
Code:
[/B][B]chmod +x ~/Fix-usb-sleep/fixUSB.sh[/B][B]

Run the fixUSB.sh in a terminal window by:
Code:
cd ~/Fix-usb-sleep
./fixusb.sh

If all this procedure has done correctly, you will see the following message
Snip20160318_3.png

Hope you all enjoy this script and all feedbacks are welcome! Post issue on
HTML:
https://github.com/syscl/Fix-usb-sleep

Credit:
Bernhard Baehr ([email protected]): without his great sleepwatcher, this project/script will not be created.

RehabMan: I was first inspired by his configuration of launch dameon of VoodooPS2.(refer:
HTML:
https://github.com/RehabMan/OS-X-Voodoo-PS2-Controller/wiki/How-to-Install
)
 
[EDIT]: not working all of the time on all drives in High Sierra 10.13.3 :( See my sig below for my rig.

I'm now using Jettison, which does always work.

Remember that sleepwatcher is outdated (Aug. 18, 2011) and surely not made for High Sierra.
--- old post:
great thank you, @syscl, working just perfectly on both, USB 2.0 and USB 3.0 drives in .

However, I ran sudo ./fixusb.sh, then restarted because it did not work right away - restart was required (not sure if sudo was required, too, but obviously it did not hurt, either).
 
Last edited:
Hi there everyone! I tried running this command in Terminal and I got it all the way through to say Done! Please reboot to see change. However, my disk still ejects improperly among sleep. Is there anything else I can do?

I have a i7core processor, gigabyte z170x, Nvidia GTX 1060 graphics card, and a Samsung 850 evo drive. I am running Sierra 10.12.6
 
Last edited:
Hi there everyone! I tried running this command in Terminal and I got it all the way through to say Done! Please reboot to see change. However, my disk still ejects improperly among sleep. Is there anything else I can do?

I have a i7core processor, gigabyte z170x, Nvidia GTX 1060 graphics card, and a Samsung 850 evo drive. I am running Sierra 10.12.6
I believe the cause of this problem is the USB definitions in OEM ACPI tables. Have you tried Rehabman's method/guide to generating an SSDT for USBInjectAll?
 
Hope you all enjoy this script and all feedbacks are welcome! Post issue on
HTML:
https://github.com/syscl/Fix-usb-sleep

Credit:
Bernhard Baehr ([email protected]): without his great sleepwatcher, this project/script will not be created.

RehabMan: I was first inspired by his configuration of launch dameon of VoodooPS2.(refer:
HTML:
https://github.com/RehabMan/OS-X-Voodoo-PS2-Controller/wiki/How-to-Install
)

Many thanks for this - I just used it with a Mojave build on a 7th Generation Gigabyte Brix.
 
This does not work with Gigabyte Designare Z390 with Mojave 10.14.6, unless setting ram to 2666 MHz and below, but then the problem takes care of itself, rendering the script or Jettison unnecessary.

With over 2666 MHz memory, the USB disks will eject and the error is gone, but the part that does not work is remounting the USB drives. You still have to unplug and replug them.
 
Last edited:
Status
Not open for further replies.
Back
Top