You should be able to do the same thing a live CD does. The ones I understand (maybe all of them) use aufs as the key component that lets everything else write to the file system without overwriting any of the original content.
There are several details you need to think through before setting it up. I only know the concepts, not the specifics, so I can only tell you what to ask yourself before setting this up, not how to use the answers.
When does the rule of not writing to the hard disk start and how strict is it?
Is the starting point an existing system you can't modify? (Which I think would mean you need to boot from something else). Or can you add everything you will need for this project to a disk based system before starting the rule of no writes to disk?
What about the swap partition on the disk? Can you use that or is it also off limits?
Using a tmpfs backed by the swap partition as the front side of aufs would give you more flexibility than being really limited to ram. But if you have enough ram, you could manage with no swap and nothing other than ram for the ram disk or tmpfs (I'm not sure which is better if you have no swap).
Quote:
Originally Posted by maslik
In my opinion the only way to go will be to copy whole filesystem to a ramdisk on startup and then mount it. Probably there's a better solution, but this is the only possibility I can imagine.
|
The advantage of aufs over that plan is that the aufs automatically copies each file from disk to ram
only when you modify that file. It starts faster because it copies less. It fits in far less ram because it copies less.