- Ramroot – Run Arch Linux Entirely From RAM!
- Run Arch Linux From RAM Using Ramroot
- Display Ramroot help
- Remove Ramroot
- Conclusion
- You May Also Like
- How To Ignore A Package From Being Upgraded.
- How To Browse And Read Entire Arch Wiki.
- How To Convert DEB Packages Into Arch Linux.
- Retrieve Latest Mirror List Using Reflector In Arch.
- Install MATE Desktop Environment in Arch Linux
- How To Fix “pacman: error while loading shared.
- 9 comments
- Top 5 Linux Distros That Runs Entirely From RAM: Comparison & Analysis!
- The Short Version Of The Answer
- Best Distro with RAM boot: SliTaz
- 2 nd Best: Puppy Linux
- Best Distro with the smallest RAM need: TinyCore Linux
- Best Distro with RAM boot for running Servers: Alpine
- Comparison Table
- Roles of RAM and Hard Disks
- How to run the OS from RAM?
- Lightweight vs Heavyweight distros
- Quick Glance At Their Differences
- Distro Option#1: SliTaz
- ISO size: 43MB
- Kernel-Version: 3.2
- Ram needed: 300MB
- Distro Option#2: Puppy Linux
- Distro Option#3: Antix Linux
- Distro Option#4: Alpine
- ISO size: 81MB
- Kernel-Version: 4.4
- RAM: 128MB
- Distro Option#5: DSL
- ISO size: 50MB
- RAM: 128MB RAM can make the entire system run from RAM to give an ultra-responsive experience!
- Kernel-Version: 2.4.31
- Distro Option#6: TinyCore Linux
- ISO size
- Kernel-Version: 4.2
- RAM needed: 19MB
- The Results
- Best Distro with RAM boot: SliTaz
- 2 nd Best: Puppy Linux
- Best Distro with the smallest RAM need: TinyCore Linux
- Best Distro with RAM boot for running Servers: Alpine
- Summary
- Related Articles
Ramroot – Run Arch Linux Entirely From RAM!
As you already know, everyday there are hundreds of new additions to the GitHub repository. But, many good projects go unnoticed, and never receive the attention they deserve. Today, I stumbled upon a cool project named Ramroot. Using Ramroot, we can run Arch Linux entirely from RAM! Yes, you read that right.
Ramroot loads the entire root filesystem into RAM at system boot. It is specially designed for Arch Linux. I tried it in Ubuntu, but It didn’t work. I hope the developer will make it to work on other Linux distributions as well.
Run Arch Linux From RAM Using Ramroot
Ramroot is available in AUR, so you can install it using any AUR helper programs, for example Paru or Yay.
Then, enable Ramroot using command:
Sample output:
If it doesn’t work for any reason, grab the Ramroot binary from GitHub repository and run it as described below.
Git clone the Ramroot repository using command:
The above command will create a folder named «ramroot» in the current working directory and save all contents of Ramroot project in it.
Then, go to the Ramroot bin directory:
Make the following files a executable:
Finally, run the following command to enable the Ramroot.
Enter your sudo or root password when prompted.
Now, reboot the system. At boot process, you will be prompted to load the filesystem into RAM. Type «Yes» to proceed.
Load root filesystem to RAM
Please note that this prompt (y/N) defaults to yes with a 15 second timeout if 4G or more of RAM is detected. Since, I have 2GiB RAM, I had to type «Y» to continue.
Wait for a while to finish the loading process. It will take several minutes to load the entire root filesystem into RAM. Make sure you have sufficient RAM installed on your system.
If you want to maintain faster RAM sync times, try to keep a clean and trimmed down system. Remove old and unnecessary packages, and keep your package cache folder clean.
Update:
If you use the most recent Ramroot version, the installed RAM size should be at least 500MB more than the size of root filesystem. If there is at least 500MB more RAM than the size of the filesystem, the user will be prompted to load the root filesystem to RAM. If the size of the root filesystem is less than the installed memory, the latest Ramroot version won’t load the Root filesystem in your RAM. It won’t even prompt you whether it should load filesystem into RAM or not. The filesystem will be mounted in your local disk automatically and the Arch Linux will boot normally.
Once root filesystem is loaded into the RAM, you will be landed into rootfs prompt. Please note that nothing will be saved after reboot. Because our Arch Linux is entirely loading from RAM, not from the local disk.
Root filesystem loaded into RAM
Display Ramroot help
To display Ramroot help section, run:
Sample output:
Remove Ramroot
Reboot your system, and type «n» when it asks to load the filesystem to RAM to login normally to your Arch Linux system. Go to the ramroot/bin folder and make the following files as executable.
Finally, remove Ramroot from your Arch Linux system using commands:
If you have installed Ramroot from AUR, remove it using commands:
And, finally remove the Ramroot package:
Conclusion
Ramroot might be helpful for those who wants to do some testing on their Arch Linux box. Also, if you want a private session to learn Linux commands, Ramroot is definitely helpful. Give it a try, and don’t forget to share your thoughts about this project in the comment section below.
Resource:
I am Senthil Kumar, more commonly known as SK to my friends, from India. I love to read, write and explore topics on Linux, Unix and all other technology related stuff.
Tuxdrive – A Commandline Google Drive Client For Linux
HSTR – Easily View, Navigate, Search And Manage Your Commandline History
You May Also Like
How To Ignore A Package From Being Upgraded.
How To Browse And Read Entire Arch Wiki.
How To Convert DEB Packages Into Arch Linux.
Retrieve Latest Mirror List Using Reflector In Arch.
Install MATE Desktop Environment in Arch Linux
How To Fix “pacman: error while loading shared.
9 comments
Questions:
Does it CREATE or REPLACE the GRUB entry?
Can you setup a user session?
Can you mount HDD and SDD drives? so then save things
Question 1 – No, it doesn’t change anything. It simply loads the filesystem into RAM
Question 2 – You can set user session and switch to the new user.
Question 3 – I haven’t tested this yet. I suppose it should work.
The logic dictates that any Linux that can mount a filesystem on read & write can do changes to such filesystem.
Since your question 3 is ambiguos (what thigs to be saved?) i answer with what i thing it could be… actually i will investigate this “ramroot” as soon as i can… it seems to be just what i am most interested upon years (be able to run a full distro on my 64GiB Ryzen 7 2700X fully from RAM), yes i did not recieve yet all pieces of my new computer but i was searching for howto since years, prior to buy the hardware, even prior than the hardware even exists… other main goal i was looking for was loading VirtualBOX from RAM with Winodws10 virtual disk image file on RAM (more than 32GiB).
Answering to your question 3: Yes and No.
If you mount a filesystem you can save files, so downloaded PDFs can be saved to such filesystem, etc… just DATA.
But if you pretend to save applications configuration changes, or new installed apps, i am afraid will NOT be saved upon reboot, this does not seem like some LiveCD that uses a special file to save your session among reboots.
This must be much more powerfull from what i can thing of its uses:
1.- Boot with all your system on ram is equivalent to make system inmutable, so you can intentionally infect your system with a VIRUS (just the concept as a drastic example, i know how impossible is for a Linux to be infected) and on next boot no change persist, it will boot as it did, nothing had changed since all changes where done on RAM… except what you change by mounting filesystem in read & write mode… for example you can work with Gimp, Blender, LibreOffice or whatever, your work will be saved, but changes on such programs configurations will not persist upon a reboot (like historical opened/saved files, etc.)
2.You can chroot to system on real storage and there make changes, like install packages, etc… very usefull because you can prepare an install script, tested (see what fail, fix it, etc) on your RAM root, once you have it working (you can use reboots to test it multiple times) then you can chroot and run it there with the confidence it will do the same as when on RAM root… so you can failsafe install things on your system because you can try them on inmutable copy of your system (without the need to clone/restore since on boot it copies all to ram)… great use, since some installs can ruin a system; warning: anything that needs reboot will void this idea until a persistent next boot could be implemented.
3.-Also copy to ram VirtualBOX machines and run them enterly from ram, after shutdown just be sure to copy back to physical media from ram drive or you loose all changes… again one more extra use of this, no need to make inmutable disk image on VirtualBOX and loose disk speed, since if you want it to be inmutable, you just do not save the modified image… very usefull for Windows guest updates that fails and ruin Windows system, not to mention the disk speed, it will be RAM speed, not such very slow NVMe that can write 5Gib/s, yes RAM is a lot more fast than the fastest NVMe.
4.-Also if you want to make changes to installed apps, etc, there is the option to boot normal, without copy to ram.
I want to test it as soon as i can, it will help me a lot… if it does what it say it does… copy the whole root onto RAM and run from there.
Extra: Some motherboards let you how-swap SATA drives, some has SIX ports, imagine SIX fast SSD in LVM2 Striped (i know cost is arround 500 €), at each boot you only read from them and at speeds near best NVMe gives, but after boot you can put out them from your PC (with NVMe you can not, at least actually i do not know of any hot-swapable NVMe motherboard), so after that no matter what command is run, such SSD will not be able to be written (since they are not connect to the PC anymore), so you can do whatever ‘dd’ you want being sure you will not damage the data on them, as opposite if you ‘dd’ your NVMe you can ruin it.
SuperExtra: Imagine you boot fully to RAM and then have no storage space available (no storage connected), you can let your son or an extranger to use your PC, you know whatever do will got lost or not saaved to your storage, since tour storage is far away and off-line… it is similar to use a LiveCD without any storage drive on the system, but tons faster.
I can not wait to put my hands on this piece of softare, it is does such ‘copy root to ram’ and ‘continue to boot from ram’ it would be my best day ever.
Sorry to be so detailed and so happy that finally something like this exists, but most people do not image what the concept of this piece of software allows… i had only commented the top most usefull/importatn ones… like: makeing your system inmutable, ensure no write go to your disks after eject sata drives (if sata ports are hot-swapable) after copy to ram ends, probe new updates / installs prior to deploy them on the real system, etc.
Источник
Top 5 Linux Distros That Runs Entirely From RAM: Comparison & Analysis!
This article is for those of you looking for a Linux distro which can run entirely from RAM so that you can enjoy a lag-free experience!
Let’ go ahead and explore what choices we have and analyze their differences of the best Linux distros that run from RAM! Almost any Linux Distro can be made to run from RAM, but there are 2 main disadvantages we need to consider in doing that
- we need to do some hacking to get that done since this is not a feature available natively in those distros and
- they usually require very large RAM memory capacity (16GB or more), the price of which can get fairly expensive.
For these reasons, this article will focus on distros that have the inbuilt capability to run from RAM.
Let us start by look at the short version of the answer for those of you in a hurry!
The Short Version Of The Answer
Based on the pros and cons, these are the best distros for running on RAMs.
Best Distro with RAM boot: SliTaz
2 nd Best: Puppy Linux
Best Distro with the smallest RAM need: TinyCore Linux
Best Distro with RAM boot for running Servers: Alpine
Comparison Table
The table below shows the comparison of the distros considered.
Distro | RAM needed | Pros | Cons |
SliTaz | 300MB | Can do network boot | 300MB RAM needed so may not be the best option for really old machines! |
Puppy Linux | 1GB | Runs best on older hardware | The GUI feels a bit dated |
AntiX | 2.7GB | Good support for older hardware through AntiX Magic software | Hard to install some apps that don’t come directly with the OS |
Alpine | 128MB | Very good documentation | No GUI, only Text console |
DSL | 128MB | Comes loaded with so many apps | Updated more than a decade ago in 2008 and hence not actively maintained |
TinyCore Linux | 19MB | Smallest footprint | Loading everything into RAM on boot is not the default behaviour, some tinkering around needed |
That is just the short version of the answer, let’s go ahead and look at the longer and more informative version and learn what were the factors considered, what other choices you have and see why the above distros are chosen as the best distros that run from RAM. Let’s start by look at the roles of RAM and Hard disks on a typical operating system.
Roles of RAM and Hard Disks
As we know RAM is volatile storage and loses all its contents when power is removed. Hence it cannot store the files we create, the apps we install or the changes we make. For this reason, all our data is stored in the Hard disk and values are copied to RAM whenever needed.
For example, let us say we open a text file for editing. The text file is copied from our Hard disk to RAM so that we can make changes to it using a text editor. When we are done making changes, we give the save command which then takes the copy in the RAM and stores it in the Hard disk. But say we remove the power while doing the editing, all changes will be lost and when we power the machine up again all the changes will be lost and the file will look the same before we made any changes.
Now that we have seen a simplistic explanation of the RAM-HDD model, next, let’s go and see how we can run the OS from RAM!
How to run the OS from RAM?
Basically, how this is accomplished is by keeping 2 copies of the entire data, one in the Hard disk and another in the RAM. On boot up, just copy all the data from the Hard disk into RAM and run from there, whenever we make any changes on the RAM’s copy, just copy over the values to the Hard disks copy too. This way we don’t need to load something from RAM every time we need that, and we have an ultra-smooth user experience!
Sounds simple, doesn’t it!
The next logical question that comes to mind is: If that’s the case why can’t the OS designers do it all the time?
Let’s look at an example and see why this is not possible!
Consider Ubuntu, the system requirement of Ubuntu is the following
- 4GB of RAM
- 25GB of hard disk space
So only one-sixth of the entire operating system, applications and data can be held in RAM at any given time. This is because of the fact that RAM per GB is expensive compared to Hard disks. For the same money that can get you 4GB of RAM, you can get 500GB of hard disk space. Due to this reason the operating systems usually store all the applications and files on your hard disk and load up only the active applications and files onto the RAM and when you close the application, the RAM space is freed up so that the next app you load can utilize that space.
If that is the case how can the above method even work? Yes, it can be provided we have a small enough operating system footprint and a big enough RAM to accommodate this footprint!
Thus the smaller the footprint of a distro, the easier it is to run that distro from less RAM. The distros that come with these small footprints are called as Lightweight distros. Let’s have a quick look at the 2 differences between the 2 classes of distros in terms of their footprints namely lightweight and heavyweight distros.
Lightweight vs Heavyweight distros
As a beginner to the Linux world you will often hear the words “Lightweight distros”, but what does it mean?
What are Lightweight Distros? Lightweight distros are Linux distributions specially made keeping old and resource constraint hardware in mind so that the user can have a responsive and lag-free computing experience even on your old hardware that has low specs in terms of processing power, disk space, and RAM.
What are Heavyweight Distros? “Heavyweight distro” is a subjective term made up by users of Lightweight distros. These distros are usually at the other end of the spectrum, with the latest and greatest feature, built keeping the best computing experience in mind and the user is expected to have a computer very good processor, lots of RAM and disk space to run it.
All the normal distros are usually considered heavyweight distros!
Some people even use the term “middle-weight” distros to denote the distros which are a mix of both!
Quick Glance At Their Differences
When you hear the term “Lightweight distros” and a number of questions will pop into your minds
Is it their ISO image size?
Is it their about their resource requirements?
Is it because they don’t come with a lot of apps?
The short answer is, generally all the above-mentioned factors like ISO image size, resource requirements, number of preloaded apps, etc are used to differentiate these 2 classes of distros. The table below shows their differences in more detail.
LIGHTWEIGHT DISTROS | NORMAL/HEAVYWEIGHT DISTROS |
Smaller ISO, usually a few hundred MBs. | In the order of GBs |
Needs very low resources like less Disk Space, less RAM, and a simple processor to run | Needs more resources |
Better suited for older hardware and comes with driver support for the older hardware. | Better suited for newer hardware |
They come with only the absolutely necessary software to run the system. | They come with everything a general user needs like LibreOffice, Calc, Browsers, etc. |
Has a simplistic desktop environment, like Xfce and LXDE | Has a fancier desktop environment like GNOME 3, Unity, etc. |
Even the apps installed are lightweight, for example, you will often find Firefox replaced by lightweight ones like Midori | The latest and greatest apps are usually used here as defaults. |
They usually have very little background services to keep the system responsive. | No such restriction is imposed on background services |
They can usually be loaded entirely into RAM and run from there for a lag-free experience. | Usually, install sizes are too big to be run from RAM |
These are the main differences between these 2 classes of distros. To learn more about their differences I suggest reading the article below where I have explained the sacrifices and trade-offs lightweight distros make in terms of usability and computing experiences to make them more suitable for use in resource-constrained hardware!
Next, let us get back to the focus of this article which is a list of distros options to run the OS directly from RAM.
Distro Option#1: SliTaz
SliTaz offers a good balance of size and features. According to the official website http://www.slitaz.org/
“SliTaz GNU/Linux is a free operating system working completely in memory from removable media such as a CD-ROM or USB key. It is light, speedy and fully installable on a hard drive. SliTaz is distributed in the form of a LiveCD that you can easily burn to a cdrom and boot from. When the system is running you can eject the LiveCD and use your CD drive for other tasks. The Live system provides a fully-featured, working graphical distro and lets you keep your data and personal settings on persistent media. The system can be extended with the Tazpkg package manager and security updates are provided for the cooking and stable versions.”
You can make SliTaz run from RAM but doing a frugal install to the drive and make the default behaviour to be able to run from RAM.
ISO size: 43MB
Kernel-Version: 3.2
Ram needed: 300MB
- Runs OpenBox LXDE desktop
- Can be installed inside windows to make trying out easier
- Can do network boot
- Midori browser
- Transmission torrent client
- Text editor
- Calculator
- Basic spreadsheet
- 300MB RAM needed so may not be the best option for really old machines! (we are nit-picking here!)
Distro Option#2: Puppy Linux
Puppy Linux is one of the best lightweight distros out there that can run from RAM
- The GUI feels a bit dated
- 1GB Ram needed
Distro Option#3: Antix Linux
“antiX is a very flexible linux distribution. You can run it live from a cd, live from a usb stick (with persistence ie changes are saved on reboot) as well as setting up a frugal-install from an internal or external hard drive. Of course, you can install to internal and external drives, sticks, cards etc. You can even run it live, add/remove applications, customize it, remaster it and then install. All your changes will carry over to install!”
- Relatively popular distro (ranked 11 at distrowatch.com for popularity)
- Good support for older hardware through AntiX Magic software
- Hard to install some apps that don’t come directly with the OS
- 2.7 GB or more RAM is needed
Distro Option#4: Alpine
Alpine Linux is a security focussed lightweight distro. According to the official website https://alpinelinux.org/
“Alpine Linux is an independent, non-commercial, general purpose Linux distribution designed for power users who appreciate security, simplicity and resource efficiency.”
Alpine Linux supports 3 modes of installation
- Diskless mode: runs from RAM, changes are lost on reboots
- Data mode: regular mode, runs from hard disk
- Sys mode: a combination of the above 2, copies everything on boot to RAM, which is what we need!
ISO size: 81MB
Kernel-Version: 4.4
RAM: 128MB
- Has inbuilt support for booting into RAM
- Busybox command-line utilities
- Best For Server and Embedded Scenarios
- APK Package manager is very good
- Very good documentation
Distro Option#5: DSL
DSL stands for Damn Small Linux. This distro is targeted for Desktops, originally developed as part of an experiment to see what can realistically fit into 50MB live CD, later grew into a community project with so much work put into this distro to make it into what we see today!
According to the distro’s official webpage, this small 50MB iso packs the following applications!
“XMMS (MP3, CD Music, and MPEG), FTP client, Dillo web browser, Netrik web browser, FireFox, spreadsheet, Sylpheed email, spellcheck (US English), a word-processor (Ted), three editors (Beaver, Vim, and Nano [Pico clone]), graphics editing and viewing (Xpaint, and xzgv), Xpdf (PDF Viewer), emelFM (file manager), Naim (AIM, ICQ, IRC), VNCviwer, Rdesktop, SSH/SCP server and client, DHCP client, PPP, PPPoE (ADSL), a web server, calculator, generic and GhostScript printer support, NFS, Fluxbox and JWM window managers, games, system monitoring apps, a host of command line tools, USB support, and pcmcia support, some wireless support.”
ISO size: 50MB
RAM: 128MB RAM can make the entire system run from RAM to give an ultra-responsive experience!
Kernel-Version: 2.4.31
- Designed to run everything from RAM
- Can run inside windows so easy to try out!
- Has SSH, HTTPD and FTP capabilities out of the box
- Comes loaded with so many apps
- Can be extended to suit user needs
- Apt package manager
- The GUI looks very outdated, a direct result of the trade-off to limit the size and increase speed.
- Updated more than a decade ago in 2008 and hence not actively maintained
Distro Option#6: TinyCore Linux
“Tiny core is a unique and minimalist distribution of the Linux operating system and tools”
TinyCore comes with bare essentials and it is the duty of the user to install whatever app he/she needs. Installation of apps can be done using a GUI tool so you don’t need to go for command line installation processes!
ISO size
Tiny core comes in 3 variants
- Core: Only CLI (11MB)
- TinyCore: Core + GUI Desktop (16MB)
- CorePlus: TinyCore + List of configurable window managers and support for WiFi (106MB)
Kernel-Version: 4.2
RAM needed: 19MB
- Smallest footprint
- Modern looking desktop UI
- BusyBox command-line utilities
- Very minimal iso
- Loading everything into RAM on boot is not the default behaviour, some tinkering around needed
- User need to install whatever apps he/she needs
The Results
Based on the pros and cons, these are the best distros for running on RAMs.
Best Distro with RAM boot: SliTaz
2 nd Best: Puppy Linux
Best Distro with the smallest RAM need: TinyCore Linux
Best Distro with RAM boot for running Servers: Alpine
These results are just my take on things, look through the pros and cons and choose the one that best fits your needs! As mentioned at the beginning of the article theoretically you can tinker any distro to run from RAM. You can even install heavyweight distros into RAM as long as you have enough RAM space. To run ubuntu entirely off RAM I suggest you have 16GB or 32GB of RAM!
Summary
Here is the comparison table again!
Distro | RAM needed | Pros | Cons |
SliTaz | 300MB | Can do network boot | 300MB RAM needed so may not be the best option for really old machines! |
Puppy Linux | 1GB | Runs best on older hardware | The GUI feels a bit dated |
AntiX | 2.7GB | Good support for older hardware through AntiX Magic software | Hard to install some apps that don’t come directly with the OS |
Alpine | 128MB | Very good documentation | No GUI, only Text console |
DSL | 128MB | Comes loaded with so many apps | Updated more than a decade ago in 2008 and hence not actively maintained |
TinyCore Linux | 19MB | Smallest footprint | Loading everything into RAM on boot is not the default behaviour, some tinkering around needed |
And with that, I will conclude this article!
I hope you guys enjoyed this article and learned something useful.
If you liked the post, feel free to share this post with your friends and colleagues!
Related Articles
Here are some of my other articles that might interest you!
Источник