Please help me understand and manage external hdd sleep
I have an external drive (3.5" hdd, SATA) in an enclosure (usb 3) (purchased separately), connected to a thunderbolt dock (OWC) connected alternately to an iMac and a macbook pro. The HDD goes to sleep, and causes problems. Freezes, weird internet access problems, kernel panics.
I have done some research, and can't seem to figure out:
how to know whether it is the drive, enclosure, or computer causing the sleep, although, fiddling with various settings on the mac seemed to have no effect, although it may have increased my battery usage :(
how to adjust settings on the drive, or in the enclosure.
How to determine what the sleep behavior of prospective drives will be.
As a workaround, I tried to write a zsh script to touch the drive ever few seconds. This kinda worked, but was a struggle to figure out appropriate permissions issues and how to make it run automatically.
I welcome all guidance, pointers to resources, clarifications, incantations, well-wishes.
Make & model number of the drive, enclosure, and dock? That would help narrow it down when it comes to google searches.
I'm not very familiar with macOS, so I likely can't help you on the software side, if that's the cause. But just as general tech support advice, I would recommend trying to remove the variables one by one, in order to identify the culprit. That's what I do for most tech support issues I can't find a solution on google for.
E.g. In this instance, see if the same issue occurs with another SATA drive (if you have one handy) in the same enclosure. If it does, remove the drive from the enclosure, and plug it into the dock using a SATA to USB adapter (make sure it supports 3.5" drives, since they require external power). If it still happens, try using a different dock (if you have one handy) or by plugging the drive directly into the iMac. If it still happens, it's probably something in the OS.
p.s. That's the thorough approach, but you could probably just start by buying the powered SATA to USB adapter and plugging the HDD directly into the iMac. If the issue persists, then it's either the HDD or something in the OS. If it doesn't persist then it's likely your enclosure or dock. My money would be on the enclosure, BTW, since a lot of them come with built-in, poorly designed, power saver / auto sleep bullshit.
That’s a great analysis and I thank you. A better worded question would have saved you the trouble.
It is definitely the enclosure dock combo which causes kernel panics. The enclosure connected directly to mac results in “ekect before disconnection” errors. Research suggests this is a faitly commin problem amon external enclosures, potentially resolved by using usb 3.1 gen 2 usb-c connections.
I guess my question is more about how to identify devices before purchase regarding their sleep behavior, more specifically finding devices which won’t exhibit this issue.
Ah, okay. To identify enclosures that have a built-in sleep mode that will potentially override the system settings and cause problems... about the only thing you can do is google the make/model, read all their marketing BS, and dig into their spec sheets (if they provide any). If you see a mention of auto sleep mode, power/energy saving features, or an "intelligent" or "smart" management chip, you probably want to avoid it.
p.s. If you're looking for enclosure recommendations, you could try asking on /r/datahoarder, but they mostly deal with multi-drive ones so might not be able to help you. And as for myself, IME most Sabrent enclosures/docking stations are pretty simple, don't have any of that BS, and so they might be worth looking into.
My vote is on the enclosure as well. It’s the part that has the lowest barrier to entry for manufacturing, but it’s expensive to actually test it with all of the possible drives you could put in it. And if you’re making an enclosure because it’s cheap to make you’ll skimp on testing.
My recommendation is to buy an “all in one” solution with a drive in a bespoke enclosure from a good manufacturer. Western Digital should be a reasonable quality bar. I’m sure they aren’t perfect but they have a good reputation. It’s much easier to test when you have 1 drive and 1 enclosure combo.