3

Is there any way of booting from SSD/USB/NVMe/eMMC to have a Linux OS, such as Ubuntu, plus applications, services and containers load entirely into partitions created in RAM such as DDR3 or DDR4. This should ideally allow for use of other partitions, on say SSD or HDD for file storage regardless of which OS loads, probably FAT32 or exFAT for cross-OS support.

This is because even large Linux distributions use just a few units or tens of gigabytes, and many users want to use the same hardware for lots of distributions, e.g. home entertainment, software development, gaming, media production, office productivity, where users could select their environment from say a boot-loader or different USB keys, and run that environment entirely in RAM where user files reside on SSDs or HDDs, and there is a shut-down process, manual procedure or automated syncing of files in RAM archiving back to the original hard-drive/USB, for the next boot.

For example, you could have a customised Steam-based OS for gaming, switching to a media-streaming OS for relaxation or parties, switching to a office productivity OS and then an Education OS, or Webserver OS, from either USB keys or SSD partitions or similar, sharing user folders among different volatile-to-non-volatile loads of differing OSs, archiving back to original drives or keys. A large cheap RAID array or single SSD could function to store files such as games, files, media, but utilising the RAM for core OS, application, library and code and services etc.

Load times would increase but the OS, applications, libraries, services and databases, containers, plus gaming and media production speeds could be improved utilising lots of RAM and cheap USB loaders/archives or SSD rather than having to fork out on the cost of a large SSD or NVMe drive to accommodate those needs, which would load faster but be less responsive than loading the OS and apps into RAM.

The ability to run entire drive in RAM is also important in server scenarios especially databases which are not entirely suited to SSDs and more suited to RAM in terms of seek times, read and write times, bandwidth and numbers of rewrites and failures. For example, run a Linux Server OS including a Docker container of databases, server, code, libraries etc on one or more RAM partitions, utilising other drives for user files. Also RAM swap/working folder areas would be useful in backup or media production scenarios also, to reduce the time of archiving.

Many users are content with current bus speeds, but in professional and server and gaming and customisation markets the ability to a couple a fast CPU/GPU to OS file/service elements loaded into RAM would be very advantageous.

The idea came from a few 3rd party Windows software solutions which can create mapped partitions on RAM, archiving bakc manual to origin drive folders, also the Hyperdrive from years ago which used a PCI card and DDR(2?) memory as a recognizable internal hard drive. The idea could be applied to Linux kernels, especially in the movement from HDD to SDD to PCIe, go one step further to reduce complexity and potentially increase security of running certain functions or the entire OS from RAM.

An additional option could be to have a tiny NAND flash boot load in network scenarios for servers not using any HD but massive RAM arrays for volatile only storage, using external storage for backups/snapshots and boot files, or perhaps a remote network boot to load the OS from the cloud into RAM, archiving to another cloud.

6Gb/s on SATA3 for user files such as media, plus 25Gb/s from PC4-25600 for OS/libraries/apps/containers etc. Power supplies in most modern grids are consistent enough in nearly all scenarios, where UPSs or standard drives could be used in less developed electricity grids, and mobile situations.

Comments welcome.

0

Almost all distros which have installers as an ISO image support a command line switch to load the entire distro into RAM and run your system this way. All newly created files will obviously remain in RAM and it's going to be your task to dump them to your storage once you're done.

Most if not all distros have tools to create a LiveCD version of them but creating an ISO image per se is not required. You can generate an ISO, then extract vmlinuz, initrd and the main image and put them on any partition and add all three to your GRUB configuration. As part of mastering your own version of a distro (which is extremely distro specific) you can add a systemd script which could 1) mount certain partitions automatically or 2) dump users files to the disk on shutdown.

Here's an overview of all the distros which run from RAM by default: https://en.wikipedia.org/wiki/List_of_Linux_distributions_that_run_from_RAM - I can imagine some of these distros allow to dump user files on shutdown pretty much automatically.

0

I needed to prepare some small Linux installation for booting from network. After some googling I found some ISO with live OS e.g. Archlinux, which was able to be dowloaded and started with PXE. These Live OSes was completely running from RAM, but usualy the main volume is compressed with squashfs, and some folders are converted to r/w with overlayfs. It took some time and lot of reading to install and configure my own disk image (not ISO for CD) wich can be downloaded into the RAM and the Linux runs completely from this image. The used bootloader is SYSLINUX and its very helpful module "memdisk". The size of diskimage is only 900MB and installed packages are oriented for rescue. The image can be downloaded into RAM either from NET or from USB flash.

0

If your concern is speed, then this is what already happens. Except that it is lazy loaded (loaded on demand), and dropped from RAM is space is tight.

The kernel (Linux) will use caches to store a copy of disk content in RAM. It will use this cached copy when ever the disk is re-accessed, to speed up reads and writes. Writes are eventually written back to disk.

You can force the behaviour that you want by doing find / -mount -type f -print0 | xargs -0 cat. However this will result slow performance until the whole system is loaded. It is usually better to just let it do its thing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.