I will try to be short with this. I have a 3tb hard drive that shows likes this:
frosti:~ abelpinate$ diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *120.0 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_APFS Container disk1 119.8 GB disk0s2
/dev/disk1 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +119.8 GB disk1
Physical Store disk0s2
1: APFS Volume solstice - Données 80.4 GB disk1s1
2: APFS Volume Preboot 28.4 MB disk1s2
3: APFS Volume Recovery 523.6 MB disk1s3
4: APFS Volume VM 4.3 GB disk1s4
5: APFS Volume solstice 11.1 GB disk1s5
/dev/disk2 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *2.0 TB disk2
1: EFI EFI 209.7 MB disk2s1
2: Apple_APFS Container disk3 2.0 TB disk2s2
/dev/disk3 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +2.0 TB disk3
Physical Store disk2s2
1: APFS Volume unison 2.0 TB disk3s1
/dev/disk4 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: *3.0 TB disk4
Trying directly from Disk Utility app, isn’t able to format, so I came to Terminal to try it. Since there, I try this:
(I came to this by this threat: https://www.reddit.com/r/applehelp/comments/40yvjh/disk_utility_fails_to_eraseformat_an_external_hdd/)
frosti:~ abelpinate$ diskutil unmountDisk force disk4
Forced unmount of disk4 failed: at least one volume could not be unmounted
frosti:~ abelpinate$ sudo dd if=/dev/zero of=/dev/disk4 bs=1024 count=1024
Password:
dd: /dev/disk4: Device not configured
5+0 records in
4+0 records out
4096 bytes transferred in 36.243454 secs (113 bytes/sec)
frosti:~ abelpinate$ diskutil partitionDisk disk4 GPT JHFS+ "My External HD" 0g
Could not find disk for disk4
frosti:~ abelpinate$ diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *120.0 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_APFS Container disk1 119.8 GB disk0s2
/dev/disk1 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +119.8 GB disk1
Physical Store disk0s2
1: APFS Volume solstice - Données 80.5 GB disk1s1
2: APFS Volume Preboot 28.4 MB disk1s2
3: APFS Volume Recovery 523.6 MB disk1s3
4: APFS Volume VM 4.3 GB disk1s4
5: APFS Volume solstice 11.1 GB disk1s5
/dev/disk2 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *2.0 TB disk2
1: EFI EFI 209.7 MB disk2s1
2: Apple_APFS Container disk3 2.0 TB disk2s2
/dev/disk3 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +2.0 TB disk3
Physical Store disk2s2
1: APFS Volume unison 2.0 TB disk3s1
/dev/disk4 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: *3.0 TB disk4
frosti:~ abelpinate$ diskutil partitionDisk disk4 GPT JHFS+ "My External HD" 0g
Started partitioning on disk4
Unmounting disk
Creating the partition map
Error: -69877: Couldn't open device
(Is a disk in use by a storage system such as AppleRAID, CoreStorage, or APFS?)
From there, I came to this: (based on this https://simpsora.wordpress.com/2012/08/12/recovering-from-an-external-drive-failure-on-mac/)
frosti:~ abelpinate$ diskutil repairDisk /dev/disk4
Nonexistent, unknown, or damaged partition map scheme
If you are sure this disk contains a (damaged) APM, MBR, or GPT partition map,
you can hereby try to repair it enough to be recognized as a map; another
"diskutil repairDisk /dev/disk4" might then be necessary for further repairs
Proceed? (y/N) y
Error repairing map: MediaKit reports bad partition or no map found (-5324)
So, I used those things (based on this MediaKit reports bad partition or no map found (-5324))
frosti:~ abelpinate$ sudo gpt -r show disk4
Password:
gpt show: unable to open device 'disk4': No such file or directory
And as you can see, I have tried a lot, without know where to go. The hard drive was part of a hardware raid and one day the mirror stop to work. So I disconnect and time to time, I have tried to reach for a solution, but this the first time I get to deep and ask to people who may help me.
I can't be sure the hard drive has a failure. I don't remember if one time or another, told me that there where bad sectors.
Thank you very much Abel