Gentoo Archives: gentoo-amd64

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

Replies

Subject Author
[gentoo-amd64] Re: genkernel changes Duncan <1i5t5.duncan@×××.net>