0

When used, with -n0 (that is without the three initial random passes of the default option) the shred command is usually fast at zeroing hard drives:

shred -n0 -z -v -f /dev/sdb

However, I observed that with some models, the shred command is extremely slow at zeroing.

Example (enterprise grade) model: ST31000340NS (Seagate Barracuda ES.2, 1TB 7.2krpm, 32MB cache, SATA II).

Erase commands and observed speeds for the ST31000340NS hard drive:

dd if=/dev/zero of=/dev/sdb status=progress ~ 18-25 MB/s

ddrescue -n -r0 -v -f /dev/zero /dev/sdb ~ 38 MB/s

shred -n0 -z -v -f /dev/sdb ~ 9 MB/s (~35 MB every 4 seconds)

We see that shred, although performing unique pass of zeros is here more than 4x slower than ddrescue. Also, for this case, dd is surprisingly twice slower than ddrescue.

How to explain such differences in speed?

5
  • 1
    For the past ~20 years cat /dev/zero > /dev/disk has been enough and sufficient for HDDs to ensure 100% data erasure. For SSD blkdiscard works as well only it's near instant. Commented Feb 17, 2023 at 17:12
  • back.nber.org/sys-admin/overwritten-data-guttman.html just to explain why shred's now advanced methods simply add no relevant security. At least you're not doing it on a file layer :) Commented Feb 18, 2023 at 8:11
  • @Artem: Thank you for the suggestions.
    – OuzoPower
    Commented Feb 21, 2023 at 14:44
  • @Marcus: I'm just applying shred to blank hard drives (at disk layer, not file one), so that old data do not mix with new ones in case a later data recovery would be performed by myself. Very advanced techniques like electronic microscopy to find which bits were 0 and which ones were 1 are not withing the reach of everyone. There are many different ways of erasing hard drives, more or less secure, including physical destruction. The appropriate method depends on the level of security one wants to achieve.
    – OuzoPower
    Commented Feb 21, 2023 at 15:05
  • @OuzoPower anyways, for zeroing out a hard drive: as Artem says in the first command, simply splice /dev/zero into your block device :) Commented Feb 21, 2023 at 15:23

0

You must log in to answer this question.

Browse other questions tagged .