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

amateur12

macrumors newbie
Original poster
Sep 30, 2016
28
3
Washington D.C.
List members:
I'm trying to erase an external HD via the Terminal. I'm running the latest beta of Sonoma.
When I enter the command "diskutil eraseDisk APFS EHD /dev/disk5", I get the message,
"Unable to begin erase operation: This operation is restricted by Sandbox; check your settings in System Settings > Privacy & Security > Files and Folders (-69464)."

When I go to System Settings>Privacy and Security> Files and Folders, I find that Terminal is already enabled to work with external disks. I tried toggling this command, without any change.

I would greatly appreciate any thoughts. Thank you in advance.
 
I don't have the answer to your question.

But...
Why don't you just use disk utility, which makes erasing drives easy?
 
I don't have the answer to your question.

But...
Why don't you just use disk utility, which makes erasing drives easy?
Thank you for writing. Disk Utility seems to give inconsistent results. When I erase and reformat the EHD with Disk Utility, old disk partitions still appear. Also, the EHD only intermittently appears on the desktop.
 
Hi,
I did quite a lot of (re-)formatting and as a rule of thumb:
1) diskutil from the Launchpad (Dock),
2) view: Show All Devices,
3) format the top container to get rid of the unwanted partitions.
4) (create and) format volume(s).
5) success!

;JOOP!
 
The most important step when using Disk Utility to reformat:
Go to the "View" menu and choose "Show all devices".

Now, look at "the list on the left".
You may see more than one listing representing the logical partitions/containers on the external drive, but...
The IMPORTANT one is "the top line" which shows you the PHYSICAL drive itself.
Click on that one, and THEN click "erase"...
 
The most important step when using Disk Utility to reformat:
Go to the "View" menu and choose "Show all devices".

Now, look at "the list on the left".
You may see more than one listing representing the logical partitions/containers on the external drive, but...
The IMPORTANT one is "the top line" which shows you the PHYSICAL drive itself.
Click on that one, and THEN click "erase"...
I tried Disk Utility again and it did work. Thank you very much for your help, greatly appreciated.
 
  • Like
Reactions: Fishrrman
what version of macOS 14? what does Diskutil info /dev/disk5 report in the terminal?
Otherwise try putting the name you have chosen for the newly formatted drive in single quotes:
diskutil eraseDisk ExFAT 'EHD' /dev/disk5.
 
what version of macOS 14? what does Diskutil info /dev/disk5 report in the terminal?
Otherwise try putting the name you have chosen for the newly formatted drive in single quotes:
diskutil eraseDisk ExFAT 'EHD' /dev/disk5.
Thank you for writing and for your suggestion.
For some reason Disk Utility decided to start working again. I was able to erase the disk ands format it as APFS. The disk now is accepting Time Machine backups, so I don't want to erase the disk again.
I would greatly appreciate any thoughts you might have about the earlier Terminal error message. An Apple advisor I called couldn't find it. The message was:

Unable to begin erase operation: This operation is restricted by Sandbox: check your settings in System Settings > Privacy and Security > Files and Folders (-69464).

What in the world does this mean?
In Privacy and Security Terminal was already enabled to look at external drives. I toggled this permission - no change.

Thanks again for any thoughts, greatly appreciated.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.