Not logged in
Log in now
Create an account
Subscribe to LWN
An unexpected perf feature
LWN.net Weekly Edition for May 16, 2013
A look at the PyPy 2.0 release
PostgreSQL 9.3 beta: Federated databases and more
LWN.net Weekly Edition for May 9, 2013
The nice thing is that you can both eat the cake and have it too, as /usr on a separate filesystem *is* still supported, *provided* you mount it in your initramfs.
That way you get *all* the benefits of a separate /usr partition, without *any* of it's drawbacks, at the small cost of maintaining an initramfs (which your distro tools will likely do for you).
separate /usr, advantages & disadvantages
Posted Nov 27, 2012 12:36 UTC (Tue) by pjm (subscriber, #2080)
What's initramfs do now?
Posted Dec 4, 2012 16:38 UTC (Tue) by alex (subscriber, #1355)
Personally I build my kernel with all the bits it needs to mount rootfs from the start so I'm not sure why I would want or need an initramfs?
Posted Dec 5, 2012 0:28 UTC (Wed) by nix (subscriber, #2304)
I've seen initramfses that never exec any real init at all, but run all of userspace from the initramfs (generally a fairly small userspace). I've even seen initramfses that compiled appropriate modules from source and then modprobed them, to make sure they never got out of synch with the running kernel.
initramfses are really powerful. I don't know why people have such a resistance to them. Sure, they're tricky -- the need to wipe the rootfs while overmounting the real /, and the tendency to use a non-glibc libc, makes sure of that -- but they're not actually *scary*. And they're certainly not ugly. They add enormous flexibility to a part of the boot process that used to be completely nonswappable, and particularly if you link the initramfs into the kernel image they can add a lot of robustness, giving you a single kernel image with rescue, recovery, and root-filesystem-finding tools built in and inseparable no matter what weird breakage you do to your filesytem. And they do this without necessarily adding much complexity: my /init is only 172 lines of rarely-changing shell but gives me a rescue shell and md, LVM and NBD booting for all of that.
It's true that dracut is complicated, but it's generic -- complexity is in the nature of a generic solution in a problem space as intricate as this (there are endless ways to find the root filesystem and dracut has to handle all of them). Special-purpose initramfses, or initramfses built for your own use, don't actually need to be complicated or brittle.
Posted Dec 5, 2012 17:03 UTC (Wed) by dlang (✭ supporter ✭, #313)
you answer this question in the next sentence
> Sure, they're tricky
They are powerful, but if you don't need that power, why pay with the complexity?
This 'extra' copy of things gives you one more place that software can get out of sync (a different version of software on the initramfs than on your main system for example
simple is better, if you don't need a layer of complexity for your systems, it's good to not have it
Posted Dec 5, 2012 17:11 UTC (Wed) by alex (subscriber, #1355)
cp arch/x86/boot/bzImage /boot/kernel-2.6-linus
Why would I want more complexity to test new kernels?
Posted Dec 5, 2012 20:53 UTC (Wed) by nix (subscriber, #2304)
make install modules_install
which I think beats yours by one line. :)
(Yet again: initramfses *do not* need to be installed in separate files -- distros just do that because it makes it easier to ship prepackaged kernels. If you link them into the kernel image, they don't make it harder to test kernels at all: the installed kernel is exactly one file, just as before. A bloody good thing too given the amount of bisection I seem to have been doing recently...)
Posted Dec 5, 2012 21:14 UTC (Wed) by dlang (✭ supporter ✭, #313)
Posted Dec 5, 2012 22:17 UTC (Wed) by nix (subscriber, #2304)
Posted Dec 5, 2012 23:02 UTC (Wed) by dlang (✭ supporter ✭, #313)
Posted Dec 8, 2012 19:10 UTC (Sat) by nix (subscriber, #2304)
Posted Dec 5, 2012 20:51 UTC (Wed) by nix (subscriber, #2304)
It lets you customize things that are otherwise uncustomizable -- personally I consider this a good thing. Obviously it's not essential, but it's not some monstrous terrible hugely complex destabilizing thing either. The smallest possible /init is probably less than ten lines of shell script, and most of that is getting a useful /dev to do a mount from.
Posted Dec 5, 2012 22:01 UTC (Wed) by jimparis (subscriber, #38647)
How does that keep things in sync? When you update the software on your system, you need to remember to rebuild the initramfs too. Likewise with changing any configuration files that are found in both, like /etc/mdadm/mdadm.conf. I've been bitten by forgetting to run "update-initramfs -u" after changing that file.
Posted Dec 5, 2012 22:19 UTC (Wed) by nix (subscriber, #2304)
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds