linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Forcing a more random uuid (random seed bug)
@ 2005-02-08 14:05 linux
  2005-02-22 23:58 ` H. Peter Anvin
  0 siblings, 1 reply; 4+ messages in thread
From: linux @ 2005-02-08 14:05 UTC (permalink / raw)
  To: linux-raid, niccolo

+        if ((my_fd = open("/dev/random", O_RDONLY)) != -1) {

Please use /dev/urandom for such applications.  /dev/random is the
highest-quality generator, but will block if entropy isn't available.
/dev/urandom provides the best available, immediately, which is what
this application wants.

Also, this will only produce 2^32 possible UUIDs, since that's the
size of the seed.  Meaning that after you've generated 2^16 of them,
the chances are excellent that they're not UU any more.

You might just want to get all 128 (minus epsilon) bits from /dev/urandom
directly.

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Forcing a more random uuid
@ 2005-02-01 17:47 Niccolo Rigacci
  2005-02-02 13:33 ` Forcing a more random uuid (random seed bug) Niccolo Rigacci
  0 siblings, 1 reply; 4+ messages in thread
From: Niccolo Rigacci @ 2005-02-01 17:47 UTC (permalink / raw)
  To: linux-raid

My previous post was answered very quickly and with an optimal solution, 
but unfortunately I have a new question...

I'm writing a script to clone a disk with several md devices.

The raid1 volumes are created on the blank disk within a very quick loop, I 
think this is the reason why I get /dev/md5, /dev/md6, /dev/md7 
and /dev/md8 all with the same UUID!

Is there a way to force a more random UUID, or do I have to provide an 
--uid option on the command line?

-- 
Niccolo Rigacci
http://www.texnet.it/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-02-22 23:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-08 14:05 Forcing a more random uuid (random seed bug) linux
2005-02-22 23:58 ` H. Peter Anvin
  -- strict thread matches above, loose matches on Subject: below --
2005-02-01 17:47 Forcing a more random uuid Niccolo Rigacci
2005-02-02 13:33 ` Forcing a more random uuid (random seed bug) Niccolo Rigacci
2005-02-22 23:55   ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).