BootToRAM

Differences between revisions 3 and 4
Revision 3 as of 2007-05-04 16:44:22
Size: 2584
Editor: STRATTON-THREE-THIRTY
Comment:
Revision 4 as of 2007-05-04 16:46:31
Size: 2751
Editor: STRATTON-THREE-THIRTY
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
||<tablestyle="float:right; font-size: 0.9em; width:40%; background:#F1F1ED; margin: 0 0 1em 1em;" style="padding:0.5em;">'''Contents'''[[BR]][[TableOfContents]]||

Booting Ubuntu To RAM

Preface

This article aims to document the process of creating a customized Ubuntu that loads an image from the hard disk to RAM, then boots an entire Ubuntu session out of RAM. It is intended for intermediate to advanced Ubuntu users who are familiar with the shell, and may have limited experience customizing the livecd (LiveCDCustomization) and shell scripting. We will customize a LiveCD and copy it to the hard drive, and make a few modifications to bootup scripts so that it copies to RAM via our good friend tmpfs.

Use Cases

There are many cases where one would like to boot Ubuntu to RAM:

  • Performance: The desktop performance is dramatically improved. A 400MB squashed filesystem in RAM, that holds 1200MB of data, is read back on a 1.6GHz Core Duo in about 3 seconds, including decompression time.
  • Power, Noise, Durability: Although modern hard disks don't use much power compared to other system components, this may still be important for some. In laptops, hard disks are often the noisiest components, so this setup can reduce system noise. With the hard disk spun down, a laptop can potentially withstand greater shocks without damage.
  • Abrupt poweroff: Since the hard disk is only momentarily used in read-only mode during boot, then never touched again, there are few or no negative consequences of an abrupt poweroff. If a system is used where power is inconsistent, or the system is regularly used in a context where fast shutoffs are required, this is very handy.

Requirements

The most obvious increased requirement is RAM. For best performance, I recommend having 256MB RAM + enough RAM to hold a customized image. Stripping Openoffice and some fonts and documentation from a stock Ubuntu LiveCD results in a 400MB compressed image, which fits in RAM comfortably on a system with 1GB RAM.

Tmpfs can fall back on swap (Ubuntu LiveCD scripts will mount any swap it finds), which is excellent for a bit of overflow, but if you regularly need to fall back on swap, performance will naturally suffer.

I have not investigated CPU requirements, but squashfs is compressed and decompressing takes some CPU power, so this is probably not a great idea on systems older than the Pentium III era.

As far as setting this system up, the requirements would be:

  1. Having a Feisty LiveCD ISO or CD handy.
  2. About 2-4GB of free space
  3. A combined 1GB or so of RAM and swap available.

The Process

Unpack LiveCD

First, we need to unpack the LiveCD for customization.

BootToRAM (last edited 2011-07-18 07:35:36 by 96)