Keeping a drive mounted

I’ve got an OWC Thunderbay mini attached via TB to a current gen iMac running Catalina…and it periodically dismounts itself. I’m trying to figure out how to keep it mounted and after some investigation figured out that a simple script to see if it is mounted and then mount it if not triggered periodically by Lingon should do the trick. The drive is the data drive on a file server so obviously it getting dismounted doesn’t work.

After spending 30 minutes googling and trying to modify various applescripts I found as well as opening the Disk Utility dictionary…I have concluded that I don’t know enough applescripting to write it although I suspect it’s pretty easy…some combination of system events and examining the contents of /Volumes and then proceeding.

If anybody can easily do this…please drop me a note off list or if it’s short and sweet just post here…part of the problem may be that many of the ones google found are old and the language has changed over the years. Much appreciate any assist.

Keep Disk Spinning perhaps

Does that do anything more than what ’never spin drives down’ in Energy Saver does? The strange thing is that sometimes it goes 2 weeks without dismounting and sometimes every other day…and while I do use the iMac for Lightroom it doesn’t appear to be related to that.

The Apple preference controls whether macOS sends the drive a “go to low power mode” command when it thinks the device will be idle for a while.

Some drives (like “green” drives from various manufacturers) will automatically put themselves to sleep after a period of inactivity, even when they haven’t received any command to do so.

Keep Drive Spinning works by periodically writing to a hidden file, ensuring that neither macOS nor the drive thinks it is idle:

1 Like

Forgot to add…the Thunderbay mini’s drives to not mechanically spin down…they’re still running but dismounted from the iMac.

I wonder if Keyboard Maestro could do this for you pretty easily. I use it to mount and unmount a particular SSD automatically once a day (plus I use it for about a thousand other esoteric little automations).

I have had this problem with my TB3 drive from OWC, but after moving it to a different TB3 port on the iMac, it has not happened recently. I really think the TB plug is not a firm connection and when I move the iMac screen (which has a pivot to be able to move) things go wonky.

try to move it to a new plug and see if that helps. I am still on Mojave at this time.

It’s mostly a server unless I’m using Lightroom…while I could probably configure KM to remount it I don’t think you can schedule KM to do something periodically or not. What I normally do is log in via Screens 4 to the iMac and remount it with Disk Utility…which works but having it happen automatically would be better.

Thanks Ray…I’ll give that a try…but it happens without ever even being near the iMac sometimes…maybe it’s just a slight mismatch between the plug and the cable and another port will solve the problem. I hadn’t thought of that…but when it disappears I can Screens 4 connect from my laptop to the iMac, run Disk Utility and remount it…but maybe it’s an intermittent disconnection caused by walking around the house or whatever…but there are never any “improperly disconnected drive” dialogs on the screen.

Sorry, I left out part of my suggestion: KM has a “when this volume is unmounted” trigger. So anytime that disk unmounts, that macro would be activated automatically. The macro that gets triggered could simply be a shell script to mount the disk.

Definitely worth a try, but I wouldn’t expect it to work.

In my experience, when a drive spontaneously goes off line, it is an “eject” not an “unmount” operation. I can’t just use Disk Utility to re-mount it. I need to power cycle the drive or hot-plug its USB cable to make it come back.

Good point.

Ah…I will check on that then…I have a license for an older version than current…but it’s probably not worth lying for the upgrade for that…unless I can’t figure out a free or cheap solution.


I believe versions of Keyboard Maestro back to version 4 or 5 still work on macOS today (and older versions only ceased working because of the 32-bit transition), so you may find that your older version of Keyboard Maestro still works.

You could definitely do this with launchd (have it monitor /Volumes/ and whenever it changes, make sure the drive is still mounted). Eventually you’d probably need a shell script or AppleScript to mount the drive and (IIRC) the last time I looked, the only way to do that was to embed the password for the drive in the script.

Semulov from kainjow might be worth looking at. It’s free, and although it is designed to unmount drives, it will also easily let you re-mount them… but it would not be automatic.

That was my original thought…but I’m not a scripter at all so don’t have any idea how to make the script work or what to put in the launchd file. I installed Keep It Spinning as suggested earlier in the thread and it hasn’t dismounted yet but it’s only been a couple of days and it’s random so it may or may not be fixed. Also figured out that Carbon Copy Cloner auto mounts the source volume when a job runs…so I can set up a dummy job that clones a single folder with a text file in it and that will force remount if it’s gone.

1 Like

The iMac I purchased in February 2020 came with Catalina installed. I have never been able to use either of my USB-C/TB3 ports without constant disk ejections, mostly overnight, but sometimes when in active use. The 4 ports on my 2018 Mac mini running Mojave have never given me any trouble.

Just after the new year, I decided to bring Catalina up to the latest version in preparation to take the thing in for warranty. And hooked up both a USB and a TB3 enclosure to the two ports. After nearly a year of pulling my hair out, the latest update I installed completely stabilized things. I haven’t seen a random eject message since I installed the update on the 4th - prior to that the longest I could go without a drive ejecting was a day or so.

The update that fixed this nightmare? “Security Update 2020-1 - Version 10.15.7”

I did not expect a bug like this one to be fixed by a security update. I am still a bit unsure if the fix was somehow a fluke and have a concern that updating to Big Sur might put me back in eject hell… but things are finally good for the moment.

I’m sure we all have had issues that seemed to apply only one machine where a fix mysteriously happened after we applied a supposedly unrelated update. I reported on such an issue when IOS 14 was introduced last year.

I guess that in many of these cases, the code that was modified had nothing to do with the fix. However, the installation process forced some setting or cache that had been corrupted to be regenerated from base elements. The corruption was actually the cause of the problem; so regenerating it fixed things.