On Tue, Aug 20, 2013 at 7:32 PM, Walter Dnes <waltd...@waltdnes.org> wrote: > On Tue, Aug 20, 2013 at 01:54:26AM -0500, Canek Peláez Valdés wrote >> >> No, the kernel has a mini filesystem (doesn't matter which directory >> structure has inside), and it executes the init script (or binary >> program) in the root of the initramfs. This init program/script is the >> responsible for mounting the real root and other partitions, and >> handling control over to systemd (or OpenRC, or whatever). >> >> Dracut is able to create an initramfs (with the systemd Dracut module) >> that executes systemd inside the initramfs, which mounts /usr, >> switches to the real root, and gives control to the "real" systemd >> instance. At shutdown, the reverse happens: the "real" systemd >> surrenders control to the initramfs systemd, it umounts everything, >> and finish the shutdow process. > > A possibly stupid question from a non-user of initramfs... why not > simply treat the initramfs as "the real system"? This would avoid the > hand-off to a second fs at start-up, and the reverse process at > shutdown.
If I understand correctly, because it's a ramfs, as its name implies (it lives on your RAM). You don't want it to hold all your system, only the necessary parts to mount the filesystems necessary to boot. > There would be no need to worry about keeping files synced in > 2 different locations, because there would only be one location. The worry about falling out of sync, although justified, I think it's a little overreacted; even for things like LVM2 and NFS, how many times changes the metadata or format used by different versions? Normal filesystems present no problems: almost all of them are future-proof. And (as Allan suggested) you can (easily and automagically) regenerate the initramfs everytime sometimes inside it changes. > If > necessary, one could use UnionFS http://en.wikipedia.org/wiki/Unionfs to > make the hard drive and userspace stuff all look like part of the > initramfs. No unionfs has been accepted in the mainline kernel, although several have been proposed. It's a hard problem, and nothing has satisfied the kernel devs until now. The initramfs has several advantages: it's supported directly by the kernel, it works the same from embedded systems to big iron servers, and it just works. I just installed two systems (a server and a desktop) to systemd directly, and Dracut just worked. And I like that now my kernels have *EVERYTHING* as a module (that can be compiled as module). Even the filesystems! Regards. -- Canek Peláez Valdés Posgrado en Ciencia e Ingeniería de la Computación Universidad Nacional Autónoma de México