Overwriting with random data (was: Re: /dev/tcp)

Nuno Silva <[email protected]>
Newsgroups comp.os.linux.misc
Organization A noiseless patient Spider
Message-ID <[email protected]>
On 2026-08-24, Carlos E.R. wrote:

> On 2026-08-24 00:28, vallor wrote:
>> At Sun, 23 Aug 2026 13:50:30 +0200, "Carlos E.R." <[email protected]> wrote:
>
[snipping a lot to keep this shorter, apologies if I ended up snipping
too much]
>
>>> I wrote a program that writes bytes on big partitions.
>>>
>>>
>>> excerpted:
>>>
>>> const
>>>        sourcefilename = './BigRandom';
>>>        rawdest: string = '';     // example: '/dev/sda11'
>>>
>>>        shuflecount = 1024;
>>>        arraysize = 1023;
>>>        ChunkSz=1048576;
>>> type
>>>        tCacho= array [1..ChunkSz] of byte;
>>>
>>> var
>>>      Fin, Fout: file of tCacho;
>>>      gotresult: Word;
>>>
>>>      BigData : array [1..shuflecount] of tCacho;
>>>      OutputIndex : Int64;	// counts MiB written.
>>>
>>>
>>> begin
>>>
>>> // writes one MiB
>>>         {$I-}write(Fout,BigData[RandomIndex]);{$I+}
>>>         gotresult:= ioresult;
>>>
>>>
>>>
>>> The purpose of the program is to fast fill a partition or disk with
>>> nearly true random data. It is as fast as dd could be.
>>
>> SHRED(1)                 User Commands                 SHRED(1)
>>
>> NAME
>>         shred  -  overwrite  a  file  to  hide its contents, and
>>         optionally delete it
>>
>> SYNOPSIS
>>         shred [OPTION]... FILE...
>>
>> DESCRIPTION
>>         Overwrite the specified FILE(s) repeatedly, in order  to
>>         make  it harder for even very expensive hardware probing
>>         to recover the data.
>
> Not the same thing.

IIRC shred can do the same, and on block devices too, what's the
difference here? block sizes?

-- 
Nuno Silva
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.