I have a stack of SATA hard drives that I need to erase.
I have a USB drive dock, a box that a drive can be set into that connects to my computer via USB-3.
I am using DD to write zeros to the raw device, in this case, /dev/sdf.
No matter the actual size of the drive dd stops at about 3 to 7 gb. These are 300 gb to 3 TB drives.
I am not mounting the drives, but I do ensure they are visible to the system with lsblk. To change drives I turn off the dock. The drive then disappears from lsblk. When I insert a different drive and turn the dock back on again /dev/sdf re-appears.
Are all my drives bad? If they are I will need to have them “professionally” destroyed at about $25 a drive.
I prefer
shred
for erasing magnetic drives.dd
can work too, but its options are arcane enough that it’s easy to make mistakes that lead to weird behavior.If that doesn’t fix the unexpected size problem, I would suspect the USB bridge in your dock. Those things are notoriously buggy.
Connecting directly with SATA is a more reliable approach. It also lets you use
hdparm
to tell the drive to run a secure erase cycle on itself.Can you run dd with the “status=progress” option set to see what’s going on when it stalls? Also, how long until it stalls? In my experience, dd takes a really long time to write over an entire drive of that size, so you may just need to wait it out (could take a couple of days). You can also try increasing the block size (e.g., “bs=8m” or “bs=8M”, with the case of the “m” depending on your OS) and see if that helps to speed things along. Typically, the default dd block size (512 bytes) is pretty slow.
Note: I’m far from an expert but I have been using dd for similar applications as you for a few years. Hopefully something above can be of some help.
add with status=progress would be a good idea lace to start as the other commenter mentioned. Htop has a configuration in settings that will allow you to see disk writes as well.
There are also other options such as shred you can use.
Could be a bad dock or usb controller, try a different one. Otherwise just snap the sata connector off, and most people will not bother to get anything off.