Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Running entirely from RAM been done on various distros such as Slax, DamnSmallLinux, and newer Ubuntu versions, and since I have 8GB it seems reasonable that I could run many distros entirely from RAM (as long as I select one that has the ability).

I would like to do this with OpenELEC (or any distro), and with a further complication: I'm a .NET developer, work and primarily use Windows, which means NTFS and FAT32 are my preferred file systems. Until the day comes if and when Windows can natively read/write ext partitions, this won't change. Ext2fck won't even install in Windows 8, so there's no convincing me of the 'merits' of having drives and partitions in an unreadable format to my daily operation.

There's also things like syslinux, vmlinuz, extlinux and the like that can load .iso files into RAM and effectively bootload them. To add icing on the cake, Windows' bootloader will allow me to add these as options in the native Windows boot menu, which I have done for UBCD 5.11, and will even work for virtual file systems like .vhd, etc.

So, here's my dream:

I want to combine all three into one. I want to take an installed ext2/ext3/ext4 partition, in this case an install of OpenELEC, compress it into an .iso, and create an entry in my boot menu that will either do this directly, or pass it to syslinux or the like that will do the following:

Extract the .iso completely into RAM as an ext2/3/4 partition and boot into that OS in RAM. I'll then mount my NTFS hard drive for the /STORAGE portion of the OpenELEC install with ntfs-3g.

Then, as a bonus, on exit I'd have the system recompress itself to an .iso, and if successful replace the initial .iso thereby persisting my changes across boots (provided the shutdown was successful). It wouldn't have to copy itself from memory, either: it could copy any files/changes it wanted to track (if some were not available) back onto the drive it booted from, if present, then compress that back into an .iso.

Slax, DSL and Ubuntu can boot to RAM and persist changes, so I know it's possible if your OS supports it. I'm wondering if this can be made into a 'works for any distro you want'. Slax saves your changes in an ext directory /slax/changes if it's on an ext partition, or as changes.dat otherwise (for NTFS/FAT32). This solution could work too, I suppose, but would probably require more interaction with the hosted OS to coordinate this than using the .iso.

So, how close can I get?

Are there easy solutions for this already out there? Would I have to write a custom 'SYSLINUX'/'ISOLINUX'/'EXTLINUX'/'VMLINUX? What would be required to make this happen, and if it's possible already how do I get started?

share|improve this question
2  
Have you ever heard of virtualization? (And how do you get along with only 8GB of RAM?) –  Michael Hampton Feb 21 '13 at 7:51
    
I'm not interested in virtualizing a media center distro, and the purpose of the distro I have on the other partition (Slax) is to perform operations on the main partition that require it to be unmounted, such as gparted and provide a quick, lightweight system. (and 8GB is plenty for a laptop) –  Ehryk Feb 21 '13 at 8:18
    
You would have to customize the initramfs of your target distribution as you mount the root filesystem from the initramfs. debian-live based live distributions for example should already support loading the file system into memory, i don't know about other live systems. –  Ulrich Dangel Feb 21 '13 at 8:23
    
I want to interject BEFORE then: boot to SYSLINUX or similar. SYSLINUX would then take an .iso saved on the NTFS/FAT32 drive, which would extract the .iso into memory as an ext2/3/4 file system that houses the distro, then pass control to it. By the time it's gotten to mounting from 'initramfs`, I think it'd already be complaining about not being on an ext2/3/4 partition, correct? –  Ehryk Feb 21 '13 at 8:27
    
You can do anything you want in initramfs. See for example en.gentoo-wiki.com/wiki/Initramfs -- you still need a bootloader capable of loading kernel+initrd in the first place, and very good knowledge about Linux to create an initramfs that actually does what you want it to do. Your ISO approach to things is cumbersome to say the least. I'd rather create a Linux partition, and if you really need read access to files from Windows, rsync them over on shutdown. That'd be a simple init script. –  frostschutz Feb 21 '13 at 23:18
show 4 more comments

1 Answer 1

up vote 1 down vote accepted

There's an EXE installer for Puppy Linux which boots from an .iso on FAT32, NTFS or Linux filesystems (i.e. ext2/ext3/ext4, xfs, etc.) using syslinux and runs in RAM using unionfs/aufs with full access to persistent storage (disk, SD, flashdrive, etc.).

Other ISOs can be mounted, from commandline or script of course, as well as by clicking on them in the included ROX-Filer file manager. One convenient use of this is to selectively access or restore files from an old version instead of having to roll back everything.

The original Puppy Linux distribution ISO, which itself is an usually an ext3/4 filesystem, is kept on the lowest layer of the aufs stack. Changes are recorded in the topmost layer and flushed to disk periodically (configurable) to a "savefile". On boot, the original ISO is loaded to RAM and mounted read-only, then the savefile is loaded and mounted read-only to overlay it and an empty read-write layer mounted for any new changes. To preserve a history of changes, just setup automatic or manual coping of the savefile ISO to an archival directory.

The O/S "layering" of unionfs/aufs along with multi-mounting of filesystems are the core technologies at work here, so if Puppy Linux doesn't work for you, look for other distros using them.

There are quite a number of installation options available for Puppy Linux including a Windows EXE Installer which is a separate package that sets up the Windows boot loader for dual-boot.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.