Author |
Message |
jemimah

Joined: 26 Aug 2009 Posts: 4309 Location: Tampa, FL
|
Posted: Mon 02 Nov 2009, 02:20 Post subject:
Puppy RamBoot - Everything (including save file) in RAM Subject description: What to do if you have way too much memory for your own good |
|
I've hacked the 4.3.1 init script to bring you a fabulous new feature.
The ramboot option enables you to load all of your sfs files and your save file into RAM and run completely diskless. Of course you need to keep these files small enough to fit in the amount of RAM you have, leaving some space for the OS to operate. You can then use the hdparm utility to shut down your hard drive (assuming you're running without a swap space) , saving power and reducing noise. Plus you'll get even faster performance. The downside is, none of your changes will be persistent (at least not yet, I may, in the future, provide a shutdown script that copies your save file back to disk). So the procedure is: set up your save file how you want it, then use the ramboot option when you're not planning on doing anything you'd want to save.
To try out ramboot, replace your initrd.gz with the attached one. Then add 'ramboot=1' to the kernel line in your menu.1st or syslinux.cfg.
EDIT: I've added a shutdown script that saves your file back to disk. This is alpha software so please don't test with important data. You need to have enough room on your boot disk for 2 copies of your save file, as the script makes a backup of the old file before writing the new file to disk. The script assumes your boot drive has the same drive name as it did when you booted. This can be a problem with usb drives that have been removed and reinserted, so pay attention.
Edit: I've updated a new version of the initrd.gz to work with subdirectories.
Edit: 12/30/09 fix for shutdown script
Edit: 1/06/10 fix for copy2ram
 |
Description |
|

Download |
Filename |
rc.shutdown.gz |
Filesize |
13.43 KB |
Downloaded |
922 Time(s) |
Last edited by jemimah on Wed 06 Jan 2010, 13:13; edited 6 times in total
|
Back to top
|
|
 |
raffy
Joined: 25 May 2005 Posts: 4839 Location: Manila
|
Posted: Mon 02 Nov 2009, 08:34 Post subject:
nice |
|
Excellent idea, since the available DDR2 sticks today have at least 1GB RAM storage.
If the user can tell where pup_save.2fs is located, s/he can copy it to hard disk (or other storage) before shutdown. But of course the shutdown script should be able to handle that, as you described.
EDIT: I booted initially without pup_save. At shutdown, it was trying to update a pup_saveOLDxx.2fs. Did you happen to hard-code your pup_save into the init script?
_________________ Puppy user since Oct 2004. Want FreeOffice? Get the sfs (English only).
|
Back to top
|
|
 |
jemimah

Joined: 26 Aug 2009 Posts: 4309 Location: Tampa, FL
|
Posted: Mon 02 Nov 2009, 13:06 Post subject:
|
|
You can't copy it yourself because it's still mounted, and copying a mounted file system almost always causes severe corruption.
The script copies any file in your save directory that ends in *fs to RAM. If you want it to ignore a file, change the extension, or move it out of the directory with your SFS files.
It's supposed to throw an error message and die if you try to boot without a Pupsave. It must have found your old one and tried to use it. Nothing is hard coded, so I don't really know where it got that file from. It's also supposed to be forced into pupmode 12, so you really shouldn't see it spending a lot of time updating while you are shutting down.
|
Back to top
|
|
 |
vg1
Joined: 02 Dec 2007 Posts: 142
|
Posted: Tue 03 Nov 2009, 06:01 Post subject:
|
|
Sounds a lot like PG's 'groundhog' exsercise he did quite some time ago [around version 4.00, I think]. Except there you had the option at shutdown to save your changes to pup_save or not.
|
Back to top
|
|
 |
jemimah

Joined: 26 Aug 2009 Posts: 4309 Location: Tampa, FL
|
Posted: Tue 03 Nov 2009, 15:51 Post subject:
|
|
Thanks for the tip vg1. It appears my implementation is a bit different than what Pizzasgood did. So his shutdown script won't help me much.
This version does have dynamic RAM allocation, and it doesn't copy the files out of your 2fs file. It just copies the whole thing to RAM and mounts it from there. The trick will be to figure out how to unmount the RAM copy of your 2fs so you can copy it back to disk. You'll also need extra disk space to store a backup copy of your 2fs so you won't lose it if a power loss occurs during the copy-back process.
|
Back to top
|
|
 |
raffy
Joined: 25 May 2005 Posts: 4839 Location: Manila
|
Posted: Tue 03 Nov 2009, 23:17 Post subject:
aufs |
|
"Logrow" idea is able to write back to mounted sfs:
http://aufs.sourceforge.net/logrow.txt
Kirk and Okajima seemed working on this. Kirk has Fatdog puplet here in the forum.
_________________ Puppy user since Oct 2004. Want FreeOffice? Get the sfs (English only).
|
Back to top
|
|
 |
prehistoric

Joined: 23 Oct 2007 Posts: 1726
|
Posted: Tue 03 Nov 2009, 23:50 Post subject:
everything in RAM |
|
I was away from Puppy for some time, so you regulars may be able to help me with this.
I remember a radical suggestion about a version without the layered file system. It would act like a full install to a ramdisk. This would certainly be fast and simple. Saving might require some more work. One thing I liked was the end of problems with "whiteout" files. Having files mysteriously revert to earlier versions when there are bugs in the layering would have driven me nuts, (if I hadn't already been there.)
For machines like the Eee-PC, where you can count on having 1 GB of RAM, this could be the way to go, when the whole OS takes about 100 MB. There are several different ways of putting "everything in RAM". Can someone outline the current alternatives?
|
Back to top
|
|
 |
Lobster
Official Crustacean

Joined: 04 May 2005 Posts: 15238 Location: Paradox Realm
|
Posted: Wed 04 Nov 2009, 00:22 Post subject:
|
|
Quote: | load all of your sfs files and your save file into RAM and run completely diskless |
I wonder if there will be cross fertilisation with Quirky?
http://puppylinux.org/wikka/Quirky
_________________ YinYana AI Buddhism
|
Back to top
|
|
 |
disciple
Joined: 20 May 2006 Posts: 6781 Location: Auckland, New Zealand
|
Posted: Wed 04 Nov 2009, 00:37 Post subject:
|
|
Quote: | Can someone outline the current alternatives? |
A couple of people have been working on using .sfs files without unioning them
_________________ If you have or know of a good gtkdialog application, please post a link here
Classic Puppy quotes
ROOT FOREVER
|
Back to top
|
|
 |
disciple
Joined: 20 May 2006 Posts: 6781 Location: Auckland, New Zealand
|
Posted: Wed 04 Nov 2009, 00:46 Post subject:
|
|
Quote: | "Logrow" idea is able to write back to mounted sfs: |
sfs? Are you sure? Maybe I don't quite understand, but it sounds to me like it would be for dynamically increasing the size of the .2fs file when you run out of space.
_________________ If you have or know of a good gtkdialog application, please post a link here
Classic Puppy quotes
ROOT FOREVER
|
Back to top
|
|
 |
jemimah

Joined: 26 Aug 2009 Posts: 4309 Location: Tampa, FL
|
Posted: Wed 04 Nov 2009, 10:50 Post subject:
|
|
The simplest way to do a full install to ram is to dump your whole filesystem intro the initrd. I have done this successfully, but I abandoned the idea because the above way is superior. Boot time is very slow, because first you have to load your giant initrd to RAM and then you have to decompress it. So not only is it slow, but you need enough RAM to hold both the compressed and uncompressed initrd at the same time.
There's also this method: http://www.justlinux.com/forum/showthread.php?t=151619
However, using squash files is better because they don't need to be decompressed, so boot is fast, and a lot more data fits.
I've done some more research and as far as I can tell, it's actually impossible to unmount the root filesystem so you can unmount your save file cleanly. I suppose you could copy the individual files out, but it's painfully slow. I plan to experiment and see if copying the save file back to disk, while it's still mounted, but after all processes have been killed, results in any kind of corruption.
|
Back to top
|
|
 |
raffy
Joined: 25 May 2005 Posts: 4839 Location: Manila
|
Posted: Wed 04 Nov 2009, 16:31 Post subject:
fatdog logrow |
|
Here is rexterd's experiment with Fatdog and logrow:
http://www.puppy2.org/aufs/Fatdog112-logrow-aufs2.iso
The discussion of the aufs ideas by rexterd starts here and continues there..
_________________ Puppy user since Oct 2004. Want FreeOffice? Get the sfs (English only).
|
Back to top
|
|
 |
jemimah

Joined: 26 Aug 2009 Posts: 4309 Location: Tampa, FL
|
Posted: Wed 04 Nov 2009, 22:00 Post subject:
|
|
I posted a shutdown script for people to test. It can't unmount the save file totally, but it seems to be alright since it waits until all the processes that would be writing to it are killed. I've tested it quite a few times and all seems well.
|
Back to top
|
|
 |
flugwelpe

Joined: 15 May 2009 Posts: 29 Location: Vienna, Austria
|
Posted: Mon 07 Dec 2009, 15:09 Post subject:
|
|
hm, regarding the unmounting problem - shouldnt it be possible to switchroot to a minimal system and then the original root doesn't matter?
|
Back to top
|
|
 |
jemimah

Joined: 26 Aug 2009 Posts: 4309 Location: Tampa, FL
|
Posted: Mon 07 Dec 2009, 16:02 Post subject:
|
|
I looked into it, but didn't find much useful documentation. If anyone knows of any similar projects that do that successfully after starting the main OS, I'd love to take a look.
The shutdown script was more of an experiment than anything. I still recommend running without it, and saving important files to USB or mounting a hard drive to save files outside your 2fs file. Running totally in Ram and trusting that the shutdown script is going to work every time, makes me nervous.
|
Back to top
|
|
 |
|