You are not logged in.

#1 2013-08-09 19:39:23

Registered: 2005-02-08
Posts: 36

Run entire system in vmlinuz + initrd only

I would like to create a live system that would run entirely from memory. Is it possible to achieve this using only kernel + initrd?

My root filesystem is approx. 1.5 GB of data, which is currently sitting on /dev/sda1. I was thinking something like this:
1. create a /init script that would somehow start systemd directly
2. pack entire root filesystem using cpio + gzip
3. use the resulting file as initrd in boot loader (syslinux, grub, pxelinux...)

At least in theory, this should be possible, given the sufficient RAM. However...
- would the initrd be writable?
- what modifications would need to be made to the "ordinary" root filesystem so that it would work as initrd?


#2 2013-08-09 20:24:51

From: .nz
Registered: 2009-05-09
Posts: 26,652

Re: Run entire system in vmlinuz + initrd only

Moving to GNU/Linux  discussion...

Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438


#3 2013-08-09 22:01:41

From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 717

Re: Run entire system in vmlinuz + initrd only

Yes, is possible.

1) Just symlink /usr/lib/systemd/systemd to /init wink
2) Right.
3) Right.

Two conditions:
* You need at least sizeof(compressed initrd) + sizeof (uncompressed initrd) + sizeof(memory usage for unpack gzip) of RAM.
* If image if bigger than about 800M you need a kernel running in 64-bit

* Initrd (or more appropiate name initramfs) is uncompressed on rootfs (a special case of tmpfs) so this space if writeable.
* The symlink only and remove uneeded entries from fstab.


Board footer

Powered by FluxBB