Erasing all data on failing hard drive, KDE

How do set up a hard-drive to do low-level format? Erase(zeros) or randomize all data on the whole hard drive. It will attempt to overwrite even bad sectors or else skip them. I usually use the dvd ‘gparted’. I’m somewhat familiar with Yast-Partition Editor.

What is the best method? GUI or Command Line.

Application from yast?

Assume, a new hard drive formatted with ‘opensuse leap 15’ running. The old hard drive connected to an extra port on the motherboard.

Thanks.

On Thu 01 Nov 2018 01:06:03 AM CDT, lord valarian wrote:

How do set up a hard-drive to do low-level format? Erase(zeros) or
randomize all data on the whole hard drive. It will attempt to overwrite
even bad sectors or else skip them. I usually use the dvd ‘gparted’. I’m
somewhat familiar with Yast-Partition Editor.

What is the best method? GUI or Command Line.

Application from yast?

Assume, a new hard drive formatted with ‘opensuse leap 15’ running. The
old hard drive connected to an extra port on the motherboard.

Thanks.

Hi
A failing hard drive… I give to my son to dismantle for the
magnets, then safety glasses and a hammer, or his BB gun :wink:

Would look at the HDD manufacturers website, normally they have tools
and/or bootable iso images.

Could use dd and /dev/zero from the command line until it finishes…


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
SLES 15 | GNOME Shell 3.26.2 | 4.12.14-25.22-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

In some HDDs the disks are glass and easily shatter. Older ones are metal and with a vice anh hammer…

Partitions tools do, as an extension to the real partitioning, often also the creation of file systems. This file system creation (writing superblock and inodes, etc) is from the Microsoft PC heritage often called “formatting”.

Formatting, the writing of tracks, blocks and alternative tracks for those on bad sports, is from the Microsoft PC heritage often called “low level formatting”.

IMHO the confusion comes from the fact that on floppy disks both formatting and file system creation was done in one action.

Thus to the OP: when you want to (lowlevel) format your disk, neither gparted, nor YaST > Partitioner, not even fdisk/gdisk will help you. Nor will dd.

As suggested above, the manufacturer may have something, but as suggested also, destroying the hardware (for security/privacy) and acquiring a new one might be the best.

When you only want to destroy the data on the used tracks, then

man shred

but read the text for the caveats.

See: Securely wipe disk - ArchWiki

I thought about the “hard” way. I would to donate it somewhere, But, it maybe too far gone for even that.

Using fdisk -l, find out which drive you want to wipe. I shall assume that you want to wipe /dev/sda

Now, run



  dd if=/dev/zero of=/dev/sda

dd if=/dev/urandom of=/dev/sda


That will wipe the hard drive.

#1: zero out all sectors on the hard drive overwriting partitions as well and mbr?
#2: random data

Right?


dd of=/dev/zero if=/dev/sda2 bs=1024

I’m pretty sure dd does the trick.

Code:
dd if=/dev/zero of=/dev/sdX
Where sdX is sd[a-z].

Alternatively you could scramble the hard drive and then format it to zero.

Code:
dd if=/dev/random of=/dev/sdX

How would we know what these commands result in with your specific hard drive?

The problem is more complex than I thought. Magnetic drives vs flash drives. I’ll need to start two separate topics.

Thanks for the help. End topic.

This is why I use an encrypted LVM. If nobody else knows the encryption key, the disk is already as good as erased.

I’ve read on an another forum about the seagate tools and the western digital tools for securely erasing a hard drive.

Thanks to all for the help.

In spite of those manufacturer tools, the ONLY safe way is one of:

  • Hammer and chisel
  • Large buldozer and granite boulder
  • Toss into an active volcano
  • Let a 3-yr-old play with it for a few minutes.

Hi
A drill works good too… :wink:

Best recommendation I found for it is…

A SLEDGE HAMMER

Can’t go wrong with it. :slight_smile:

Mind your fingers!

SMART should give you a approximate idea of how much longer the drive will last. I use GSmartControl as a front end for SMART tools.