|
|
#1 |
|
Prospect
Join Date: Nov 2012
Posts: 3
|
Help automate Disk Utility tasks.
Hi there,
I need help automating a task that is seemingly simple, but needs to be done over and over to different drives (as required by my job), and it's the following: I need to do a full secure format/erase on select drives. So what I need the automator/script to do is: (Run) - Choose drive - Choose a full secure erase, or "empty space" erase - Confirmation message. - Start the full erase. - Notify when done. That's it. I need this for two reasons. One of which being the redundant task of needing to securely erase drives we have at work, or empty space of drives that need the data kept. I also have others who need the same program, but aren't computer savvy. So this would make life easier for both of us. Thanks ahead of time. Best Regards. |
|
|
|
|
|
#2 |
|
All Star
Join Date: Jan 2004
Location: Limerick, PA
Posts: 687
|
Disk utility is ultimately a command line executable. Use a shell script in terminal.
Man diskutil for info |
|
|
|
|
|
#3 |
|
Prospect
Join Date: Nov 2012
Posts: 3
|
So if I find a Shell Script that can give those same commands to the Terminal, it'd work without using an Automator or Disk Utilities?
Thanks nice to know ![]() What about that last line you said, I don't know what you mean. "Man diskutil for info"? Thanks. |
|
|
|
|
|
#4 | ||||||||||||||||||||||||||||||||||||||||||||||
|
League Commissioner
Join Date: Sep 2003
Location: Tokyo
Posts: 6,045
|
These are all tasks that Disk Utility already does, and does quite well. Wrapping it in another utility seems excessively complex.
A good reason for the above, but if this data is important enough to require secure erase, then I would never consider delegating it to anyone who can't identify SATA and PATA from across the room. The probability of a major foul-up is ... large? Are these full size spinning drives, or USB storage? If you are simply decommissioning old drives then a power nailer is much more efficient than secure erase (large-calibre handguns are a lot more fun, but the power nailer doesn't need permits). |
||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|
|
#5 |
|
Prospect
Join Date: Nov 2012
Posts: 3
|
I found a few commands I could type in Terminal to get some things done that I wanted.
Things like typing this in the command line: diskutil info /dev/disk0s1 <-- depends on the disk you want to get info on. - This line just shows some info on the drive. Then I found things like: diskutil reformat <-- I don't know how to use that one. It keeps asking for the format, and I have no idea what formats are available or how to choose them. I tried writing FAT and NTFS, but nothing worked. Basically, could someone help me with writing a sample per code of the following: - How to fully format a drive I think it starts like this: diskutil eraseVolume - How to erase the free space of an external drive. diskutil secureErase freespace 0 /dev/disk0s1 <--- i'm not sure if that's the right way to select a drive. (Writing a number after "freespace" shows how many levels of format you want done. - How to do a secure format of an external drive. diskutil secureErase <--- that's all I know, I don't know how to select the format/level/drive/name... Basically, could someone just "fill in the blanks" for me, or show me examples? Thanks. |
|
|
|
|
|
#6 |
|
League Commissioner
Join Date: Sep 2003
Location: Tokyo
Posts: 6,045
|
diskutil comes with a very good man page, did you check there?
And before we go any further, you are aware that the device identifier is subject to change, and that using the wrong one will be very bad for your local storage? There's a simple shortcut to "erase free space" that runs faster: cat /dev/random > /Volumes/DiskName/bigfile; rm /Volumes/DiskName/bigfile |
|
|
|
|
|
#7 | |||||||||||||||||||||||
|
Site Admin
Join Date: Jan 2002
Location: Montreal
Posts: 31,938
|
You probably would benefit from reading this Unix FAQ (The 'man' command is mentioned in the "commonly used commands" section)
__________________
hayne.net/macosx.html |
|||||||||||||||||||||||
|
|
|
|
|
#8 |
|
League Commissioner
Join Date: Sep 2003
Location: Tokyo
Posts: 6,045
|
man ( ual for the program named ) diskutil
It's the instructions. If you want to use unix programs, you need to Read The Fine Manual that came with it. Skimming the manual, and copy/pasting commands from websites, are really good ways to destroy your system, as a recent user here found out - something copied from Apple's website of all places erased his main drive, his external drives, AND his backups. And it didn't say "are you sure?" |
|
|
|
|
|
#9 |
|
Major Leaguer
Join Date: Apr 2010
Posts: 324
|
Reading your question, I was curious about the answer and found some information online:
Programatically Secure Erasing Free Space Deleting and merging a partition with diskutil from the command line OSX Securely erase free space from Terminal If you don't find a shell script, you can have Automator run a shell script and type in the command you want.
__________________
see a problem; solve a problem. Last edited by sojourner; 12-01-2012 at 04:23 PM. |
|
|
|
![]() |
| Tags |
| automator, disk utility, full erase, secure erase |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|