Cannot delete/erase APFS volume I have a MacBook Pro (Retina, 15-inch, Mid 2015) running Mac OS Mojave. When I boot it up, it shows a grey screen with a question mark on a folder.
I have figured out that the issue is with the internal SSD as I can boot from a USB installer with Mojave just fine. I can see the internal disk with diskutil and also see /Volumes/Macintosh\ HD/ from the terminal. I was able to recover the few files this way that I hadn't backed up earlier. However this was too slow as even an ls command on the Macintosh HD Volume takes a couple of minutes to execute and the system.log in /var/log shows loads of error messages of this type: Kernel[0]: disk1: I/O error. But, I managed to get the files I needed.
Now I want to wipe the SSD or atleast erase the data from the /Volumes/Macintosh\ HD/, but I am not able to do that. I tried Disk Utility but it just hangs every time I open it and running diskutil from the terminal on always ends up with some error. I have tried verifyVolume, repairVolume, eraseVolume, deleteVolume, deleteContainer and eraseDisk with diskutil but they all end with an error which looks something like this: Error: -69877: Couldn't open device or similar to this.
I found this answer here to delete the APFS partition using a bootable USB with Linux Mint. This ended with an error message too saying Input/output error.
Is there any way I can wipe the SSD clean?
The disk and the volume are not encrypted and I have also tried resetting NVRAM, PRAM and SMC but none of that helped. Booting up into Recovery Mode doesn't help either. It shows a spinning globe but there is no progress bar, and nothing happens.
You can try :
diskutil zerodisk force diskX

Where diskX is to be replaced by the internal SSD indentifier.
But given the previous errors, I doubt the effectiveness.
The best solution is to remove this SSD by following this link: https://www.ifixit.com/Guide/MacBook+Pro+15-Inch+Retina+Display+Mid+2015+SSD+Replacement/48251