rgma62 wrote:
I formatted it for Mac (APFS) and then set up Time Machine to back up. It failed repeatedly.
How did it fail? What are the exact error messages? Screenshot is best.
Please post your 'instructions for using the command line to write zeroes to the beginning of the drive to destroy the existing partition table.'
Before this, if the drive was designated as a TM backup drive, then go into the TM app and tell it to forget/stop using the drive as TM to see if you can erase it normally using Disk Utility using the link provided by @PRP_53 (read the instructions so you are erasing the whole physical drive and not just a volume):
Erase and reformat a storage device in Disk Utility on Mac - Apple Support
To use the command line to destroy the partition table on the drive, you will first need the device identifier for the physical drive. It is best to disconnect all other external drives (or anything that appears like a drive with a device identifier) so that you don't accidentally destroy data on the wrong device since there are no safety nets when using the command line. The device identifier may change every time a device is reconnected or the system is rebooted so it is important to get the current device identifier for the physical drive you want to erase right before using the command line. In the picture of Disk Utility provided by @PRP_53, you can see the physical drive "WD Elements 10B8 Media...." has a device identifier of "disk4".
Here are the commands needed to unmount all volumes on the specified device. In my commands you need to replace "diskX" with the correct device identifier (using the example already mentioned you would replace "diskX" with "disk4".
diskutil unmountDisk diskX
sudo dd if=/dev/zero of=/dev/diskX bs=100m count=10
The second command is the dangerous one if you provide the wrong device identifier for "diskX" as it will destroy the data on that device. It will prompt you for your admin password. Nothing will appear on the screen as you type the password, so press the "Return" key to submit the password.
If there are no errors, then use Disk Utility to erase the physical drive using the instructions in the linked Apple article.