how do i securely erase free space on Catalina

With previous OS, you would go to Disk Utility and choose Erase. Now that option is not there.

MacBook Pro 13", macOS 10.15

Posted on Oct 28, 2019 8:47 AM

Reply
Question marked as Top-ranking reply

Posted on Oct 28, 2019 9:20 AM

Are you on an SSD? If so, the basic device I/O operations are wildly different from those of a hard disk drive (HDD), and the traditional assumptions based around how hard disk drive erasures work are utterly inapplicable to SSD storage.


Among the differences...

...SSD sectors are erased very shortly after the files are deleted, and must be erased before the storage is re-used, and SSDs work hard to make that erasure happen quickly. This is what TRIM expedites, and macOS supports TRIM.

...SSD sectors cannot be overwritten, due to wear leveling. Among other fundamental differences.

...You can’t write to the same physical sector on an SSD, as sectors are remapped on each deletion, and each rewrite. This due to wear leveling. (HDDs have an earlier form of this, which makes overwriting problematic.)

...The multiple-pattern-overwrite stuff dates back to floppy disks and to 1980s-era hard disk drives, which all had really sloppy head positioning. Modern HDDs, and particularly SSDs, work very differently here.


Encrypt your storage. Storage encryption combined with a secure password protects all of your data, including against any data that might remain on a failing or failed or replaced storage device; including any remaining data in a hard disk free space.


The Secure Erase operation is the analog to a pattern overwrite in a hard disk.


But whole-volume encryption is the preferred approach, and for various reasons.


If you’re even asking about free space erasure, your data storage is likely not encrypted, and you’ll want to fix that now.


Applying old lessons and old remediations against new situations and different platforms doesn’t always end well.

40 replies

Nov 4, 2019 2:15 PM in response to MrHoffman

I'm not sure I've communicated this effectively, so here's another shot.


I'm using VMware, which uses it's VMDK files to create virtual disks. These are dynamically expanding disks, so if I download an 8GB file, the VMDK expands by 8GB. When I delete that file, the underlying VMDK doesn't contract again, it keeps the file the size it was. Now, you can use VMware disk tools from the host to scan a VMDK file and it will reduce the size of the VMDK if it finds sections of the file that are zeroed out. It doesn't have anything to do with the underlying SSD that the VMDK file sits on. You can't trim it, because the file is the size that it is. That's where the secure erase functionality came in handy - while it wasn't effective on physical SSDs to erase them, it was extremely effective in writing zeros to the "unused" space on a VMDK, which the tools could then identify as empty space and thus shrink the VMDK.

Nov 5, 2019 6:34 PM in response to AlunTringad

I’d think the hardware absolutely matters, and processing host (uppercase) TRIM requests would be to the advantage of VMware here, too.


Contact VMware support.


They’re still going to have to re-map and re-pack their (presumably) virtual file system anyway, to (lowercase) trim the file.


BTW: VirtualBox supports (uppercase) TRIM, as well as VMware Workstation in at least some configurations, and ESXi. Those are all fairly old links, too.


Dec 30, 2019 11:46 AM in response to Shotster

Shotster wrote:

I was not aware a Fusion Drive would hurt resale.


Please re-read my replies.


If you scrap the Fusion drive—scrap, shred, physically destroy the device—then you can then replace it with one of three things, if you want to sell a working Mac system.


You can replace with an HDD, an SSD, or you can use what was a pretty good compromise from some years ago, but in more recent times SSD prices have been dropping and capacities have been increasing.


Price a replacement Apple Fusion drive, and price a third-party replacement SSD, and you’ll see why I tend to go with SSD with an iMac storage retrofit or repair or replacement. There’s not as large a price difference as there once was.


Pragmatically, an HDD will be the cheapest way out for a Mac destined for re-sale, with a scrapped Fusion drive.


And with an HDD or an SSD, you won’t have to mess with rebuilding the Fusion drive when you re-install macOS.

How to erase a disk for Mac - Apple Support


The goal here being to scrub your data and get to a configuration that can be re-sold, too.


Probably without spending more than necessary.


If you’re buying new for yourself, then you’re probably still going to be looking at SSD now.


Not a Fusion drive.


If a Fusion drive is even still offered on the Mac you’re looking at.


Now if you don’t scrap the Fusion drive, you’re going to go through the slog with overwrites. And you’ll need to cycle through those a time or two, so that you overwrite the extra space on the SSD. And you won’t be able to overwrite the revectored sectors on either the SSD or on the HDD, short of a low-level format.


Storage devices are cheap(er), and breaches are getting more expensive. Which is why a lot of used equipment has no storage.

Dec 31, 2019 1:24 PM in response to BDAqua

BDAqua wrote:

If nothing else you can fill the drive with garbage & duplicates of garbage, the n trash them & empty the trash.


Well, it seemed like a good idea, but check this out. It's what I got after duplicating a 4.6 GB disk image numerous times...




Basically, my 3 TB drive can hold 100 times its capacity! Ha! It's magic storage! 😜


So, after looking closely at this, my best guess is that the OS is super smart and efficient about disk storage. It apparently doesn't actually duplicate all the bits. Instead, it must store a reference of some kind. I ran Disk Utility, and it reports no issues whatsoever.


The odd thing, though, is that the last time the folder of duplicates was itself duplicated, it took about 5 minutes. If it's not actually copying all the bits, it must be making some very detailed and time consuming changes to the directory structure to ensure file integrity.


What other explanation can there be?

Dec 31, 2019 2:39 PM in response to Shotster

Shotster wrote:


MrHoffman wrote:

What other explanation can there be? Data compression, and copy on write.

Thanks for the reply, but I'm sorry, you lost me there. I have no idea what you're saying. The screenshots depict more than 1 Petabyte of data on a 3 TB drive.


You have a petabyte of zeros, and a whole file full of zeros compresses really well.

So while you have a petabyte of zeros when you look, you need far less actual storage.

Due to data compression.

Until you start to write non-zero values into those files, when your actual storage requirements will substantially increase.

And also due to copy-on-write, which means that file copies require negligible additional storage, until the file contents change and start to diverge.


MrHoffman wrote:

Some related reading:
http://osxdaily.com/2016/08/30/erase-disk-command-line-mac/

The article itself seems unrelated, but one comment by a reader seems highly relevant...

Very recently, I came across a situation where Disk Utility could not erase the HDD. Under the strictest supervision from Apple, I was able to do this from the command line. As it was a Fusion Drive, I was then instructed on how to merge or fuse the two disks – SSD and spinning platter. It all worked perfectly in the end BUT this is NOT for the amateur or faint hearted.

I just found this article, which seems to be what I've been after.


And which will not reliably erase everything, as SSDs and hard disks can and variously will have bad sectors potentially containing valid data. Which gets back to why folks yank drives and shred them now.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

how do i securely erase free space on Catalina

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.