Why does my Macbook lock up while my external hard drive spins up?

6

Why does my MacBook lock up while my external USB hard drive spins up? It comes right back after a click or two post spin-up. It's pretty annoying since finder often sniffs the drives but the USB drive is typically asleep since I use it mostly for backups.

Notes:

  • The clicking I refer to post spin-up is just a couple of head seeks. The external drive is new and I have several others that cause the same temporary freeze of the OS.

  • The hard drive works great, it goes to sleep because I have the OS configured to allow it to sleep when unused

  • I'd rather not plug and unplug the drive a few times a day (I use it for mostly but not exclusively backups)

  • I don't want the drive spinning all day.. it's usually idle and should be quietly sleeping awaiting work

The issue is I'm sure as Tom suggests that the OS is doing a synchronous I/O touch on every disk... am I expecting to much of a modern OS ? It's lame that any time I open a Finder window it freezes a ton of things for a few seconds... what happened to multi-tasking?

==Update== This was fixed in a later release of OSX. The system no longer experiences any freezing nor hiccups. I am still using the same external drive as my primary time-machine destination and haven't seen the freeze nor hiccups in ages. Closing the question.

Ram

Posted 2011-08-18T01:24:03.887

Reputation: 977

USB ? FireWire? ThunderBolt ? – Thilo – 2011-08-18T01:25:54.720

It's a USB drive. – None – 2011-08-18T01:33:38.580

Answers

0

This turned out to be an unnecessary kernel lock in OSX that was addressed sometime in the OS X Yosemite time frame. It no longer happens at all. Thanks for all the theories presented.

Ram

Posted 2011-08-18T01:24:03.887

Reputation: 977

1

It locks up because it is waiting for a synchronous I/O request to finish, that request takes longer because your hard drive appears to be in not working smoothly, indicated by the clicks you hear.

Three options to remedy the problem:

  • Find a way to keep the drive from spinning down. A scheduled write, perhaps? Or an option?

  • Disconnect the drive and use it only when you need it for a manual back-up.

  • Get yourself a new drive, because it doesn't sound safe to put back-ups on such drive...

Tamara Wijsman

Posted 2011-08-18T01:24:03.887

Reputation: 54 163

1-1. Hard drive is working perfectly. In the question I explained why preventing spinning down is undesirable (noise, power waste). In the question I explained why disconnecting is undesirable. There is nothing wrong with the drive. – Ram – 2011-09-27T19:32:29.663

1@Ram: I don't understand your question anymore, you agreed with me in your last paragraph on the question only to down-vote me now? If you have a new question you should ask a new question, the answer to "Why does my macbook lock up while my external hard drive spins up?" has already been given and agreed upon... – Tamara Wijsman – 2011-09-27T20:29:29.123

I am having a tough time believing that a current OS goes into a synchronous block for a read only disk operation - it's bizarre; it is a reasonable theory and if were talking win 3 I just buy it right away. For a month now I try to believe it but it just hurts my head when I try. The minus one on the answer is because: (1) your conclusion about the drive being sick - I totally disagree, it's new it's fine it works as it should, (2) The other two remedies are counter to problem/solution framed in the original question. No offense, I just want an answer I can believe or a solution that works. – Ram – 2011-09-27T22:00:12.383

2Yes, if a driver doesn't get an answer back in time it will block your OS; unlike your applications which will always be asynchronous your drivers are doing RAW reads which no layers in between which means that it happens synchronous for them and thus they block if the hard drive doesn't respond at all. While the drive is spinning up, the driver does not get an answer and thus blocks the OS as all the I/O actions do not immediately return as they would when the drive is fully running. This is a fairly reasonable explanation and I have seen this happen across OSes; if not, the drive is sick... – Tamara Wijsman – 2011-09-28T01:46:47.687

You can't really expect your OS or their applications not to freeze if your drive is unavailable for a few seconds, a lot of calls will simply either lock things up or time-out. Applications are mostly protected against for small delays as they are written with threads; however, that doesn't stop Finder from being implemented in such way that if a I/O call doesn't return for some seconds that it should not lose responsiveness. In that case, that's a problem with Finder and not with your OS. I don't see what it else would be, or I would say that it freezes because of dancing unicorns... – Tamara Wijsman – 2011-09-28T01:51:25.073

1I'm taking that as 'finder could be better' – Ram – 2011-09-28T03:57:54.273