Live data from Hacker News

Ramroot – Run Arch Linux Entirely from RAM (2017)

ostechnix.com

11–20 of 83 posts

Re: Ramroot – Run Arch Linux Entirely from RAM (2017)

#12
post #9

Out of curiosity, does data persist after a shutdown when an OS runs on RAM? Are there dumps to a HDD?

Nope.

The piratebay used to run their servers like this. They'd boot off of a USB stick, pivot root to a ram disk, and then unmount the USB stick. Then when the cops would seize the machines and cut power to save as much evidence as they could, they'd actually be doing the opposite.

Re: Ramroot – Run Arch Linux Entirely from RAM (2017)

#14
I built something like this back in 2002 when I was at Red Hat for a client that wanted to have their firewalls to have read-only configurations on a diskless system. They would update the rules/config/system by burning a new CD and booting it up.

It worked basically how a Live CD worked - creating a temporary filesystem in ram, and I only learned later that they already existed (I didn't know at the time and the Internet wasn't as good at finding things as it is today :) )

Re: Ramroot – Run Arch Linux Entirely from RAM (2017)

#15
post #3

This is neat, but nothing new. I remember using this builtin feature on live distros like Slax and DSL over a decade ago. It was fun to see old computers run (comparably) blazingly fast.

The new thing is that it can be just be switched on/off on an existing install. Sure people have been running distros from ram for a while but getting the tooling situated to make it like any other feature it super cool.

> The new thing is that it can be just be switched on/off on an existing install.

Is that only true for Arch, or is that also working on other distros?

Re: Ramroot – Run Arch Linux Entirely from RAM (2017)

#17
Many OS out there take advantage of RAM Disks. Alpine Linux for instance allows you to boot your root device on ram as a default. SmartOS runs a boot image completely on RAM, and keeps your storage free for a few configs and VMS.

Virtually all network booted computers run their OSs from RAM. If you have never pxe booted a machine, it is a beautiful experience once you overcome a few challenges: easy upgrades and rollbacks, being able to use a machine with different contexts/platforms by just rebooting, and having your servers cleaned up just by cycling (assuming you don't have local storage)

If you enjoy the idea of RAM root devices, please try pxe/ipxe to boot your computer from a network. Also, if you have a sufficiently fast network... it is probably faster than booting from disk!

EDIT: I missed the word "all" on the second paragraph, and another typo... sorry!

Re: Ramroot – Run Arch Linux Entirely from RAM (2017)

#18
I believe FreeNAS does something like this during startup. You can “install” it on mirrored USB drives in case you run out of power. The redundant USBs are used to install the OS back into RAM. An extra USB in case of corruption and they’re way cheaper than SSDs. I’m assuming you still need to write config files back to the USB.

FreeNAS prefers ZFS so it’s RAM hungry anyway. The article recommend 500mb more than you need.

Can you do this to an Arch VM?

Re: Ramroot – Run Arch Linux Entirely from RAM (2017)

#19
I wonder whether this achieves anything performance-wise that just cat'ing every file to /dev/null to warm up the buffer cache wouldn't achieve.

In theory, the kernel uses a buffer cache that will hold on to disk pages until they're invalidated by writes. It'll evict the cache if there's memory pressure. But this setup will presumably just crash if there's memory pressure, so that doesn't seem like a win for the RAM disk.

Re: Ramroot – Run Arch Linux Entirely from RAM (2017)

#20
Alternatively, one could use NBD (network block devices) to create a network block device that resides entirely on a server's RAM.

The nice thing about NBD is that its a super simple protocol, the server runs in user space, and it's easy to modify to suit own needs. I built sometime ago a version with block deduplication for a farm of disk-less clusters that had very little ram in ~1k LOC. Main disk had persistence activated, while swap drives were pure RAM.

Post reply on HN