Gentoo Archives: gentoo-user

From: "Canek Peláez Valdés" <caneko@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Tips for fresh install with GRUB2+RAID1+LVM2
Date: Sun, 17 May 2015 15:43:33
Message-Id: CADPrc81_HtJWC83+ub4UDbKTa5vFGB4jNV30M-dGUHuKhEZehA@mail.gmail.com
In Reply to: Re: [gentoo-user] Tips for fresh install with GRUB2+RAID1+LVM2 by covici@ccs.covici.com
1 On Sun, May 17, 2015 at 10:35 AM, <covici@××××××××××.com> wrote:
2 >
3 > Rich Freeman <rich0@g.o> wrote:
4 >
5 > > Just a few clarifications below.
6 > >
7 > > One thing this discussion is missing is any mention of BIOS / EFI.
8 > > Most of the discussion below seems most relevant to a legacy BIOS
9 > > installation. Many specialized Gentoo install docs, like mdadm+lvm,
10 > > don't really make mention of EFI, or other more recent developments.
11 > > Now that all the docs are on the wiki I'd strongly encourage anybody
12 > > with an interest to improve them. Many seasoned Gentoo users barely
13 > > reference the documentation these days and I think that is part of why
14 > > they've become a bit dated.
15 > >
16 > > A few of the topics below are somewhat controversial, particularly on
17 > > this list. I tried to stick to the facts and indicate where there is
18 > > a difference of opinion. I'd prefer not to rehash all the various
19 > > debates...
20 > >
21 > > On Sun, May 17, 2015 at 9:24 AM, Peter Humphrey <peter@××××××××××××.uk>
22 wrote:
23 > > > On Sunday 17 May 2015 12:48:58 Nuno Magalhães wrote:
24 > > >
25 > > >> (Later i want to get rid of systemd-udev and use eudev instead.)
26 > > >
27 > > > I use openrc, not systemd. It still works well and has less
28 complication - and
29 > > > less typing!
30 > >
31 > > Most people using openrc are also using systemd-udev (and there is a
32 > > good chance you do too). The latter was previously named udev and
33 > > long predates what most people call systemd. Eudev is a fork of udev,
34 > > which comes from after it came under the systemd umbrella, but before
35 > > the name change and a number of changes that were controversial. I
36 > > believe they try to incorporate many of the patches from systemd-udev
37 > > but some default behaviors are different.
38 > >
39 > > In any case, I just wanted to clarify that systemd-udev is not the
40 > > "systemd" you're probably thinking of. In particular, it doesn't
41 > > replace openrc or sysvinit. Systemd-udev largely is concerned with
42 > > populating /dev, and running initialization of hardware when it is
43 > > detected, based on a configurable set of rules.
44 > >
45 > > >
46 > > >> I intend to use XFS for /. Incidentally, if i later decide to "fork
47 > > >> out" /usr (or some other subdirectory) into it's own LV, is it "just"
48 > > >> a mater of copying its contents and updating /etc/fstab? Or should i
49 > > >> just do it now and expand the LVs if later required (especially if i
50 > > >> want to use different filesystems)?
51 > > >
52 > > > I can't help you with XFS. I know that ext4 in an LV in a VG in a PV
53 on RAID1
54 > > > works reliably, even though it does look complex when I write it like
55 that.
56 > >
57 > > As far as LVM and xfs themselves go, you can do what you propose.
58 > >
59 > > However, Gentoo QA policy is that it is expected that /usr is mounted
60 > > early in boot. Various tools can break if it is not. Typically this
61 > > is the responsibility of an initramfs, however you can also use
62 > > scripts that run early during initialization from / which mount it.
63 > > If you just stick /usr in fstab and rely on openrc to mount it for you
64 > > normally, you may or may not have problems.
65 > >
66 > > It has been a long time since I actually used such a system in this
67 > > manner with Gentoo, but the last I saw discussion on it most who used
68 > > this configuration found it usually worked fine, unless you were using
69 > > something like a bluetooth keyboard or other key system component that
70 > > required a lot of userspace tooling to make work. However, as a
71 > > matter of policy you're on your own if you choose not to mount /usr
72 > > early during boot in some way.
73 > >
74 > > The reason it is not supported is that with the rise of things like
75 > > bluetooth the list of dependencies possibly required during early boot
76 > > has grown to the point where we'd end up not even having a /usr before
77 > > long. My sense is that for the most part most maintainers tend to
78 > > respect the traditional definition of / and /usr on Gentoo, and thus
79 > > you can often get away with doing things the traditional way.
80 > > However, the policy does allow us to end debates over things like udev
81 > > rules invoking some userspace tool in /usr and such. Some packages
82 > > more strongly depend on /usr being installed in early boot, and there
83 > > have been suggestions (but nothing concrete) that Gentoo consider
84 > > supporting the /usr-move that other distros have embraced (and that
85 > > would basically get rid of /lib, /bin, and so on).
86 > >
87 > > >
88 > > > Again, legacy grub here. But if you're using an initramfs, from what
89 I've seen
90 > > > you don't need to specify metadata 0.90.
91 > >
92 > > I used to use grub legacy and kernel RAID auto-assembly. As a result
93 > > I was using metadata 0.90.
94 > >
95 > > I found this configuration problematic on rare occasions. There is a
96 > > reason that mdadm changed the metadata, and why most distros don't do
97 > > it this way. (more below)
98 > >
99 > > >
100 > > > Damn. I've just checked and something has renamed my /dev/md7 to
101 > > > /dev/md127. Again. It's just too bad. I shall have to stop it when I
102 get a
103 > > > quiet moment and reassemble it into /dev/md7. Actually, I know what
104 caused
105 > > > it but I didn't notice at the time.
106 > >
107 > > And this was one of the configuration problems I ran into on rare
108 > > occasion. Often booting from a rescue CD or such caused something
109 > > like this to happen.
110 > >
111 > > One of the advantages of using an initramfs is that they can be a lot
112 > > smarter about finding your partitions. You can identify them by UUID
113 > > or label, and not care as much if mdadm or the kernel renames your
114 > > device nodes.
115 > >
116 > > I'd seriously take a look at dracut, though I don't know if it works
117 > > with eudev. It certainly should support openrc, and I know that it
118 > > did back when I was running openrc. It can also mount /usr for you,
119 > > and in fact it should automatically do so. It also respects your
120 > > fstab - it uses its internal logic and the kernel boot line to
121 > > initially find filesystems, but then it reads your /etc/fstab and
122 > > remounts everything as you define it there just in case something has
123 > > changed since the last time you built the initramfs/etc. You can
124 > > define your own modules for it which makes it reasonably easy to get
125 > > it to do anything at all during early boot, and it doesn't require
126 > > anything to be built static (it finds required shared objects anywhere
127 > > on the filesystem and includes them in the initramfs). It can also
128 > > give you a rescue shell if something goes wrong, and depending on your
129 > > settings you can make that rescue shell reasonably well-featured
130 > > (using either dash or bash as you prefer inside, and I imagine you
131 > > could tell it to install the other on the side). A while ago I needed
132 > > to run some btrfs tools that aren't in dracut by default and it was
133 > > trivial to tell dracut to include them, and I forced a shell on next
134 > > boot which gave me the latest tools and kernel without having to build
135 > > a rescue CD with them, and a bash shell to run them from.
136 > >
137 > > It certainly isn't necessary to use an initramfs to use Gentoo, and I
138 > > used to be among the more minimalist crowd that avoided them.
139 > > However, once I took the time to examine dracut it went from being a
140 > > blob that looked unnecessary to a tool that is often useful.
141 >
142 > Last time I tried to use dracut with openrc, it failed, I can't remember
143 > exactly what happened, I think udev did hang, but its been a while since
144 > this happened. Dracut uses systemd internally, so maybe this is part of
145 > the problem.
146
147 Dracut only uses systemd optionally and (AFAIR) not by default. If you
148 don't specify it, dracut will use its own scripts as init.
149
150 Regards.
151 --
152 Canek Peláez Valdés
153 Profesor de asignatura, Facultad de Ciencias
154 Universidad Nacional Autónoma de México