Customizing Ubuntu to run from RAM only, within GRUB options

8,060

Solution 1

rootramfs_0.2-1_all.deb

This package load root FS to RAM before startup system. For sync to HDD use rootramfs --sync sync_path [exclude_path1] [exclude_path2] ...

You can easy verify this package. Package contains scripts written in python, it fix initrd and cryptroot initramfs hooks.

Solution 2

At the risk of getting booted off for blasphemy...

Check out Puppy Linux. It works just like you are describing as it uses the unionfs filesystem or the newer aufs filesystem running entirely in memory. Though fully GUI, the O/S has been paired down to run in as little as 32MB (yes, MEGAbytes) of RAM or as much as you can give it. Anything over about 128MB will let it work entirely in RAM and thus be lightning fast.

Version 5.2.8 Lupu is compatible with Ubuntu 10.04 Lucid and Precise Puppy 5.4.3 is compatible with Ubuntu Precise Pangolin 12.04.1+.

Share:
8,060

Related videos on Youtube

Milos Radojevic
Author by

Milos Radojevic

Updated on September 18, 2022

Comments

  • Milos Radojevic
    Milos Radojevic over 1 year

    I'm interested in exactly this up, now let me explain what would like to do with this. I'm preparing to buy 32GB of RAM and already have Quad Core. My idea is to implement another option in GRUB that will do exactly this:

    1. On boot move whole / partition to ramfs, and boot ubuntu from there
    2. From time to time and also at shutdown signal, run rsync to "backup" data to HDD, of course in background.

    I already have SSD, and I think that rsync wouldn't take much to sync files. And also, loss of data is less important, except if it would be loss of more than 30 minutes active work, Because uptime of my computer is almost 99.99%, never turning off, so really don't think that this could get some bigger problem than forced power off from HDD.

    / filesystem is not much big, around 7GB.

    Now my question is: Would this idea be "cost effective", would rsync take much resources, and is somewhere already implemented some similar solution of this?

    • Oli
      Oli about 11 years
      This is a dream I chased for a few moments back when I first jumped to 24GB of RAM. Never got anywhere with it. On the plus side I do have 17GB in cache so it's doing quite a bit of this automatically. I'm completely certain that this is possible but there's a bit of plumbing to do to get things persisting properly.
    • Piskvor left the building
      Piskvor left the building about 11 years
      @Oli: Good point about the cache - would it be possible to tell the OS "on boot, I want to cache this whole volume"?
    • Milos Radojevic
      Milos Radojevic about 11 years
      @Piskvor, Why not? When I first started with Ubuntu (8), I thought that it is worst OS ever, but when I learned much about Linux, I can say that this OS can do almost anything, with a little hacking...
    • Piskvor left the building
      Piskvor left the building about 11 years
      @Milos Radojevic: Well, my FS cache gets largish - but it's empty at boot; I'd think that tweaking it to be more aggressive + preloading it with the whole FS on-boot might get you a result very much like having the whole thing actually mounted in RAM. Now...how to get the FS cache warmed up?
    • Milos Radojevic
      Milos Radojevic about 11 years
      @Piskvor Well my idea, not related to fscache, in details means that on boot run linux kernel from HDD, create clone of OS from HDD to RAM and chroot it. I think that is possible. But now tweaky... It needs to get data back to HDD... That could be problem. Maybe I'm wrong I don't know till I research and try it.
    • Panther
      Panther about 11 years
      This is a FAQ and has been asked her several times. See this forums post - ubuntuforums.org/showthread.php?t=1594694 The process is complex as you can imagine and IMO too long and somewhat repetitive to copy-paste here.
    • Piskvor left the building
      Piskvor left the building about 11 years
      @Milos Radojevic: Yeah, moving the data one way is relatively simple - after all, many of the LiveCDs/LiveUSBs run entirely from RAM. Syncing back...now that's the real issue.
  • Milos Radojevic
    Milos Radojevic over 10 years
    File doesn't exists at your link.
  • volodja
    volodja almost 7 years
    file exists in git repository, just visit github.com/vladimir555/rootramfs