Samsun 840 SSD - errors using gdisk I have an older Samsung 840 SSD which I have connected with a USB-C to SATA III cable to my (2018) MacBook Pro. In Terminal, I've tried erasing it and always get an error that it's unmounted, so I try to unmount it and it's busy. I used to use it for a backup disk but I erased and reformatted it for Windows (ExFAT) because I was going to put it in a friend’s laptop as an upgrade.  Then the friend moved away after I had reformatted it back and forth from exFAT to Fat32 to JHFS+ so many times - can't even remember.  Now it only shows up in Terminal after a while (~1 hour), listed as single volume with no name or type. There's no data on it - I just want to be able to create a partition and load macOS on it again.

I just installed gdisk and here's what it says:

Warning! Read error 16; strange behavior now likely!

Warning! Read error 16; strange behavior now likely!

Partition table scan:

MBR: not present
BSD: not present
APM: not present
GPT: not present

Creating new GPT entries in memory.

Command (? for help): p

Disk /dev/disk2: 976773168 sectors, 465.8 GiB
Sector size (logical): 512 bytes
Disk identifier (GUID): 306AFDDD-FE4D-4DAD-8F2A-C955BCBDD664
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 976773101 sectors (465.8 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
[blank]

Command (? for help): o

Partition GUID code: 48465300-0000-11AA-AA11-00306543ECAC (Apple HFS/HFS+)
Partition unique GUID: 047050C3-8055-4BE9-8D2C-8D9960335A55
First sector: 2048 (at 1024.0 KiB)
Last sector: 976773134 (at 465.8 GiB)
Partition size: 976771087 sectors (465.8 GiB)
Attribute flags: 0000000000000000
Partition name: 'Apple HFS/HFS+'

Command (? for help): v

No problems found. 2014 free sectors (1007.0 KiB) available in 1
segments, the largest of which is 2014 (1007.0 KiB) in size.

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): y

OK; writing new GUID partition table (GPT) to /dev/disk2.
Warning: Devices opened with shared lock will not have their
partition table automatically reloaded!
Unable to open device '/dev/disk2' for writing! Errno is 2! Aborting write!


What should I do?  I'm completely ignorant and have no idea whether the drive is salvageable or if I should put in the trash and move on.  Any help would be much appreciated!
Before you toss the disk I suggest you connect it to you Mac and try running Disk Utility app. It's usually located in the Application/Utilities folder. Start this app and see if your disk shows up, Disk Utility has an option to erase the disk. You can erase the disk and then create a partition formatted to whatever format you want. After that, I'd run First Aid on the disk to see if there are any problems. Disk Utility will fix most problems it encounters. Then disk should be ready to use on your mac.