Wednesday, February 18, 2009

a Thousand Monkeys (Virtual Servers)

So I spent a few days pondering the issue with /dev/random under linux not being able to generate enough data to fill my hard disk in a timely fashion, to backtrack, I want to prepare a new encrypted volume, a small 100GB disk. 

As many people know, before you depend on your crypted disks, you need to fill the disk with very high quality random data, true, crypt strength data to be exact.

By my calculations on a average linux server you only get about 3 to 4 bytes per second out of /dev/random which computes to 1 Year and 1 Month to fill a 100gb disk with high quality random data. I am in more of a hurry than that.

Mac OS X Leopard seems to generate almost 10MB per second but its entropy is questionable so that is also not a option. 

I then theorized that if I spawned many virtual hosts, and ran netcat off /dev/random to a listening netcat on one of my real servers, that I could mass cat all the dev random pipes together onto the disk. 

Unfortunately, as expected,  it seems that /dev/random on virtual machines is pretty quiet since the machine acoustics are, well artificial in nature so there is no CPU fan noise or keyboard and mouse data to gather from. 

The shell script I wrote to spawn a large number of virtual hosts could come in useful though.

Here is the script.






No comments:

Post a Comment