Gentoo Archives: gentoo-amd64

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-amd64@l.g.o
Subject: [gentoo-amd64] Re: genkernel changes
Date: Sat, 20 Dec 2008 00:05:41
Message-Id: pan.2008.12.20.00.05.26@cox.net
In Reply to: [gentoo-amd64] genkernel changes by Wil Reichert
1 "Wil Reichert" <wil.reichert@×××××.com> posted
2 7a329d910812190750n606b52efl5c3a8cb3cb0560ad@××××××××××.com, excerpted
3 below, on Fri, 19 Dec 2008 07:50:34 -0800:
4
5 > I build my own kernels but since my / partition is lvm I use genkernel
6 > to create an initrd. Previously 'genkernel --lvm initrd' did what I
7 > wanted but it seems that the since genkernel-3.4.10.902 thats no longer
8 > the case. Reading the man page it seems that the initrd parameter has
9 > been replaced by initramfs. However, when I attempt to run it with that
10 > I get
11 >
12 > matter boot # genkernel --lvm initramfs Error: Unknown option
13 > 'initramfs'!
14 >
15 > I can easily roll back to a previous version of genkernel, I'm just
16 > wondering if genkernel is broken or I'm just doing something wrong?
17
18 I do /not/ use either genkernel or an initramfs/initrd, so this is from
19 various reading I've done and I have no idea how accurate it might or
20 might not be. Never-the-less, it's likely the case based on what I've
21 come across on the subject.
22
23 Formerly, the kernel used a separate "init-ram-disk" aka initrd (init-r-
24 d). Now, the kernel uses (if enabled) an "init-file-system", directly
25 appended to the kernel itself, not a separate file.
26
27 Therefore, what I'd guess is happening is that there's no separate
28 command to make it in the new genkernel, since it's not a separate file.
29 Rather, it probably reads the associated kernel option as to whether to
30 create it or not, and then does so before generating the final kernel,
31 finally appending the compressed initramfs to the already created kernel.
32
33 Far be it from me to tell you how to arrange your system, and it sounds
34 like it's a bit late for you anyway, but this is something to keep in
35 mind for those just setting up. While I'm running both LVM2 and kernel/
36 md RAID (0,1 and 6, 0 for speed on stuff like ccache and the gentoo tree
37 where redundancy isn't needed, 1 for /boot since that's all grub
38 understands, and 6 for the main system), the fact that LVM2 requires
39 userspace help and therefore an initrd if the / filesystem is to be
40 placed on it, while with RAID the necessary info can be auto-detected or
41 passed on the command line, was the reason I chose to go with partitioned
42 RAID for / (and a backup I call rootbak) instead of putting it on LVM2.
43 /home and my media and mail and news partitions, etc, with their backups,
44 are all on LVM2, but / and rootbak are directly on partitioned RAID-6.
45
46 Also, / (and rootbak) include /usr and /var as well (except for
47 /usr/local and /var/log, with /var/tmp being a symlink to /tmp, which is
48 tmpfs), so the full installed system along with the portage data in
49 /var/db and /var/lib/portage, are all on the same volume and managed
50 together, thus kept in sync. This is because I had some major headaches
51 in a disaster recovery scenario where the /, /var, and /usr partitions
52 weren't in sync with each other, so I didn't know /what/ package versions
53 I actually had on disk. Keep it all on the same volume and it stays in
54 sync, if I go to rootbak, tho it may be dated, it too is in sync.
55
56 Thus I can pass the necessary parameters to assemble the partitioned-
57 RAID-6 upon which the / filesystem is located directly to the kernel, and
58 don't need an initrd/initramfs. Later, as the system boots normally, it
59 loads the raid and lvm services (baselayout-2 with openrc treats them as
60 full services, not the "addons" baselayout-1 used, and loads them as
61 such), bringing up the rest of the RAID devices, and then LVM on top of
62 the RAID-6 (the RAID-0,1 only have a single partition/volume each anyway,
63 so no need for LVM there). I thus entirely avoid the complexity of an
64 initramfs/initrd.
65
66 As I said, whether something like this may or may not have been better
67 for you, it's kind of late now that you're / is on LVM, but it's
68 something others just setting up should at least evaluate as an option,
69 as they plan out their system.
70
71 One other comment for those considering this. I only created my main /
72 and a single rootbak backup for it. If I had it to do over, I'd create
73 two backup / images, thus handling the case of tragedy striking just as I
74 was updating the first backup and the resultant loss of both it and the
75 working /. That should be a rather rare event, but were I prepared for
76 it I'd certainly have rather better peace of mind now.
77
78 --
79 Duncan - List replies preferred. No HTML msgs.
80 "Every nonfree program has a lord, a master --
81 and if you use the program, he is your master." Richard Stallman

Replies

Subject Author
Re: [gentoo-amd64] Re: genkernel changes Wil Reichert <wil.reichert@×××××.com>