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

This question is in continuation to this question. I download a lot of small files (a few MBs) which I delete after being done with them. So can I make it that all changes to be saved to my filesystem be made in the RAM if it's under certain size? For example, if I set the limit to 128 MB, all files under that size will be saved to the RAM, and only saved to the HDD before shutdown.

share|improve this question
If those small files are thrown away after use, you can use a ramdisk as well. For example, my /tmp is mounted tmpfs (which resides in the RAM). If I need to peek into the source of a package, I apt-get source it in /tmp. When done, I remove it if I think about it. – Lekensteyn Sep 12 '11 at 14:22
My understanding is that tmpfs uses swap for storage, while ramfs uses RAM - see – Sergey Sep 12 '11 at 21:04

Firstly, the dangers of writing to an SSD drive may be greatly exaggerated - unless you're planning to prolong its life beyond year 2100 :)

Secondly, keeping the data in RAM and then writing it to the disk later in one go is basically what Linux filesystem does anyway - though the emphasis is on preserving the data, not minimizing the number of writes.

Thirdly, you can create a ramdisk and save your temporary data there. Then I imagine you could have some script which rsync's the contents of the ramdrive with a folder on the disk. Then you can either invoke it manually (Big Save Button on your desktop) or add it to shutdown scripts. The whole thing would be pretty unreliable though.

I mean - moving swap and logs off an SSD is one thing, but, say, not saving a document I'm working on to minimize the number of writes may be a bit extreme :)

share|improve this answer
It's a 16 GB USB, even if exaggerated, at the rate I download and delete data, I'd say it'd hardly live two years. – Oxwivi Sep 13 '11 at 8:49

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.