Skip to content

Instantly share code, notes, and snippets.

@n0an
Created October 17, 2017 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n0an/c774b59916512045e0bd4a46008926ba to your computer and use it in GitHub Desktop.
Save n0an/c774b59916512045e0bd4a46008926ba to your computer and use it in GitHub Desktop.
Here's what I would try. First run
```
diskutil list
```
to get the name to the disk you're trying to format. The below commands assume this is "disk1", but replace "disk1" with the correct disk if it's something different.
Now unmount the disk:
```
diskutil unmountDisk force disk1
```
and then write zeros to the boot sector:
```
sudo dd if=/dev/zero of=/dev/disk1 bs=1024 count=1024
```
finally attempt to partition it again:
```
diskutil partitionDisk disk1 GPT JHFS+ "My External HD" 0g
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment