Erase bootable linux USB

Any ideas how to bring back to life 64gb usb drive after unsuccessful erase. It was a bootable kali linux usb drive with two partitions. First I used disk utility to simply erase the whole usb drive(not partition) but during the process after "creating the partition map" having this error: "Couldn't open device.: -69877"


Same thing with the terminal:

diskutil eraseDisk free EMPTY /dev/disk2
Started erase on disk2
Unmounting disk
Creating the partition map
Error: -69877: Couldn't open device

+

diskutil eraseDisk ExFAT USB64 /dev/disk2
Started erase on disk2
Unmounting disk
Creating the partition map
Error: -69877: Couldn't open device


At this moment this is what diskutil list shows me about the drive:

/dev/disk2 (external, physical):

#: TYPE NAME SIZE IDENTIFIER

0: *62.9 GB disk2


and that is what the osx disk utility shows:




MacBook Pro 13″

Posted on Aug 14, 2023 8:13 AM

Reply

Similar questions

3 replies

Aug 15, 2023 12:12 PM in response to brandytrips

If this was just a Kali USB stick where you transferred in .iso image onto the USB stick, then sometimes macOS won't be able to do anything with the USB stick until you destroy the partition table by overwriting the beginning of the drive with zeroes. Usually after that Disk Utility will properly erase the USB stick. Even a drive with a regular partition table & native macOS file system on it, sometimes I have found Disk Utility will fail to erase the drive (even when the whole physical drive is selected to be erased), but if I try to immediately use Disk Utility to erase it again, the erase will succeed....no idea why this occurs. For a bootable Linux (or non-Apple OS) USB stick, transferring the .iso to it causes problems for macOS since many .iso images have a complex partition layout which many times is also read-only.


You can either do as @VikingOSX suggests and use either Linux or Windows to properly partition & format the USB stick (any file system should be Ok) so that Disk Utility will be able to erase the whole physical USB stick. Or you can use the command line to write zeroes to the very beginning of the USB stick causing the partition table to be destroyed so that Disk Utility will be able properly erase the USB stick.


Another possibility is that the USB stick is bad. The quality of many USB sticks is extremely poor and many times issues can be intermittent. If I monitor the accuracy of the data on a USB stick, usually most of them will show bit errors....some infrequently while others may show bit errors much more frequently.


Also make sure to connect the drive directly to the Mac just in case an adapter, dock, hub, etc. is causing a problem.

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.

Erase bootable linux USB

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