External hard drive ejects on sleep

I recently upgraded to Mountain Lion and noticed every time I leave my iMac and it goes to sleep, the external hard drives eject. I get the pop-up stating they were improperly ejected. Anyone know how to stop this? Wasn't having any problems in Lion.

iMac, OS X Mountain Lion

Posted on Aug 3, 2012 6:21 PM

Reply
450 replies

Aug 23, 2012 4:37 PM in response to iamapple

Given the timing of the Apple support team interactions with people in this forum and elsewhere I always thought that any fix was going to be 10.8.2 or later unfortunately.


Antivirus software I agree seems to have no obvious impact.


For me moving the external drive from FW to USB has had a major positive impact (multple ejects per day on firewire vs only one so far in over a week now its on USB). Others seem to also be finding the issue happens less on USB.


Unfortunately connecting via USB does not seem to be a fix overall and perhaps it's a matter of trying each specific drive / manufacturer on alternate interfaces where this option is available in order to determine for each person what causes less problems.


Who knows when 10.8.2 will be out - may not be as quick as .1 from some predictions but perhaps that will depend on how many have issues such as the disk eject and how widespread and "high profile" this is.


Took Lion until around .4 to bed-in on my system so let's hope ML does not take that long.


Andrew

Aug 24, 2012 12:53 AM in response to ab57

First of all I have no problem with physical drives. My problem is with mounted dmg´s. The symptoms are exactly the same with ejected images when computer goes to sleep.

I installed the 10.8.1 yesterday and woke up this morning to a computer with the dmg´s still mounted.


HOWEVER... I left home and got to work, I checked it again via ssh to see if there were any changes.

now the images where ejected...? and the computer wasnt even close to going to sleep. (20 minutes to work).


BUT, the only thing that happened during those minutes were that my wife logged in on the computer (fast user switching, keeping my account logged in).


So in my case the ejection always occurs when another user log in. And since a *nix system has plenty of users that are doing tasks not meant for the user to see (root, wheel,www etc) then I believe that this might be part of the problem. Maybe there is an user that activates during sleep that is causing the problem...

I don´t know. Just another input to the problem.

Aug 27, 2012 5:35 PM in response to iamapple

+1


Unmounting only began with 10.8.1. update. Was fine under 10.8.


External LaCie USB drive (the shiny black brick) ejecting two partitions during sleep with error dialogue upon wake. It's screwing up automatic Superduper backups & I barely got the drive mounted last time.


I am turning off Superduper and will unmount drives before nightly sleep until this is fixed.


No Norton installed. ClamXav running but difficult to believe it's involved; it only scans my Downloads folder & email.


Thought it might be Mountain but with Mountain disabled the issue remains.

Sep 1, 2012 12:59 AM in response to iamapple

Me too!


I can replicate this easily.

I'm on a brand new retina macbook running 10.8.1 and a brand new iomega prestige portable external usb 3.0 drive. No antivirus software installed.


  1. Shut the lid on the macbook,
  2. Wait a few minutes (This is necessary to put it to sleep, if you don't wait the couple minutes, and open it straight up, it sometimes stays connected).
  3. Open the lid
  4. Boom! "Eject the drive you idiot!" message with red esclaimation mark appears.


How long will it take to get this fixed? Surely there are quite a few people who use external hard drives with their macs! Perhaps for storing files or running time machine.

Sep 1, 2012 2:13 AM in response to iamapple

With an administrator account (either GUI or from the command line), try this command in Terminal:


sudo defaults write /Library/Preferences/SystemConfiguration/autodiskmount AutomountDisksWithoutUserLogin -bool YES


You then need to *restart* your Mac to have the command take effect, and test.


That command sets the system-wide default to mount external HDs on startup and unmount on shutdown. The default behavior is to mount on GUI login, and unmount on GUI logout. Sleep functions as a type of GUI logout, which unmounts your external HDs.


Works for me with Firewire and Thunderbolt HDs. This mount on GUI login behavior for me goes way back to 10.2 or 10.3, so it's usually a command (or variants depending on the OS) I run as part of the setup of any of my Macs.

Sep 1, 2012 9:51 AM in response to Eric.

You dont have a command to adress the problem with the drives being unmounted instead.

For me its annoying to have my mounted drives being unmounted on my macmini that dont have to sleep.

(the command wouldnt help since I dont login after sleep so to speak)

Sep 2, 2012 2:42 AM in response to Community User

Martin,

That command changes the automatic mounting and *unmounting* behavior; with 'yes' they will automatically mount only on startup/insertion and automatically *unmount* only on shutdown.


Login, logout, sleep, fast user switching will then have no bearing on which external (USB, FW, TB) are mounted or unmounted.


You can still manually unmount externals (and remount them) too with Disk Utility or from the command line. So for instance, with that command active, if I manually unmount an external, I can logout and login and it will stay unmounted; if I use fast user switching and login with the other user the External remain unmounted. With the default OS behavior the external would remount when I login with my account or any other user.


You can always try for yourself; if they're still unmounting on they're own there may be something else. If you want to return to the default settings, just change Yes to No:


sudo defaults write /Library/Preferences/SystemConfiguration/autodiskmount AutomountDisksWithoutUserLogin -bool NO

Sep 4, 2012 3:47 PM in response to iamapple

Some updates here that might be of help to some people.


(1) There is a Developer Bug about this problem. The number is 10005983. Useful if phoning this in to Apple Support.


(2) Check your USB cables. Swap them out for high quality ones. Since replacing the default D-Link cables that came with my hubs with quality (Apple) USB 2.0 cables, my drives now appear to be solid. This is blowing my mind. The only thing I can think of is that USB 3 and/or 10.8.1 is putting more demands on the hardware.


(3) Eric's Terminal command above is helpful, in case there is a drive lag issue upon GUI login (spin-up lag) that is creating the undesired unmounts. It should keep the drive connected and at least remove one potential process that could be causing the hang / unmount. I'm not sure what the security risks might be though, or if this might create issues if the drive is disconnected while the Mac is asleep. AFAIK, the external HDDs are designed to eject upon Sleep for a reason, so that in case of accidentally power loss or disconnection there is no issue.


(4) I have escalated the issue with Apple Support (Engineering), and they're poring over a Capture log from my machine. Once I hear back from them this week I'll let them know about the cable issue above. Evidently hardware is very much part of the equation here.

Sep 5, 2012 5:12 AM in response to slackerbot

Just to chime in here.

Everything was fine on Lion before upgrading to ML. I upgraded a bit late and so was directly on 10.8.1.


MacBook Pro mid-2010 15" 2.66GHz i7 with 8GB RAM. Running an SSD plus my old upgraded 750GB HD.


The issue is with an external LaCie 2TB hard drive. It's USB 2.0 and connected to a hub, as is all of my other drives except for one 1.5TB FW drive. Nothing else is affected on wake from sleep except the LaCie 2TB drive. If I leave it alone for awhile, it eventually remounts without having me do anything. My NAS drive also is not affected.


I don't think it's a USB 3.0, cable or hub problem. Everything was fine before the ML update.


The only thing that is different is that the problem drive is formatted FAT32 and all of the rest of my drives are Mac OS Extended (Journaled).


EDIT: Sorry, I lied about the NAS drive. But I think that's expected upon sleep.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

External hard drive ejects on sleep

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.