Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A while back I installed (a permanent installation, not a Live USB) Ubuntu on my USB thumb drive. Unfortunately, the transfer rates are too slow for a smooth and responsive experience, so I'd like to load more of the OS into RAM when it boots up, kind of like a Live USB.

The problem is that while a typical Live USB created from the standard desktop .iso will probably fit in 2 GB of RAM when the OS (/casper/filesystem.squashfs?) is fully uncompressed and loaded, my installation is nearly 5 GB in size, and my computer only has 2GB of RAM. However, much of the installation consists of texlive packages and other files which I definitely use, but use rarely. In reality, the commonly used apps and files are so little that their total size could probably fit in RAM easily.

Is it possible to modify my already existing (permanent) Ubuntu installation on a USB thumb drive such that I can specify which folders should load to RAM (and which ones can be excluded), as I don't believe I can fit the whole OS into 2GB of RAM. I mainly want my browser, shell, and common shell commands to be fast. /home is not very important when it comes to performance.

I've partitioned the USB drive as follows, if it helps:

  • boot (/boot)
  • root (/)
  • home partition (/home)
  • swap

Also, I've taken a look at a Boot to RAM page on the Ubuntu website, but the focus there seems to be for customizing a LiveCD image.

share|improve this question
Link to Puppy Precise ISO download Try out Puppy Precise it does all you want and MUCH more. It is based on Ubuntu. – user164397 Jun 4 '13 at 15:56
up vote 3 down vote accepted

Check out these instructions. To summarize:

  1. align the partitions with the SD card erase block size (so the filesystems are aligned when created).
  2. Move directories like /tmp and /var/log to RAM by making fstab entries. Also turn off access time tracking for / with the noatime option in fstab.
  3. Link other directories like /var/cache/apt/archive and your browser cache to a place in /tmp.
  4. Make RAM home based users for quickest access -- you may not explicitly write much in your home directory, but the GUI and browser certainly do.
share|improve this answer

While not a direct solution to your question, it may still help: there are a number of linux distributions which run entirely from RAM.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.