public inbox for linux-newbie@vger.kernel.org
 help / color / mirror / Atom feed
From: Simon Valiquette <v.simon@ieee.org>
To: linux-newbie@vger.kernel.org
Subject: Re: Create files with specific sizes?
Date: Tue, 14 Dec 2004 13:54:56 -0500	[thread overview]
Message-ID: <41BF3700.9040909@ieee.org> (raw)
In-Reply-To: <cpmcg0$3e1$1@sea.gmane.org>

SVisor a écrit :
>> 
>> dd if=/dev/zero of=file1 bs=1k count=1024
> 
> I wanted a file of garbage, not zeroes.
> So I tried: dd if=/dev/random of=file bs=1k count=1024
> 

   If you don't need encryption-level random numbers (just noise) you 
can use urandom.  It will also be much faster because it will continue 
to send data even when his entropy pool will be exhausted.

dd if=/dev/urandom of=file bs=1k count=1024

> But to my suprise I got only a ~4k file. I know that dev/random may run 
> out of values. But should dd not wait until there are enought of data?

   That's exactly what it is supposed to do.  Perhaps you tought 
/dev/random could generate random numbers much faster.  So when it's 
entropy pool was exhausted after 4KB, you tought it stopped working.

   By default, there is only a reserve of 4k of entropy in /dev/random. 
  Once exhausted, the others bits are *much* slower to get.  I mean, in 
the order of 1,000,000 times slower than urandom unless you have a 
special device to generate random numbers in hardware.

   You can see how much unused entropy you have with that:

cat /proc/sys/kernel/random/entropy_avail


Simon Valiquette
http://gulus.USherbrooke.ca
http://www.gulus.org

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

  reply	other threads:[~2004-12-14 18:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-14  8:52 Create files with specific sizes? Khan
2004-12-14  9:12 ` qwms-avib
2004-12-14  9:24   ` Khan
2004-12-14  9:41   ` SVisor
2004-12-14 18:54     ` Simon Valiquette [this message]
2004-12-16  9:47       ` SVisor
2004-12-17 21:15         ` Simon Valiquette
2004-12-18 11:05           ` SVisor
2004-12-14 19:20     ` qwms-avib
2004-12-16  1:14 ` Eric Bambach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41BF3700.9040909@ieee.org \
    --to=v.simon@ieee.org \
    --cc=linux-newbie@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox