1

I'm having trouble removing disk images. For reference, my Mac is an Apple Silicon.

I made a disk image using Disk Utility to create a secure folder, but I want to completely erase the image so that no one can recover it.

I've searched the Internet for ways to delete a disk image, but since it's a read-only file, methods like "erase" or "Delete APFS Volume" in Disk Utility don't work at all.

When I try these methods, an error message appears :

An internal error has occurred

I also tried the same method on the parent disk container, but it didn't work either. When I ran First Aid, it gave me the error message :

File system verify or repair failed. : (-69845) and didn't work at all.

And I tried to remove specific files inside folders in the disk image through Terminal, but they were read-only files and couldn't be removed.

So I went into Terminal and entered the diskutil list command. When I tried the diskutil apfsdeleteContainer <identifier> command, I got the error message

Error: -69772: A writable disk is required

Now, I'm considering these 2 methods :

  1. I'm wondering if I could just put the disk image file (.dmg) in the trash bin. Would this mean that even if someone tries to recover my MacBook, they really completely won't be able to access the contents of the disk image file? I want this process to work well.

  2. If this method doesn't work, would formatting the entire MacBook also delete the virtual disk container where the disk image was mounted?

enter image description here

enter image description here

enter image description here

4
  • this is my question and I didn't get answer that I want.
    – Heart Lion
    Apr 12 at 11:55
  • 1
    You never clarified what you actually did, just abandoned it in favour of this one - which is still very unclear.
    – Tetsujin
    Apr 12 at 12:01
  • A Disk Image is a file on your hard drive. If you double-click it, it will mount. When you've finished with it you can unmount it either clicking the Eject icon in the sidebar, or by selecting & Cmd/E or dragging the mounted disk icon to the Trash. Whilst mounted you can treat it exactly like any other mounted disk - add files, throw them away, anything. If you've finished with it entirely, just unmount it & throw the underlying file in the Trash, then empty the Trash.
    – Tetsujin
    Apr 12 at 12:19

1 Answer 1

2

Yes, you can simply put the DMG in the trash and delete it. If it was an encrypted disk that's all you need to do, because even if someone recovers it they won't be able to decrypt it without the password.

If the DMG was not encrypted it could still (technically) be recovered. If you have a disk-type drive you can use an old command-line utility called srm (secure remove) that will overwrite the data with different security levels. You'll have to find it online; Apple doesn't ship it anymore because srm will chew up SSDs (in other words, DON'T use it on a solid state drive). But SSDs are constantly moving data around to extend drive life, so over time it should render the data unrecoverable anyway.

A third option is to delete the DMG, then use disk util to create a new encrypted DMG that takes up most of the free space on your drive. While I'm not sure if this next step is strictly necessary, you might add space-filler to the DMG (e.g. copy some biggish image file into the encrypted DMG, then select-all/duplicate, select-all/duplicate... until the encrypted DMG is mostly filled). Then delete that DMG. That should randomize most of the space on the drive at the expense of a boring afternoon.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .