Curious problem: after waking from sleep, my external drives start spinning up and down continuously!

I’m posting this to check if anyone has a clue about this strange behaviour, searches online so far didn’t bring any result.

Problem: I have a Mac Studio M1 Max from 2022 [bought in January that year].
I had an external drive LaCIE 5big thunderbolt2 attached. I noticed that every time I put my Mac to sleep for the first time after it booted, then woke it, the external drives would spin up as you would expect. But then after perhaps a minute would spin down… then after few min spin up again and down again, and it would go on forever.
I thought it might be a problem with the driver, with the thunderbolt TB2>4 adapter that I bought from apple, but couldn’t find anything.
Also tried the different Terminal commands for external drives sleep settings [Howard Oakley has an extensive article on that as well] but even with sleep settings completely disabled the problem persisted.

I also bought a standalone LaCIE external [single] drive to use as TimeMachine, that was connected via USB-C, and I got the same behaviour on that drive too, so the problem was not tied to thunderbolt or adapter.
My only solution since then is to never put my Mac to sleep. I always keep it running normally with only the display in sleepmode.

More recently I replaced the LaCIE 5Big with a QNAP DAS system. different HW, different drivers… but to no avail, the problem remains!

Even after many OS updates [that could also be the issue] the problem remains to this day.
I’m suspecting since a while it’s a problem related to my Mac Studio itself! Apple Care coverage has expired so that route is closed now.

Anyone else seen this strange behaviour with their external drives on their Mac Studio’s?

This is similar to a problem that appeared a couple of years ago with a setting that was more relevant to Macs that run on battery power. Try turning off the middle two Energy Saver settings (“Put hard disks to sleep” and “Wake for Network”). Does that help?

There is another thread in these discussions that discusses the issue of Time Machine saving numerous “snapshots” and keeping external hard disks working harder than expected.
Recently I have noticed that my Macbook refuses to go to sleep if I manually try to do this. I haven’t looked into it so far but it seems similar to your problem.

Thanks, but this does not help.
Both those settings are never enabled on my machines. As mentioned I also played with various setting in terminal PMSET commands which basically give more options than those exposed in the GUI. Nothing ever changed the behaviour:

As long as the Mac never enters into sleep mode, all works fine.
If you put it into sleep mode the first time, Mac enters into sleep as expected.
If mac then wakes from sleep that first time, external disks start to spin down and up and after ±1min down again and up … continously.
If you put the Mac into sleep again, the external drives keep doing this even with Mac in sleep mode!
Only solution out of this is to reboot! Then external drives behave normally again.

It might be Spotlight misbehaving. Try adding the external to “Spotlight Privacy…”