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 :
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.
If this method doesn't work, would formatting the entire MacBook also delete the virtual disk container where the disk image was mounted?