Experimenting with initrd

Non release banter
yldouright
Black ninja
Black ninja
Posts: 80
Joined: 04 Mar 2015, 16:27
Distribution: Porteus (slackware 12.1)
Location: NY

Experimenting with initrd

Post#1 by yldouright » 19 Mar 2016, 23:12

Okay, I just witnessed an i5 laptop with an 8GB ram disk and a standard hard drive running faster than anything I know of. I have only 4GB of ram on my laptop but I'm running Porteus so I'm thinking a 2GB ramdisk with a little $20, 16GB SSD should perform about as well but the questions are:

Is 2GB enough ram to run Porteus without a swap file?
What should go on the ramdisk for maximum performance which will fit?
Can the ramdisk speed up the installation more by placing /temp on it or by using it as swap?
Is there a command we can use to spill over the ram disk onto real disk media either for permanent storage or for when it is full?

I think an exploration here might leverage the unique quality of Porteus into something special for laptops, am I wrong?

fullmoonremix

Re: Experimenting with initrd

Post#2 by fullmoonremix » 20 Mar 2016, 07:03

Salutations... :good:

I use this...
http://pkgs.org/debian-sid/debian-main- ... 4.deb.html

You will need to convert it with the USM Tool... then read the /usr/doc file to configure it.
It can shrink/grow and swaps out old pages when it is full. Best location for the swapfile... /tmp

Best Regards... :beer:
Last edited by fullmoonremix on 20 Mar 2016, 13:34, edited 2 times in total.

yldouright
Black ninja
Black ninja
Posts: 80
Joined: 04 Mar 2015, 16:27
Distribution: Porteus (slackware 12.1)
Location: NY

Re: Experimenting with initrd

Post#3 by yldouright » 20 Mar 2016, 12:54

fullmoonremix
Yes, this is exactly the tool needed but it's a .deb file. I'll check to see if it's in the Slackware packages. On another note, the Porteus boot disk doesn't seem to have the initrd command. How can we create a ramdisk prior to installation so that it shows up in gparted? Which applications would be likely to need more than 2GB of ram to run on Porteus without using swap space? I concur with your advice of putting /temp on the ram disk but could we achieve better results using:
2GB of 4GB for normal ram operation
1GB of 4GB for /temp on ram disk
1GB of 4GB for swap on ram disk
or some other combination? Thanks to all participating in this experiment.

fullmoonremix

Re: Experimenting with initrd

Post#4 by fullmoonremix » 20 Mar 2016, 13:14

Salutations... :good:

Yep. Unfortunately... it has to be compiled to have a native version. I just haven't been able to to get around to that yet.
So for the moment I'm cheating. To save you time it's not @ http://slakfinder.org/

/tmp? it is already in ram @ boot. I refer to putting Swapspace's "swapfile" INTO this folder by configuring /etc/swapspace.conf. Gparted? A ramdisk is virtual so it will not show up there.
With a virtual swap... size is moot because memory is swapping to itself. However... it is more important that Porteus gets enough memory ("capacity") using the "ramsize" cheat code.

My rule of thumb (for now...) in porteus.cfg is...
APPEND initrd=initrd.xz base_only copy2ram delay=5 fsck nochanges nomagic noswap ramsize=48% rootcopy=/mnt/s*/porteus/._/1603141438/rootcopy sgnfile=1603141438.sgn timezone=Factory zram=12%

My settings for Swapspace are... 6% (min)... 12% (target)... 24% (max)

This should be sufficient even for a 2gb system. Going with a virtual swap is a good play. I've always found disk swap
(or anything disk related) to be a haven for "persistent" malicious code. This is why my system is... "diskless" (ie. ...a cd/dvd booting a kiosk).

I forgot to mention... it's also a good play so you won't wear out your SSD (meantime before failure=1 million writes).
Mine is a Kingston internal 128gb (non-bootable... for archive only). I also archive to non-bootable 32~128gb USB removeable writable media.



Best Regards... :beer:

Posted by 73.150.85.78 via http://webwarper.net
This is added while posting a message to avoid misusing the service
Last edited by fullmoonremix on 12 Apr 2016, 12:26, edited 11 times in total.

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Experimenting with initrd

Post#5 by brokenman » 20 Mar 2016, 15:53

