Difference between revisions of "Frandom"

From ArchWiki
Jump to: navigation, search
(added another (more thorough) example and changed formatting for examples)
m (i18n. filename templates. format headings correctly. remove <pre> tags)
Line 1: Line 1:
 
[[Category: File systems (English)]]
 
[[Category: File systems (English)]]
= Summary =
+
{{i18n|Frandom}}
'''frandom''' is a fast alternative to /dev/urandom. It can be used wherever fast random number generation is required, eg for randomising large hard drives prior to [[System_Encryption_with_LUKS_for_dm-crypt|encryption]].
+
 
 +
'''frandom''' is a fast alternative to {{Filename|/dev/urandom}}. It can be used wherever fast random number generation is required, eg for randomising large hard drives prior to [[System_Encryption_with_LUKS_for_dm-crypt|encryption]].
  
 
From the [http://billauer.co.il/frandom.html frandom page]:
 
From the [http://billauer.co.il/frandom.html frandom page]:
"The frandom suite comes as a Linux kernel module for several kernels, or a kernel patch for 2.4.22. It implements a random number generator, which is 10-50 times faster than what you get from Linux' built-in /dev/urandom."
+
"The frandom suite comes as a Linux kernel module for several kernels, or a kernel patch for 2.4.22. It implements a random number generator, which is 10-50 times faster than what you get from Linux' built-in {{Filename|/dev/urandom}}."
  
 
Does frandom generate good random numbers? Refer to the frandom page for this and other technical info.
 
Does frandom generate good random numbers? Refer to the frandom page for this and other technical info.
  
= Installation =
+
== Installation ==
 
Frandom is available as a package from the [http://aur.archlinux.org/packages.php?ID=9869 AUR].
 
Frandom is available as a package from the [http://aur.archlinux.org/packages.php?ID=9869 AUR].
  
Once the daemon has been started, it is available from /dev/frandom. It is run in the normal way:
+
Once the daemon has been started, it is available from {{Filename||/dev/frandom}}. It is run in the normal way:
 
  # /etc/rc.d/frandom {start|stop|restart}
 
  # /etc/rc.d/frandom {start|stop|restart}
  
Or if you prefer, it can be started at boot by adding it /etc/rc.conf:
+
Or if you prefer, it can be started at boot by adding it {{Filename|/etc/rc.conf}}:
 
  DAEMONS=(... frandom ...)
 
  DAEMONS=(... frandom ...)
  
= Wiping a drive/partition =
+
== Wiping a drive/partition ==
 
Use the following dd command. This will wipe all the data on the specified device, take care!
 
Use the following dd command. This will wipe all the data on the specified device, take care!
  
 
  # dd if=/dev/frandom of=/dev/sdx1
 
  # dd if=/dev/frandom of=/dev/sdx1
  
= Example =
+
== Example ==
 
1) On a 1.73 GHZ Thinkpad T43 with 2 GB ram:
 
1) On a 1.73 GHZ Thinkpad T43 with 2 GB ram:
<pre>
+
# time dd if=/dev/frandom of=/dev/sdb2
# time dd if=/dev/frandom of=/dev/sdb2
+
  dd: writing to `/dev/sdb2': No space left on device
dd: writing to `/dev/sdb2': No space left on device
+
  587384596+0 records in
587384596+0 records in
+
  587384595+0 records out
587384595+0 records out
+
  300740912640 bytes (301 GB) copied, 12844.6 s, 23.4 MB/s
300740912640 bytes (301 GB) copied, 12844.6 s, 23.4 MB/s
+
  real    214m4.620s
real    214m4.620s
+
  user    3m34.693s
user    3m34.693s
+
  sys    77m28.660s
sys    77m28.660s
+
</pre>
+
 
Summary: 300 GB in approx 3.5 hours
 
Summary: 300 GB in approx 3.5 hours
  
  
 
2) On a 2.4 GHZ (T8300 Core 2 Duo) Thinkpad T61 with 2 GB ram:
 
2) On a 2.4 GHZ (T8300 Core 2 Duo) Thinkpad T61 with 2 GB ram:
<pre>
+
# dd if=/dev/frandom of=/dev/sdb bs=1M
# dd if=/dev/frandom of=/dev/sdb bs=1M
+
  dd: writing `/dev/sdb': No space left on device
dd: writing `/dev/sdb': No space left on device
+
  476941+0 records in
476941+0 records in
+
  476940+0 records out
476940+0 records out
+
  500107862016 bytes (500 GB) copied, 5954.52 s, 84.0 MB/s
500107862016 bytes (500 GB) copied, 5954.52 s, 84.0 MB/s
+
</pre>
+
 
Summary: 500 GB in approx 1.65 hours
 
Summary: 500 GB in approx 1.65 hours
  
  
 
3) On a 2.8 GHz (Athlon2 X4) with 4 GB ram:
 
