Gentoo Archives: gentoo-user

From: Alan Mackenzie <acm@×××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] RAID-1 on secondary disks how?
Date: Tue, 29 Jan 2019 18:40:24
Message-Id: 20190129183921.GB5890@ACM
In Reply to: Re: [gentoo-user] RAID-1 on secondary disks how? by Rich Freeman
1 Hello, Rich.
2
3 On Tue, Jan 29, 2019 at 12:58:38 -0500, Rich Freeman wrote:
4 > On Tue, Jan 29, 2019 at 11:48 AM Alan Mackenzie <acm@×××.de> wrote:
5
6 > > On Tue, Jan 29, 2019 at 09:32:19 -0700, Grant Taylor wrote:
7 > > > On 01/29/2019 09:08 AM, Peter Humphrey wrote:
8 > > > > I'd rather not have to create an initramfs if I can avoid it. Would it
9 > > > > be sensible to start the raid volume by putting an mdadm --assemble
10 > > > > command into, say, /etc/local.d/raid.start? The machine doesn't boot
11 > > > > from /dev/md0.
12
13
14 > > For this, the kernel needs to be able to assemble the drives into the
15 > > raid at booting up time, and for that you need version 0.90 metadata.
16 > > (Or, at least, you did back in 2017.)
17
18
19 > Can't say I've tried it recently, but I'd be shocked if it changed
20 > much. The linux kernel guys generally consider this somewhat
21 > deprecated behavior, and prefer that users use an initramfs for this
22 > sort of thing. It is exactly the sort of problem an initramfs was
23 > created to fix.
24
25 An initramfs is conceptually so ugly that I view it as a workaround, not
26 a fix, to whatever problem it's applied to. It would surely be a bug if
27 the kernel were capable of manipulating RAIDs, but not of initialising
28 and mounting them.
29
30 > Honestly, I'd just bite the bullet and use dracut if you want your OS
31 > on RAID/etc. It is basically a one-liner at this point to install and
32 > a relatively small tweak to your GRUB config (automatic if using
33 > mkconfig). Dracut will respect your mdadm.conf, and just about all
34 > your other config info in /etc. The only gotcha is rebuilding your
35 > initramfs if it drastically changes (but, drastically changing your
36 > root filesystem is something that requires care anyway).
37
38 Well, at the moment my system's not broken, hence doesn't need fixing.
39 Last time I looked at Dracut, it would only work in a kernel built with
40 modules enabled, ruling out my setup.
41
42 Also, without putting in a LOT of time and study, dracut is a massive,
43 opaque mystery. I've got a pretty good mental picture of how my system
44 works, and introducing an initramfs would degrade that picture
45 enormously. That means if any problems happened with the initramfs, I'd
46 be faced with many days study to get to grips with it.
47
48 > But, if you're not using an initramfs you can get the kernel to handle
49 > this. Just don't be surprised when it changes your device name or
50 > whatever.
51
52 The kernel seems to leave it alone. Any Gentoo installation CD I've
53 used has corrupted the setup, changing all the names to /dev/md127,
54 /dev/md126, ...., leaving the victim PC unbootable. Hence my root
55 partition is /dev/md127, despite me originally creating it as something
56 like /dev/md4.
57
58 > --
59 > Rich
60
61 --
62 Alan Mackenzie (Nuremberg, Germany).

Replies

Subject Author
Re: [gentoo-user] RAID-1 on secondary disks how? Rich Freeman <rich0@g.o>