Is 2GB enough ram to run Porteus without a swap file?
Much more than enough.
What should go on the ramdisk for maximum performance which will fit?
In my opinion, a ramdisk has no real advantage with Porteus. Porteus already uses ram space by default. Read the installation file in the root of the ISO for more info on RAM requirements.

EDIT: Please read the installation file in the root of the ISO for more info on ram requirements.
How do i become super user?
Wear your underpants on the outside and put on a cape.

yldouright
Black ninja
Black ninja
Posts: 80
Joined: 04 Mar 2015, 16:27
Distribution: Porteus (slackware 12.1)
Location: NY

Re: Experimenting with initrd

Post#6 by yldouright » 20 Mar 2016, 16:20

Welcome brokenman to this research thread.

Correct me if I'm wrong but I understand browsers write and purge on the disk many times during web access and putting this action on a ram disk is a huge improvement in speed due to the decreased access time. Ditto for all the action on /tmp which includes all the installation routines and other miscellany. If fullmoonremix is right, there is no disk activity on /tmp after those files are read into memory until the program using those files quits or you shutdown. What is really happening in memory?
BTW, using the "load into ram" option on boot up is slower for me than the standard boot up time. Operation after Porteus loads is slightly faster.

fullmoonremix

Re: Experimenting with initrd

Post#7 by fullmoonremix » 20 Mar 2016, 17:21

Salutations... :good:
there is no disk activity on /tmp after those files are read into memory
Again /tmp is in memory NOT on hard disk... unless you install to a hard drive instead of using a "live" OS.

The advantage of a ramdisk is primarily for resources. Give me any OS and I will choke it with little effort with a single DSP plugin. DAW (and film editing) is latency and resource intensive. However... in fairness,
if (plain vanilla) Porteus is used for non industrial application it is superb. The idea of ramdisk swap (I also use zram for fault tolerance... although it has some known drawbacks) is cost effective capacity.

I cannot afford OS/X "ProTools" (the complete system) nor would I use it if someone gave it to me for free. It uses a powerful hardware/software combination which is why it's the gold standard of major recording studios.
Some which I've worked in. However... ramdisks... swapfiles... FPGA's... GPU's... parallelism... clustering... JIT's and many other esoteric tactics are the poor man's solution to leveling the playing field with the big boys.

This is why I hold the http://www.studioware.org/ project in such high regard. They are trying to bring powerful solutions to the Slackware community.
Many thanks to... francois for bringing them and Swapspace to my attention. If I won a Grammy I would definitely give a shout out to the community first.

Best Regards... :beer:

yldouright
Black ninja
Black ninja
Posts: 80
Joined: 04 Mar 2015, 16:27
Distribution: Porteus (slackware 12.1)
Location: NY

Re: Experimenting with initrd

Post#8 by yldouright » 20 Mar 2016, 19:07

fullmoonremix
Yes, Studioware is excellent and like you, I owe Francois for helping me to get it on my systems. I think my confusion is clearing up. Are you saying that /tmp is in ram only when you you haven't installed Porteus on a hard disk? If this is so then we can examine its behavior with the assumption that it is installed as a directory with Porteus on a hard disk. Does having a ram disk make more sense now? How can we use a ram disk as swap if GParted doesn't see it? Wouldn't it be a better strategy to not use a swap partition and place only the /tmp directory (and possibly the browser cache/support files) on it?

fullmoonremix

Re: Experimenting with initrd

Post#9 by fullmoonremix » 20 Mar 2016, 19:37

Salutations... :good:
Are you saying that /tmp is in ram only when you you haven't installed Porteus on a hard disk?
Yes. It is one reason why "live" systems are "secure (...NOT foolproof because nothing is) by design".
Secure by design means reliable... redundant... even possessing Fault tolerance but NOT invincible.

