[ltp] running from ram

Laurent Gilson linux-thinkpad@linux-thinkpad.org
Tue, 10 Jan 2006 11:25:31 +0100


Hello

> A thought - why not use rsync to copy the files each way? That way,
>
> a)shutdown would be much quicker.
>

i didn't go for rsync because i keep backups of everything. During  
shutdown the script deletes (on the disc) /home.bak and renames /home to  
/home.bak. Afterwards the /home from ram is copied to the disc.

I had some major problems with the first versions of my scripts. These  
wiped out my /home several times, so i became careful. Switching to rsync  
is planed for some time in the future but not top priority.

Shutdown "only" has to write 120 MB, so it takes like 10 sec extra,  
including removal of the old /home.bak. With all the tweaks (CPU voltage,  
WLAN, gfx,...) i used the spinup of the HD while the batt is low can  
already cause problems. The system uses +10W during normal use so 15 min  
remaining is a very low batt.

> b)you'd have the advantage of being able to commit a saved file to disk.

Executing the shutdown-script during normal use creates a backup on disc.  
And the important files are on a server in the basement.

> Also, doesn't noflushd do something relatively similar?

Yes and no:

- If you (or linux in /var, or a atime) save/change something the disc  
will spin up after some timeout (10-30 min ?).

- If you start something you haven't started before it spin up too.

- The files keep in RAM are not compressed. My /usr alone takes 1.1GB.  
Compressed it's ~400MB.

- The access to in-RAM files is faster (no decompressing)

- startup is much faster with noflushd.

- noflushd restarts from 0 after a suspend-to-HD because suspend-to-HD  
does not save filecaches. (with my setup suspend-to-HD has to write ~900MB  
to the disc, because the squashfs-images are treated as normal files)

So basicly it depends on your usage-pattern. noflushd is the easy way. You  
only risk 10-30min of work and installation is a nobrainer.

Pure ramdisc operation can lose everything you did since the last restart.  
It prevents you from installing new stuff w/o rebooting. Installation is  
complex, you need to fine-tuning of the whole system.

I liked the idea of a 100% noisless system. What's why i implemented this.

cu