You needed to recreate a filesystem. You tried diskutil eraseVolume disk2
but this is invalid. See man diskutil or diskutil eraseVolume --help
for details.
Firstly you need to tell diskutil what filesystem (if any) to use and secondly while in some odd cases (RAID for example) you create a filesystem on the whole physical disk normally it is on the partition. From your picture disk2
is the physical disk and disk2s2
is the partition so you want something like this:
diskutil eraseVolume JHFS+ WhateverName disk2s2
where :
JHFS+
is the filesystem you want (in this case journalled HFS+). Valid values can be seen by entering diskutil listFilesystems
but from your picture it seems you had a HFS filesystem before.
WhateverName
is the volume name you want (can be any valid characters, quoted if necessary)
disk2s2
is the partition you want to create the filesystem on.
What probably happened
From your picture disk2
is your physical USB drive. When you format a drive in Disk Utility macOS creates a small file called a partition table at the start (and if a GPT disk the end) of the disk. This file holds information showing where partitions are on the disk and their type. It will then normally create a small (invisible) 200MiB EFI partition (disk2s1
) followed by one or more other partitions (disk2s2
, disk2s3
etc) that you request.
In your case the second partition was a 256GB HFS partition. This was probably journalled HFS as it is the default, but not necessarily - the filesystem type code AF00
doesn't distinguish journalling. You can see from this support doc Apple recommends it in many cases.
When you started writing zeros to disk2s2
it destroyed the filesystem by overwriting it with zeros. The partition table entry showing the start, end and type (AF00
) remained. Therefore creating a filesystem in the partition fixed it.
Note on cleaning
Overwriting 7 times with zeros is a massive overkill. Once is enough and more than that is a waste of time.
See this stackoverflow question: How does a 7- or 35-pass erase work? Why would one use these methods?
or this askubuntu question: Possibility of recovering files from a dd zero-filled hard disk
diskutil list
from terminal and edit results into your question if it still doesn't work.diskutil eraseVolume disk2
anddiskutil fdisk -iy disk2
and nothing works. I can neither mount it nor erase it since it wouldn't unmountdisk2s2
(the partition) notdisk2
(the physical disk). You could try something likediskutil eraseVolume JHFS+ WhateverName disk2s2
(or/Volumes/disk2s2
but notdisk2
). Please add results ofdiskutil list
to be sure.