MacOS – How to mount disks via cron in Mountain Lion

cronhard drivemacos

Is there a way to mount disks in Mountain Lion that works with cron?

The following command works fine from the Terminal:

/usr/sbin/diskutil mount disk1s6

But when executed via my crontab, it fails. My crontab is working fine, otherwise.

I've been using cron to mount my backup disk once a day before I do a smart clone via SuperDuper. (Possibly related… the SuperDuper release notes mention problems mounting drives in Mountain Lion, but I want to emphasize I was mounting drives separately using a shell script and/or cron.)

Any ideas or potential workarounds for this problem?

Best Answer

I had this same problem and found that I could get it to work if the cron job was launched under root.

This Apple discussion link has this note:

[...] Basically, Apple is tracking where an application launches from, and seems to be preventing processes that launch from "cron" (one of the system schedulers), even indirectly, from mounting local disk volumes, even when that application is signed.