this post was submitted on 01 Jul 2023
8 points (100.0% liked)

Linux

48375 readers
1553 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

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.

top 6 comments
sorted by: hot top controversial new old
[–] wildbus8979 2 points 1 year ago

Are all my drives bad?

It seems more likely that your usb adapter is at fault here ...

[–] Dr_Willis 2 points 1 year ago (2 children)

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 1 points 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.

[–] [email protected] 1 points 1 year ago

I don't expect I am the target of a nation-state or large corporation.

[–] [email protected] 1 points 1 year ago* (last edited 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.

[–] [email protected] 1 points 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.