Gentoo Archives: gentoo-user

From: Rich Freeman <rich0@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] RAID-1 on secondary disks how?
Date: Tue, 29 Jan 2019 19:01:38
Message-Id: CAGfcS_k0Fqc9Xbvx7rNec3nH055wtrHhPjOEQFoZkKvkmr_1Kw@mail.gmail.com
In Reply to: Re: [gentoo-user] RAID-1 on secondary disks how? by Alan Mackenzie
1 On Tue, Jan 29, 2019 at 1:39 PM Alan Mackenzie <acm@×××.de> wrote:
2 >
3 > On Tue, Jan 29, 2019 at 12:58:38 -0500, Rich Freeman wrote:
4 > > Can't say I've tried it recently, but I'd be shocked if it changed
5 > > much. The linux kernel guys generally consider this somewhat
6 > > deprecated behavior, and prefer that users use an initramfs for this
7 > > sort of thing. It is exactly the sort of problem an initramfs was
8 > > created to fix.
9 >
10 > An initramfs is conceptually so ugly that I view it as a workaround, not
11 > a fix, to whatever problem it's applied to.
12
13 Not sure why you would think this. It is just a cpio archive of a
14 root filesystem that the kernel runs as a generic bootstrap.
15
16 This means that your bootstrap for initializing your root and
17 everything else can use any userspace tool that exists for linux.
18
19 A similar concept lies at the heart of coreboot - using a generic
20 kernel/userpace as a firmware bootloader making it far more flexible.
21
22 An initramfs is basically just a fairly compact linux distro. It
23 works the same as any distro. The kernel runs init, and init does its
24 thing. By convention that init will mount the real root and then exec
25 the init inside, but it doesn't have to work that way. Heck, you can
26 run a system with nothing but an initramfs and no other root
27 filesystem.
28
29 > It would surely be a bug if the kernel were capable of manipulating RAIDs, but not of initialising
30 > and mounting them.
31
32 Linus would disagree with you there, and has said as much publicly.
33 He does not consider initialization to be the responsibility of kernel
34 space long-term, and prefers that this happen in user-space.
35
36 Some of the lvm and mdadm support remains for legacy reasons, but you
37 probably won't see initialization of newer volume/etc managers
38 supported directly in the kernel.
39
40 > > Honestly, I'd just bite the bullet and use dracut if you want your OS
41 > > on RAID/etc. It is basically a one-liner at this point to install and
42 > > a relatively small tweak to your GRUB config (automatic if using
43 > > mkconfig). Dracut will respect your mdadm.conf, and just about all
44 > > your other config info in /etc. The only gotcha is rebuilding your
45 > > initramfs if it drastically changes (but, drastically changing your
46 > > root filesystem is something that requires care anyway).
47 >
48 > Well, at the moment my system's not broken, hence doesn't need fixing.
49 > Last time I looked at Dracut, it would only work in a kernel built with
50 > modules enabled, ruling out my setup.
51
52 That is news to me. Obviously it needs whatever drivers it needs, but
53 I don't see why it would care if they are built in-kernel vs
54 in-module.
55
56 > Also, without putting in a LOT of time and study, dracut is a massive,
57 > opaque mystery. I've got a pretty good mental picture of how my system
58 > works, and introducing an initramfs would degrade that picture
59 > enormously. That means if any problems happened with the initramfs, I'd
60 > be faced with many days study to get to grips with it.
61
62 Sure, if you want to know exactly how it works that is true, but the
63 same is true of openrc or any other piece of software on your system.
64
65 Dracut is highly modular and phase/hook-driven so it isn't too hard to
66 grok. Most of it is just bash/dash scripts.
67
68 --
69 Rich

Replies

Subject Author
Re: [gentoo-user] RAID-1 on secondary disks how? Grant Taylor <gtaylor@×××××××××××××××××××××.net>
Re: [gentoo-user] RAID-1 on secondary disks how? Wol's lists <antlists@××××××××××××.uk>