3) On a 2.8 GHz (Athlon2 X4) with 4 GB ram:
<pre>
+
# dd if=/dev/frandom of=/dev/sdc3 bs=1M seek=100KB
# dd if=/dev/frandom of=/dev/sdc3 bs=1M seek=100KB
+
  dd: writing `/dev/sdc3': No space left on device
dd: writing `/dev/sdc3': No space left on device
+
  1807429+0 records in
1807429+0 records in
+
  1807428+0 records out
1807428+0 records out
+
  1895225712640 bytes (1.9 TB) copied, 20300.3 s, 93.4 MB/s
1895225712640 bytes (1.9 TB) copied, 20300.3 s, 93.4 MB/s
+
</pre>
+
 
Summary: ~2TB in ~5.64 hours. However, on the same machine:
 
Summary: ~2TB in ~5.64 hours. However, on the same machine:
<pre>
+
# dd if=/dev/frandom of=/dev/null bs=1M count=1000
# dd if=/dev/frandom of=/dev/null bs=1M count=1000
+
  1000+0 records in
1000+0 records in
+
  1000+0 records out
1000+0 records out
+
  1048576000 bytes (1.0 GB) copied, 7.81581 s, 134 MB/s
1048576000 bytes (1.0 GB) copied, 7.81581 s, 134 MB/s
+
</pre>
+
 
versus
 
versus
<pre>
+
# dd if=/dev/urandom of=/dev/null bs=1M count=1000
dd if=/dev/urandom of=/dev/null bs=1M count=1000
+
  1000+0 records in
1000+0 records in
+
  1000+0 records out
1000+0 records out
+
  1048576000 bytes (1.0 GB) copied, 144.296 s, 7.3 MB/s
1048576000 bytes (1.0 GB) copied, 144.296 s, 7.3 MB/s
+
</pre>
+
 
This makes frandom 10-20 times faster on this machine, meaning it would take approx 50-120 hours (2-5 days!) to randomize 2TB using urandom.
 
This makes frandom 10-20 times faster on this machine, meaning it would take approx 50-120 hours (2-5 days!) to randomize 2TB using urandom.

Revision as of 19:47, 19 September 2011

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

frandom is a fast alternative to Template:Filename. It can be used wherever fast random number generation is required, eg for randomising large hard drives prior to encryption.

From the frandom page: "The frandom suite comes as a Linux kernel module for several kernels, or a kernel patch for 2.4.22. It implements a random number generator, which is 10-50 times faster than what you get from Linux' built-in Template:Filename."

Does frandom generate good random numbers? Refer to the frandom page for this and other technical info.

Installation

Frandom is available as a package from the AUR.

Once the daemon has been started, it is available from Template:Filename. It is run in the normal way:

# /etc/rc.d/frandom {start|stop|restart}

Or if you prefer, it can be started at boot by adding it Template:Filename:

DAEMONS=(... frandom ...)

Wiping a drive/partition

Use the following dd command. This will wipe all the data on the specified device, take care!

# dd if=/dev/frandom of=/dev/sdx1

Example

1) On a 1.73 GHZ Thinkpad T43 with 2 GB ram:

# time dd if=/dev/frandom of=/dev/sdb2
 dd: writing to `/dev/sdb2': No space left on device
 587384596+0 records in
 587384595+0 records out
 300740912640 bytes (301 GB) copied, 12844.6 s, 23.4 MB/s
 real    214m4.620s
 user    3m34.693s
 sys     77m28.660s

Summary: 300 GB in approx 3.5 hours


2) On a 2.4 GHZ (T8300 Core 2 Duo) Thinkpad T61 with 2 GB ram:

# dd if=/dev/frandom of=/dev/sdb bs=1M
  dd: writing `/dev/sdb': No space left on device
  476941+0 records in
  476940+0 records out
  500107862016 bytes (500 GB) copied, 5954.52 s, 84.0 MB/s

Summary: 500 GB in approx 1.65 hours


3) On a 2.8 GHz (Athlon2 X4) with 4 GB ram:

# dd if=/dev/frandom of=/dev/sdc3 bs=1M seek=100KB
  dd: writing `/dev/sdc3': No space left on device
  1807429+0 records in
  1807428+0 records out
  1895225712640 bytes (1.9 TB) copied, 20300.3 s, 93.4 MB/s

Summary: ~2TB in ~5.64 hours. However, on the same machine:

# dd if=/dev/frandom of=/dev/null bs=1M count=1000
  1000+0 records in
  1000+0 records out
  1048576000 bytes (1.0 GB) copied, 7.81581 s, 134 MB/s

versus

# dd if=/dev/urandom of=/dev/null bs=1M count=1000
  1000+0 records in
  1000+0 records out
  1048576000 bytes (1.0 GB) copied, 144.296 s, 7.3 MB/s

This makes frandom 10-20 times faster on this machine, meaning it would take approx 50-120 hours (2-5 days!) to randomize 2TB using urandom.