[[ 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
    3
    ·
    edit-2
    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 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.

  • 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.

  • sin_free_for_00_days
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    I’d try to partition them in gparted. Write a couple different filesystems on them. If they are funky, just punch through them, as terribleplan said, with a hammer and screwdriver.

  • 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.

  • 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?

  • 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.

    • WasPentaliveOP
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      It completes normally but as though the drive is much smaller - it shows 3589 blocks in/out.

  • ianhclark510@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    idk man, if there’s sensitive data on those drives i’d always err on the side of caution, there are much cheaper ways of doing secure data deletion, you can dismantle a drive with a screwdriver, or core them with a drill (my old worksplace had a hydraulic press they ran batches of drives through)

    if you wanted something less intrusive there are bootable images like DBAN (Darik’s Boot and Nuke) that handle secure erasure pretty well, you can enforce multiple passes, and even connect multiple drives at once

    if the data isn’t that sensitive I always like trying to unpartition/repartion the drive, then see if you can use dd to fill the drive with zeros/random data

    • WasPentaliveOP
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      It’s not too sensitive, but since the drives were part of my dad’s estate I want to be sure. I would hate to have to turn these drives (esp the 1+ TB drives) into e-waste.

  • vividspecter@vlemmy.net
    link
    fedilink
    arrow-up
    1
    ·
    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.

    • WasPentaliveOP
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      Nothing shows up in dmesg -w after the drive is attached. When I power down the dock the drive is detached. It seems the drive is USB 4-1.

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

        I mean when the actual issue shows up, although there should be some messaging showing if you’re using uas or usb-storage instead. You can just blacklist the uas module as a test and see if the issue goes away, and then doing it more specifically so other drives can use it.

  • nzdjinn@lemmy.nz
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    That sounds fine, but what is the actually did command you are running? A simple dd if=/dev/zero of=/dev/sdf bs=1m should be all you need. If you are using dd, run iotop or something similar in the background to see if there’s any writing actually happen.

    When you say dd “stops” does it just quit? If so it might be the dock briefly disconnecting, you should be able to see this happen by watching dmesg with dmesg -w as you are running your dd command.

  • CrescentMadeJr@beehaw.org
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    Try mounting them. What is the dd command you’re using?

    Now, depending on your threat model maybe a drill and a sledgehammer will be enough. If your threat model is rather high and it is really sensitive data, I would still professionally destroy them even after writing zeros.

      • CrescentMadeJr@beehaw.org
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        Yeah. That should do it. There is also a shred tool you could try.

        sudo shred -vfz /dev/sdf

        You can also write a zero file to see if the drive is useable. That won’t erase what’s on it, but it will write all free space. If you mount the drive and delete everything on it, a zero file will in theory write zeros to the whole drive.

        mount /dev/sdf /media dd if=/dev/zero of=/media/zerofile.tmp

        I have a similar threat model. If the disks are indeed bad then a nice sledge and a trip to an e-cycle location should do it.

    • WasPentaliveOP
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      1 year ago

      I am a private person without any state or corporate secrets in hand. I do not do online banking.

      My threat model I believe is limited to random drive-by actors.

      I was hoping to be able to provide these drives to others to use, the screwdriver and hammer will render them into E-waste. But on that issue, once the platter assembly is disassembled and the platers are separated and mixed up the data on them is probably not recoverable? With the given that each drive has multiple platters.

      • zkikiz@lemmy.ml
        link
        fedilink
        arrow-up
        0
        ·
        1 year ago

        A few gigs of zeroes will prevent random drive-bys. At that point the partition and filesystem table of at least the first partition is overwritten and you “can” recover files off it but you’ll be missing filenames and at least half the files will be corrupt due to fragmentation losing track of which files are where.

        I agree with Ono that shred is a good tool for this. If you don’t want to use that, try increasing the block size to at least 1M if not 16M to reduce the overhead.

  • 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.

  • cmnybo@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Are you getting any errors in your system log?

    The first thing I would suspect is the USB dock. Do you have a computer with a spare SATA port or an eSATA dock that you could try erasing a drive in?

    • WasPentaliveOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      dmsg reports attaching the drive, but nothing after that with a dd attempt and with a secure erase attempt. ioctl on non-enhanced secure erase too.