syscl Posted March 18, 2016 Share Posted March 18, 2016 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! 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. Feel free to change whatever you want if you do not satisfy with my script: https://github.com/syscl/Fix-usb-sleep How to use? Download the latest fixUSB.sh by entering the following command in a terminal window: git clone https://github.com/syscl/Fix-usb-sleep 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 your current folder (./) and the next step is to change the permissions of the file(add +x) so that it can be run: chmod +x ~/Fix-usb-sleep/fixUSB.sh Run the fixUSB.sh in a terminal window by: cd ./Fix-usb-sleep ./fixusb.sh If all this procedures have done correctly, you will see the following message in the terminal window Hope you all enjoy this script and all feedbacks are welcome! Post issue on https://github.com/syscl/Fix-usb-sleep Credit: Bernhard Baehr (bernhard.baehr@gmx.de): without his great sleepwatcher, this project/script will not be created. 12 1 Link to comment Share on other sites More sharing options...
maleorderbride Posted March 25, 2016 Share Posted March 25, 2016 Thanks! This is working well with my install. Link to comment Share on other sites More sharing options...
syscl Posted April 3, 2016 Author Share Posted April 3, 2016 Thanks! This is working well with my install. I am also happy to hear that script will help you:) Link to comment Share on other sites More sharing options...
psimondo Posted July 25, 2016 Share Posted July 25, 2016 My output doesn't seem to match yours... and it also seems to freeze after step 2 (been waiting 15 minutes). See below. Any ideas? iMac:~ xxxxxx$ git clone https://github.com/syscl/Fix-usb-sleep Cloning into 'Fix-usb-sleep'... remote: Counting objects: 132, done. remote: Compressing objects: 100% (7/7), done. remote: Total 132 (delta 0), reused 0 (delta 0), pack-reused 125 Receiving objects: 100% (132/132), 52.43 KiB | 39.00 KiB/s, done. Resolving deltas: 100% (72/72), done. Checking connectivity... done. iMac:~ xxxxxx$ chmod +x ~/Fix-usb-sleep/fixUSB.sh iMac:~ xxxxxx$ cd ./Fix-usb-sleep iMac:Fix-usb-sleep xxxxxx$ ./fixusb.sh Password: [ OK ] Create /Users/simondavis/Fix-usb-sleep/tools/tools. [ OK ] Download sleepwatcher. Link to comment Share on other sites More sharing options...
syscl Posted August 25, 2016 Author Share Posted August 25, 2016 My output doesn't seem to match yours... and it also seems to freeze after step 2 (been waiting 15 minutes). See below. Any ideas? iMac:~ xxxxxx$ git clone https://github.com/syscl/Fix-usb-sleep Cloning into 'Fix-usb-sleep'... remote: Counting objects: 132, done. remote: Compressing objects: 100% (7/7), done. remote: Total 132 (delta 0), reused 0 (delta 0), pack-reused 125 Receiving objects: 100% (132/132), 52.43 KiB | 39.00 KiB/s, done. Resolving deltas: 100% (72/72), done. Checking connectivity... done. iMac:~ xxxxxx$ chmod +x ~/Fix-usb-sleep/fixUSB.sh iMac:~ xxxxxx$ cd ./Fix-usb-sleep iMac:Fix-usb-sleep xxxxxx$ ./fixusb.sh Password: [ OK ] Create /Users/simondavis/Fix-usb-sleep/tools/tools. [ OK ] Download sleepwatcher. Try the latest one as my guide. //// Link to comment Share on other sites More sharing options...
dlstyley Posted August 28, 2016 Share Posted August 28, 2016 Just wanted to say that this appears to have fixed the problem for me. Thank you for putting this together!!! 10.11.6 Clover GA-EP45-UD3P Link to comment Share on other sites More sharing options...
syscl Posted September 1, 2016 Author Share Posted September 1, 2016 Just wanted to say that this appears to have fixed the problem for me. Thank you for putting this together!!! 10.11.6 Clover GA-EP45-UD3P Feel free to star that project if it work then I can count how many people benefit from that project Link to comment Share on other sites More sharing options...
syscl Posted September 18, 2016 Author Share Posted September 18, 2016 Recent update log 2016-9-16 Fixed an issue that will potentially mount external EFI partitions see issue #5 by @brousseau6933 Fixed typo: "${gFrom}/tools" --> "${gFrom}" 2016-7-16 Switch to curl cmd instead of git clone cmd. 2016-5-26 Mount points at wake to fix MacBook issue #2 . 1 Link to comment Share on other sites More sharing options...
weezul Posted November 16, 2016 Share Posted November 16, 2016 Hey I just tried this on my GA Z170X-Ultra Gaming and it doesn't seem to work. Mac Os Sierra 12.1 Link to comment Share on other sites More sharing options...
syscl Posted December 9, 2016 Author Share Posted December 9, 2016 Hey I just tried this on my GA Z170X-Ultra Gaming and it doesn't seem to work. Mac Os Sierra 12.1 Hello, could you please provide some information under https://github.com/syscl/Fix-usb-sleep/issuesso that I can help you with your issue. syscl Recent update log 2016-12-08 credit ralexx's detail information such that I added patches to fix PCI/PCIe USB devices sleep issue syscl Link to comment Share on other sites More sharing options...
wolfie81 Posted December 19, 2016 Share Posted December 19, 2016 I too can confirm it does not work on Z170 Ggabyte Designaire. Link to comment Share on other sites More sharing options...
syscl Posted December 25, 2016 Author Share Posted December 25, 2016 Hey I just tried this on my GA Z170X-Ultra Gaming and it doesn't seem to work. Mac Os Sierra 12.1 I too can confirm it does not work on Z170 Ggabyte Designaire. Thanks for the feedback, please provide information like diskutil list when plug in external storage, I want to see what's wrong. syscl Link to comment Share on other sites More sharing options...
jgoblin Posted December 27, 2016 Share Posted December 27, 2016 GA-Z170M-D3H, Sierra 10.12.2 (16C68), patch is not working too. Link to comment Share on other sites More sharing options...
Joni_78 Posted January 4, 2017 Share Posted January 4, 2017 Installed fine, but didn't work on my EliteBook. Sierra 10.12.2. diskutil list attached. diskutil.rtf Link to comment Share on other sites More sharing options...
syscl Posted January 28, 2017 Author Share Posted January 28, 2017 Installed fine, but didn't work on my EliteBook. Sierra 10.12.2. diskutil list attached. Thanks for the feedback, but I do not see there's possible issue. Could you please provide more details, for example, diskutil info disk1, ioreg, something like that. I may write a log version for your case to log out some information... syscl Link to comment Share on other sites More sharing options...
Joni_78 Posted January 28, 2017 Share Posted January 28, 2017 Thanks for the feedback, but I do not see there's possible issue. Could you please provide more details, for example, diskutil info disk1, ioreg, something like that. I may write a log version for your case to log out some information... syscl Thanks. Files attached. Console is a screenshot of console to see what happened when laptop went to sleep, not sure if that has any processes related to this, but the ones in it were the only ones that were related to disks. ioreg.zip install.rtf console.zip diskutil.rtf 1 Link to comment Share on other sites More sharing options...
PippoX0 Posted January 29, 2017 Share Posted January 29, 2017 I will give it a try to find out if it resolved my issue with my USB external drive. However if think that my problem is related to something other because , i want to boot from a multi partition external drive and get back all volumes after sleep. If i boot from internal hd i have no trouble. Link to comment Share on other sites More sharing options...
superchase9000 Posted January 31, 2017 Share Posted January 31, 2017 I can also report that it is not working as intended on Sierra. When entering sleep on El Capitan, everything ejects and runs fine. However, on my separate installation of Sierra, I get the "Disk not ejected properly" warning that I had on El Capitan before I had installed this week. This and the Shiki Maxwell kext are the only things keeping me from switching to Sierra as my daily driver because El Capitan is so stable right now. syscl, is there anything I can provide you that will help in diagnosing the problem? Specs are identical for installations because the machine is the same with two separate SSDs holding different Operating Systems. EDIT: CPU 6600K, GPU GTX 950, IGPU HD 530 (Disabled in BIOS), OS 10.11.6, 10.12.2 Link to comment Share on other sites More sharing options...
syscl Posted February 9, 2017 Author Share Posted February 9, 2017 @Amble @pippox0 @superchase9000 Thank you guys, I will see if there's something wrong. Though I don't know what change cause this disk eject issue on Sierra, but in my case(Dell Precision M3800 QHD+), there's no disk eject issue on Sierra 10.12.3. If you have any clues, please don't hesitate to place here or place in my GitHub, I will look into it. But as for now, I am too busy refining 80.nvram script and some other stuff. I apology for my late reply. Have a good day, syscl Link to comment Share on other sites More sharing options...
mun33 Posted December 9, 2017 Share Posted December 9, 2017 I don't think the script works on 10.12.16 either. Link to comment Share on other sites More sharing options...
BuXb Posted March 30, 2018 Share Posted March 30, 2018 great thank you, @syscl , working just perfectly on both, USB 2.0 and USB 3.0 drives in High Sierra 10.13.3. See my sig below for my rig. 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). BIG THUMBS UP for you ! Link to comment Share on other sites More sharing options...
t.j.nova Posted November 18, 2018 Share Posted November 18, 2018 So far this script seems to work flawlessly on my High Sierra install. Thank you for fixing this annoyance! Link to comment Share on other sites More sharing options...
Recommended Posts