You are not logged in.

#1 2011-04-29 13:16:06

pavekt
Member
Registered: 2009-03-17
Posts: 5

Create bootimg and boot to RAM

Hi so recently during my boot process I will copy some of my bin and lib directories to RAM and bind mount them.  Now with memory being so cheap I decided to get 16GB so that I can run my entire root fs on ram. 

My idea is this.  I will untar a boot image to RAM and boot from it.  My home directory will still be on disk, I haven't decided to have it be local or on my server.  When I run updates or new installs to the system I would simply create a new bootimg and update grub.  This has several benefits, I will have insanely fast access & read/write times and whenever I screw something up I have a backup image to boot to and everything is as good as new.

So my questions:

1) Do you see any potential problems in this?

2) How do I create an image of my root fs?

3) How do I boot an image from RAM?



Thanks

Offline

#2 2011-04-29 14:45:59

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Create bootimg and boot to RAM

You can have a look at https://wiki.archlinux.org/index.php/Ar … TKarchLive - it'a a live distro that runs in RAM.
I'm not sure if I get this right, but all the apps you use are loaded into RAM anyway, so once they're loaded the traditional way they are as fast as doing it your way.
What about power loss? The RAM memory is volatile so it will result in data loss unless you have some sort of battery backup. How do you keep the changes in your image? does every change in the configs will result in a new image?
Accessing data from your HDD will still be slow, how about getting less RAM and an SSD instead?

Offline

#3 2011-04-29 15:33:22

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: Create bootimg and boot to RAM

IIRC, somewhere on these forums was a discussion on RAID with a RAM disk and an actual partition.

Last edited by fsckd (2011-04-29 15:34:49)


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#4 2011-04-29 15:47:06

pavekt
Member
Registered: 2009-03-17
Posts: 5

Re: Create bootimg and boot to RAM

Thanks Karol I will look into that.  I want to have a root RAMFS the same reason why someone would want a ssd or any fast disk.  The speed of loading applications.  For example firefox loads for the first time in under a second on my current configuration.  Like I said my home directory will still be on disk so anything important will be saved.  So after I have my machine set up there shouldn't be much changing, only updates which I would probably do one time a week and then create a new image.  The advantage is that if an update breaks something or I break something I just boot to my last image.  Not to mention RAM access time is in the nanoseconds not milliseconds and can R/W up to 10GB/s.

Last edited by pavekt (2011-04-29 15:49:00)

Offline

#5 2011-05-02 20:55:39

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Create bootimg and boot to RAM

What about any edits you make in /etc -  will they be lost on reboot?

Once in RAM your apps will indeed start very quickly, but you first need to load them there and this can take quite some time but unless you're rebooting often it shouldn't be an issue.

In case you want to look into some other techniques regarding applications preloading, there are tools you may find interesting, like https://wiki.archlinux.org/index.php/Preload or https://wiki.archlinux.org/index.php/E4rat
They don't have the benefit of fallback images and may even be more cumbersome than a simple ramfs image.


I would be interested in knowing how did things work out for you so please come back some time and share your experiences :-)

Offline

#6 2011-05-02 21:57:13

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Create bootimg and boot to RAM

Perhaps take a look at CTKArchLive 0.7 version which has persistence and has addons both in the boot parttion and can have a second parttion holding additional addons.

The addon procedure allows creating an addon from  system changes made during a given session.

Thus, when booting, the addons are added to the system and are installed in a persistent manner.

Addons thusly generated can also be deleted if so desired. 

Because the system uses aufs, many packages can be accessed and evaluated before adding them as addons.

The system can be loaded cp2ram as an added feature but does not increase the spped of operation.

My boot time is ~14 seconds with a dozen or so addons.

I am posting from CTK arch at the moment.

It is worth a look-see.

Good hunting.


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#7 2011-05-03 23:34:07

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Create bootimg and boot to RAM

Trying the cp2ram option in CTK will give you the performance you desire fully in ram.  You may not appreciate the change it makes.


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#8 2011-05-04 16:59:02

pavekt
Member
Registered: 2009-03-17
Posts: 5

Re: Create bootimg and boot to RAM

> What about any edits you make in /etc -  will they be lost on reboot?

Yes without making a new image I would lose them but again once everything is configured and setup I don't see my self making many changes other then during the update days. 

Lilsirecho thanks for your input I will look into that.


Unfortunately I have been swamped at work and have not had time to mess with this.  I will be back with results and a tutorial when I get it working because I think others will be interested.

Offline

Board footer

Powered by FluxBB