Is my external USB drive causing erratic sleep/hibernate behaviour? I've been reading up around sleep settings as I keep finding my Late 2012 Mac Mini in a weird hung state each morning that requires a force-reboot (it's like running Windows 10 years ago!)

I thought the "deep sleep" function was to blame but when I ran pmset-g I got this:

System-wide power settings:
Currently in use:
 standby              0
 Sleep On Power Button 1
 womp                 1
 autorestart          0
 hibernatefile        /var/vm/sleepimage
 powernap             0
 networkoversleep     0
 disksleep            10
 sleep                60
 autopoweroffdelay    14400
 hibernatemode        0
 autopoweroff         1
 ttyskeepawake        1
 displaysleep         10
 standbydelay         4200


However Difference between autopoweroff and standby in pmset says:


  With the release of the OS X Mountain Lion v10.8.2 supplemental update
  2.0, a new feature was introduced to enter safe sleep after four hours of the computer being connected to AC power. This is an effort to
  comply with the European Energy Standards (ErP Lot6). This will only
  occur if there is no wireless or Ethernet activity and no activity
  from external devices such as USB storage devices.


I have an external USB hard-drive as the 2nd drive on my SSD MacMini as my main data drive. If this is turned off, I recently noticed the system won't boot (folder with a question mark) which seems odd for an ancillary drive. Either way, would the presence of this drive prevent deep-sleep/hibernate/standby?


It will sleep a couple of hours fine, it's only overnight it has issues
It generally still has lights on my connected USB mini-hub when it is frozen
It typically "semi-wakes"; the screen recognises an active input and typically I get a black screen with a responsive mouse cursor


I started writing a totally different question but then was thinking whether my USB drive might be a culprit here or I should be looking elsewhere?

How can I tell if the Mac is is sleeping Vs standby Vs hibernate Vs deep-sleep to track down which transition or action is causing the problem?
To determine the sleep mode it is using, you would have to peruse the system.log in the Console.app (Applications > Utilities).

The problem when trying to wake it up sounds like there is an issue with the external USB drive not responding properly.  It could be a compatibility issue with the drive, the "USB mini-hub" is getting in the way, or a power-related issue where the USB hub needs power from the Mac to spin up the USB drive but it can't until the Mac responds.

Try plugging the drive directly into the MacMini instead of using the USB hub and see if the problem continues.

You could reconfigure the power management settings to not sleep.  The MacMini uses very few watts of power when idle so the cost is minor compared to the issues here.

You could also try using this command to configure the USB drive to not power down when idle.  This might trick the MacMini into thinking it is still being used so it wouldn't go to sleep.  (It has been a long time since I used this command so I'm not sure it still works)

/usr/bin/touch /Volumes/USB_DRIVE_NAME/.keepDriveAwake