Disk Utility won't erase my USB flash drive ("Couldn't open device")
I am willing to dual-boot my MacBook Pro (13-inch, Early 2011) macOS Sierra to install Ubuntu.
I am having some trouble with my USB flash drive when I try to erase it using Disk Utility. It says:
Erase process has failed. Click Done to continue.
Unmounting disk
Couldn't open device.
Operation failed...
Open Terminal, and type
$ diskutil list
/dev/disk4 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *8000.1 GB disk4
1: 0xEF 12.3 MB disk4s2
It cannot display the USB. To erase the USB completely, run:
$ diskutil eraseDisk free EMPTY /dev/disk4
$ diskutil list
/dev/disk4 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *8.1 GB disk4
1: EFI EFI 12.3 MB disk4s1
The first thing I would try is restarting your MacBook Pro in Safe Mode and trying to erase the USB flash drive then.
To start in Safe Mode:
- Fully shut down your Mac
- Restart your Mac
- Immediately press the Shift key and keep it down
- Let go of the Shift key when you see the login window (NOTE: If you have FileVault enabled you may need to log in twice).
- After booting up, insert your USB Flash Drive
- Launch Disk Utility and try erasing the USB Flash Drive
- To exit Safe Mode just restart your Mac as normal
If this does't work, take a note of any error messages and report back.
I was getting this same error and discovered that the MicroSD Adapter I was using had a read-only switch enabled. Toggling the read-only switch off resolved the problem.