18

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?

Mateo
  • 8,104
  • 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. – Oli Mar 29 '13 at 14:06
  • @Oli: Good point about the cache - would it be possible to tell the OS "on boot, I want to cache this whole volume"? – Piskvor left the building Mar 29 '13 at 14:19
  • @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... – Milos Radojevic Mar 29 '13 at 14:44
  • @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? – Piskvor left the building Mar 29 '13 at 15:40
  • @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. – Milos Radojevic Mar 29 '13 at 16:21
  • 2
    This is a FAQ and has been asked her several times.

    See this forums post - http://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.

    – Panther Mar 29 '13 at 16:52
  • @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. – Piskvor left the building Apr 03 '13 at 12:27

2 Answers2

6

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+.

3

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.

volodja
  • 46
  • 2