[[ solved ]]

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.

Next Update –

I started with a USB to SATA adapter that looked like a small box with a SATA connector on one edge and a USB cable coming out of one side, it had a power supply that connected to the small box - everything out in the open.

Then I went to a drive toaster - a dock where you slot the drive into a hole in the top of the dock, again powered and USB-3 (blue connector)

As of this update I have opened my USB-3 external drive and removed it’s native drive and put in one of the 1TB drives I wish to erase. I also switched to my production laptop. Now I have issued a dd command and it has written so far 28GB from /dev/urandom.

I think this will finally work. - I am marking this solved.

  • ono@lemmy.ca
    link
    fedilink
    arrow-up
    6
    ·
    1 year ago

    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 to the computer 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.

  • dragonfly4933@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    4
    ·
    1 year ago

    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.

  • socphoenix@midwest.social
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    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.

  • Dr_Willis@sh.itjust.works
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    using dd to zero a drive - is not a secure way to delete the data. It could potentially be recovered.

    You mount filesystems, but you are accessing the device directly, so you are not using the filesystem, so no need to mount.

    As the other comment mentions, it sounds like a controler issue. monitor the output of sudo dmesg -w as you are doing the work on them.

    need to have them “professionally” destroyed at about $25 a drive.

    A Hammer is about $5 and will destroy them. :)

    • dack@sh.itjust.works
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      For the vast majority of people, writing zeroes to the disk is good enough. Even nation states and other advanced attackers would need a good amount of luck to get anything useful off a single pass zeroed HDD.

      If you really need more than that, then there are various standards and recommendations for multiple passes of random/zeros/ones. Or just go the destructive route.

      Of course SSDs are a totally different scenario. Writing zeroes is not sufficient or recommended for those. Generally, the secure erase command is the best way. However, this requires trusting that the firmware does that properly. If you don’t trust the firmware, destructive is the only option.

  • vividspecter@vlemmy.net
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    Sometimes this is due to buggy UAS support. Look into blocking it globally or for your specific dock but check your logs first ideally.

  • toikpi@feddit.uk
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    I would suspect the cabling and/or the dock before all your drives.

    Writing zeros to hard disk does not securely delete the contents. https://en.wikipedia.org/wiki/Gutmann_method

    A further problem with writing zeros to the contents to /dev/sdf/ is that contents of any relocated sectors will not be over-written. It might be possible to recover data from those bad sectors.

    If you can get the dock working, look at using hpparm to do SATA secure delete? It has flags to support this. https://www.putorius.net/securely-erase-a-sata-hard-drive-hdparm-linux.html You could then use hpparm to set an unique, LONG, random password on each drive.

  • robotrono@lemmy.sdf.org
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    Are you using /dev/zero as the input for dd, such as dd if=/dev/zero of=/dev/<HD to erase>? This is how I used to do this but I’ve recently switched to using the little tool ‘nwipe’ which allows to wipe multiple drives in parallel and show proper progress.

  • dchen4@aussie.zone
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    Maybe there weren’t enough power going to the drives, is it a powered dock? Otherwise if you don’t need the drives anymore the good’ol hammer always works.

  • toastio@midwest.social
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    1 year ago

    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.

  • terribleplan@lemmy.nrd.li
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    I mean, screwdriver to open and hammer for the platters works a charm, and is at least as secure as one pass of 0’s. Plus you can pull the magnets for whatever fun uses you can find later.

    edit: Honestly even opening them and letting dust and other stuff in the air get on the platters pretty much destroys them… there’s a reason they are hermetically sealed.

  • qjkxbmwvz@lemmy.sdf.org
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    By stops, you mean dd exits or hangs? Does dd throw an error/nonzero exit code? Anything in dmesg?

    There’s no automatic mounting going on in the background, right?

  • cstine@lemmy.uncomfortable.business
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    It seems unlikely EVERY drive is bad in the exact same way. My money is on either the adapter having an issue (check dmesg for any usb errors?) or your USB port being marginal on providing enough power to run it, if it’s a bus-powered adapter.

    Those really suck for mechanical drives and I’ve NEVER had good luck if that’s the case.