0

I've been playing with Linux for a while, and I'm wondering if the following is possible:

1: in the boot startup script, run commands to make a ramdisk as in this other post: How do I make a RAM disk?

2: move all of the files in the / directory on a regular drive into said folder.

3: mount that directory as / and boot from it.

Because RAM is volatile, I could set up a rsync session that runs at startup and copies files to that original / directory every minute or so and before shutdown. The real question is if this would work. In my case, i have plenty of RAM overhead with 56Gb. The reason I want this is that my desktop is actually a discontinued HP dl580 G5 server, and has very slow drives. if it doesn't work, I have a way where I've been booting from a regular drive and installing / on a USB 3 SSD, but this isn't ideal.

Matanya
  • 372

2 Answers2

1

Basically, no. You can't install the system to RAM, because, as you noted, it is volatile. You could theoretically make a ramdisk large enough to hold all of /, but it is meant to be temporary, and you still have to store it on disk, and have it read from disk at boot. The initial ramdisk is meant to be small and temporary, to speed up the boot process.

Also, you'd run out of RAM very fast. I'm sure you have way more disk available than RAM in such a machine. The machine also either has SAS or SATA, so it should be pretty fast as far as general write accesses go.

dobey
  • 40,982
  • If that was the case, I would be fine, however, the speed of my raid controller has a maximum of 2gb/s throughput, and a PCI USB3 port to connect the SSD, but there are still lots of issues. I am using xfce4, and I'm willing to dedicate up to 30gb of ram, which is plenty for Ubuntu. I care less about why there are better ways to do what I want, and more to know if this solution is a possibility. – Matanya Oct 01 '17 at 02:27
  • I wasn't suggesting "better ways" to do what you want. There are no better ways. There's no way to do what you want. – dobey Oct 01 '17 at 12:56
0

I think I found a way to do this because it's been done before. I was just googling if anyone had done it before and I found this: http://dreamlayers.blogspot.com/2012/10/running-linux-from-ram.html

This looks like it works, but it's kind of hard to understand. If somebody could explain this better it would be great, especially the beginning setup. Thanks!

Matanya
  • 372
  • What that does is copy everything off disk into RAM when the kernel boots, and then runs init from there. Booting a system in this manner will be slower than just booting off disk, as it is copying all files into a tmpfs storage, using tar. – dobey Oct 01 '17 at 18:59
  • @dobey But once its booted will applications run at super speed? – Matanya Oct 01 '17 at 22:22
  • No. Applications will run no faster if their core binary is located in RAM or on disk. They might start slightly faster if the binary is loaded from RAM into RAM, but the standard operation of the process itself is unlikely to be faster. – dobey Oct 02 '17 at 01:37