Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

JayElDee

macrumors member
Original poster
Jan 11, 2011
91
4
Running 13.6.1
I have been using CleanMyMac for general maintenance, but it does not see all of my external drives. Their tech support has tried to help without success.
I want to automate checking and repairing disk permissions on a number of external drives. Is that possible with automator or some other technique?
TIA
 
Certainly. Disk Utility is just a graphical interface on top of the diskutil command-line tool.
 
so, I can open automator and just go through the steps and save it?
Yes and no.

You can use under "Utilities" in Automator the command "Run Shell Script", and within that you enter what you would execute in the macOS Terminal running 'diskutil'.

But Automator itself with its standard library of commands does not offer any disk utility commands directly.
 
so, I can open automator and just go through the steps and save it?

Yes, but personally, I wouldn't go this route: too many variables to reliably automate via recorder, I think. Eg. Names of volumes, encrypted or not (doing First Aid on an APFS drive with encrypted Time Machine on it seems to be really finicky re dismounting). Basically, probably would need an Automator workflow for each drive. But doable.

(Then again, I have not tried to automate this via Automator, I do it all via command line)

What @jido is talking about is something like this:

Code:
% diskutil unmountDisk diskX ; diskutil apfs unlockVolume diskXsY -nomount ; sudo fsck_apfs -y /dev/diskXsY
 

Attachments

  • automator.png
    automator.png
    216.9 KB · Views: 87
Thanks for the responses...
I have used and liked Onyx in the past, so I will look at that again—thanks for the reminder
yes, all of the disks are mounting, show in DU, and can be repaired via DU, but have to be done one at a time. Sometimes one will not unmount and I have to quit a certain program that is running in the background, doing nothing btw (it is a download program, so I manually quit it and then the drive unmounts and disk utility proceeds normally).
I tried automator and YES! it is very finicky. "too many variables to reliably automate via recorder, I think." Absolutely, I thik so also.
I will look at ONYX and see how that goes.
Thanks for the help
 
  • Like
Reactions: Queen6
What is your "general maintenance?" I am always a little weary of these utilities, with the exception of Onyx.
Be aware that macOS will check your disk state with every boot!
 
want to automate checking and repairing disk permissions on a number of external drives.

I am puzzled as to why you need to check and repair disk permissions frequently. Are they getting changed? I run a ton of disks, all over 3 years old, and have never had to repair any disk permissions.
 
@HDFan and @haralds
first, Onyx doesn't seem to do external disks, or I do not see how to do that.

I run my externals often over a home network. On occasion, very rarely, I have gotten error messages that tell me I do not have permission to access something on an external, never on the internal drive. When I'd run DU on them it would correct incorrect permissions. No, I am not changing permissions and I have full administrator power.
I tried Clean my Mac a few years ago, had been using Onyx, and was impressed by the number of things it,CMM, performed. At first it saw all of my external drives on CMM, ran the permissions check and out of habit I just continued doing the external permissions thing. CMM has the ability to monitor in real time many things, and would pop up an alert when something it thought needed to be addressed.
It was never intrusive and didn't seem to create any adverse effects. Running disk permissions regularly seemed to eradicate the incorrect permissions issue, or maybe it was coincidence?? So using it became a matter of habit.
yes, I have read that
macOS will check your disk state with every boot
I have not found that property to address the issue of the external drives. Maybe it only addresses the internal boot drive?
I admit I may be spinning my wheels on something not needed, but it seems to have addressed my original problem and out of habit I continued. I have not seen issues with permission over the network or when using DU in the past year.
Thanks again.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.