There seems to be a school of thought that believes it's contingent value is overrated. :unknown:
To have a system that is not persistent reduces (NOT eliminates) your vector attack surface. As they say... "every little bit counts" (until it doesn't).
If this is so then we can examine its behavior with the assumption that it is installed as a directory with Porteus on a hard disk?
Loading a module file system tree on storage media into a memory file system tree is NOT hard disk installation.
Porteus is "modular" perhaps it can be installed but that might be counter productive (eg. increasing vector attack surface).

Best Regards... :beer:

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Experimenting with initrd

Post#10 by brokenman » 20 Mar 2016, 22:05

Yes /tmp is created as tmpfs so it doesn't touch your disk. If you want to extend the life of your disk then I recommend booting into RAM and only saving what you need to your disk. In this way, you are working entirely from RAM and no ram disk is needed. If you are using a changes= cheatcode then you are writing to disk.
BTW, using the "load into ram" option on boot up is slower for me than the standard boot up time. Operation after Porteus loads is slightly faster.
Yes it boots a little slower as it has to load everything into RAM. The advantage is a slightly faster system with no disk read/writes. fullmoon will know more about using RAM/zram and stressing the system as he has more experience with high end processing.

Once you are done with this thread I will move it into a more appropriate category since this area is just for tutorials.
How do i become super user?
Wear your underpants on the outside and put on a cape.

yldouright
Black ninja
Black ninja
Posts: 80
Joined: 04 Mar 2015, 16:27
Distribution: Porteus (slackware 12.1)
Location: NY

Re: Experimenting with initrd

Post#11 by yldouright » 20 Mar 2016, 23:47

brokenman
I reviewed the RAM requirement as per your suggestion above. As mentioned before, I prefer to run Porteus from the hard disk. I will be using this laptop as a DAW along with the general use applications that come with Porteus but even so, I believe I can get away with not using a dedicated swap partition. I think using the swapspace program is a prudent compromise. If I accept the premise that Porteus does not write to the /tmp directory on the disk after the OS loads, my only reason to have a RAM disk would be to house the temporary browser files. Does Firefox also avoid writing to disk during its operation?

fullmoonremix

Re: Experimenting with initrd

Post#12 by fullmoonremix » 21 Mar 2016, 01:41

Salutations... :good:

Thanks brokenman... I know I'm not a team player and I'm somewhat radical. And I have a history of this... :oops: but I mean well.
I scored 95% (memory management section) on the CompTIA A+ test (I'm a lifetime member) without even bothering to study in 2000.

In '95 on my 2nd day of class @ DeVry Technical University I got kicked out by a former IBM engineer for confusing the class,
with advanced arguments. He passed me on the spot for the entire semester and sent me to help in the lab.

In 2nd grade elementary school I got expelled for arguing with my teacher because she told the class 1-2=0.
My father had to come to school and explain to her I already understood the concept of negative numbers.

Best Regards... :beer:

Posted by 73.150.85.78 via http://webwarper.net
This is added while posting a message to avoid misusing the service
Last edited by fullmoonremix on 22 Mar 2016, 16:31, edited 12 times in total.

donald
Full of knowledge
Full of knowledge
Posts: 2061
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Re: Experimenting with initrd

Post#13 by donald » 21 Mar 2016, 02:34

@ yldouright
once you understand the following..
a)
Unlike a standard Linux installation, Porteus exists in a compressed state on your
storage media, with no /root, /bin, /usr, etc. directory structure on the media itself.
The familiar Linux file structure is created on the fly in your computer's RAM
during the boot process.

b)
The 'EXIT:' extension tells the 'changes=' cheatcode to keep all
of the files that have been added/deleted/modified during the
live session stored in memory until you reboot/shutdown.
Your RAM works as a buffer which gets dumped on the drive only once,
when the session is finished.

your (browser) questions should be self-explanatory..

yldouright
Black ninja
Black ninja
Posts: 80
Joined: 04 Mar 2015, 16:27
Distribution: Porteus (slackware 12.1)
Location: NY

Re: Experimenting with initrd

Post#14 by yldouright » 21 Mar 2016, 11:58

donald
Thanks for this additional information but i'm still a little fuzzy on the following:
Are the changes made to disk, such as added modules and user preferences, also compressed and loaded into ram the same way? What happens when your browser upgrades? I'm currently having a peculiar issue with firefox; when I click on the upgrade notification, the program continually tries to upgrade unsuccessfully. Rebooting firefox shows the browser in the original older version.

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: Experimenting with initrd

Post#15 by Bogomips » 05 Apr 2016, 18:37

Moved to General Chat, as topic was neither imparting knowledge.nor providing help.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

Post Reply