Skip to content

Instantly share code, notes, and snippets.

@jw-foss
Created December 31, 2021 13:26
Show Gist options
  • Save jw-foss/a2c7511575eaaacc567f5499ab58a8ac to your computer and use it in GitHub Desktop.
Save jw-foss/a2c7511575eaaacc567f5499ab58a8ac to your computer and use it in GitHub Desktop.

Sometimes Mac won't recognize your disk after you did something stupid, you should do:

# This command lists all your disks(internal & external)
$ diskutil list

# The result would be something like: 
# /dev/disk6[this number is important] (external, physical):

# After getting this number, we should do:

# NOT JHFS+ represents the format, you can always set any format you needed here.
$ diskutil eraseDisk JHFS+ [name] /dev/disk[number_you_get_from_last_step]

After this you operating system should be able to recognize your disk without any issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment