Gentoo Archives: gentoo-doc

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-doc@l.g.o
Subject: [gentoo-doc] Re: RAID install document
Date: Wed, 15 Feb 2012 09:04:25
Message-Id: pan.2012.02.15.08.13.23@cox.net
In Reply to: [gentoo-doc] RAID install document by wireless
1 wireless posted on Tue, 14 Feb 2012 12:48:04 -0500 as excerpted:
2
3 > Hello,
4 >
5 > I'm trying to build a simple (all) raid 1 workstation. Just
6 > boot/root/swap like what is found in the handbook.
7 > Is this the best document to follow:
8 >
9 > http://en.gentoo-wiki.com/wiki/RAID/Software
10 >
11 > Since grub2 is now defacto and drive sizes are routinely over 2T, I
12 > guess that Disk-labels (UUIDs), fstab, gpt and grub2 should all be used
13 > to 'future proof' installations?
14 >
15 > There is only a snippet in the handbook and it couches these and other
16 > related issues around multilib.
17 >
18 > Any better, more complete documents are keenly appreciated.
19
20 There's no official gentoo grub2 docs at this point, and the existing doc
21 (the link given in a grub2 postinstall einfo) is /seriously/ insufficient/
22 incomplete. That's one of the big reasons grub2 is still hard-masked,
23 not even ~arch yet.
24
25 If you can get your grub2 info elsewhere, however, or know it reasonably
26 well from experience on other distributions, you'll know it's great for
27 gpt even on BIOS systems. (That's one of the bits missing in that grub2
28 doc, BTW, it mentions EFI and mbr-bios but not gpt-bios.) Of course,
29 it's also great for md/raid.
30
31 I don't know about the status of gentoo gpt documentation, but gptfdisk
32 is a great fdisk for gpt, and it has very good documentation on its
33 homepage. I'm a great booster of both gpt and gptfdisk aka gdisk for a
34 number of reasons, including that gpt does away with the primary/logical
35 partition hassle, that it is *FAR* more reliable due to checksumming and
36 the second partition copy, the gpt-labels (as opposed to filesystem
37 labels, FWIW I use both but would prefer gpt labels as soon as mount,
38 etc, learns to work with them), and the dedicated BIOS and EFI system
39 partitions.
40
41 It's worth noting that upgrading to grub2 was hugely easier for me
42 because I was already using gpt and had set aside a dedicated BIOS
43 partition (also an EFI partition, for the day I upgrade systems again).
44
45 The caveat with grub2 here was the absolutely ridiculous number of calls
46 to grub2-probe that the default grub2-mkconfig script has with apparently
47 no caching, each one taking ~10 seconds on my multi-disk system, with the
48 total script therefore taking something like five minutes to run (based
49 on a bit of profiling I did, the script other than the grub2-probe calls
50 takes well under 10 seconds, so it's nearly all due to the repeated grub2-
51 probe calls), more than a kernel build from clean!
52
53 As a result, I INSTALL_MASKED grub2-mkconfig and /etc/grub.d so they'd
54 have absolutely no chance of being run as they don't appear on the
55 system, then learned manual grub.cfg configuration and setup my own
56 configuration by hand. That's the only practical solution for anyone who
57 upgrades their kernel at all frequently (I build from linus-mainline
58 git), at least for systems with multiple drives and mounts to be probed.
59 As such and because the drive scanning order remains relatively stable
60 here (and the parameter can be changed in grub "live" if I need to), I
61 chose to stick with the relatively simple device names (not labels) for
62 grub2.
63
64 Here, I use md 0.90 metadata and no initr*. I don't autodetect, however,
65 as I have multiple md/raid devices and I only want the one containing the
66 rootfs autoassembled, with userspace assembling the others I want
67 activated, later. Instead, I build in a kernel command line that
68 includes and md= parameter and disable autodetect. I'm not entirely sure
69 if that could be done with 1.x metadata or not, since I'm feeding it the
70 devices to assemble into the raid instead of using autodetect.
71
72 For /boot, depending on the number of spindles you're running, you may
73 wish to split it down the middle /boot and a backup /boot, or setup
74 independent /boot partitions on each one (if only 2-3 spindles). That
75 way, you can upgrade grub or install new kernels on one (presumably the
76 working /boot not the backup(s)), without risking damage to the others
77 until you've tested booting the first upgraded one. Once it is known to
78 boot the upgrade correctly, you can update the others. For people like
79 me that test git kernels, that also allows me to only install them to the
80 normal /boot. I only update the backup(s) when a release kernel comes
81 out and I've tested it on the working /boot, then deleted all the pre-
82 release versions once the release is tested to boot.
83
84 That also allows you, if you so choose, to follow the official gentoo
85 documentation a bit closer, installing grub-legacy first, to one /boot,
86 then unmasking and installing grub2 to a second, to experiment with,
87 switching in BIOS which one boots while testing, before replacing the
88 documented grub-legacy that was installed to the first one only after
89 you're comfortable with how grub2 is working and setup on the others.
90
91 Talking about which... the below link is the official quick-start
92 installation guide for gentoo on lvm2 on md/raid. I'm not personally
93 much for lvm2 -- the additional layer was too much for me to understand
94 well enough to be confident I could manage a proper recovery if I needed
95 to and it's no longer all that necessary since md/raid devices can be
96 partitioned like any normal block device these days -- but if you're
97 running a desktop such as gnome or kde and want the automounting to work
98 well, you'll still want to configure the device-mapper kernel options and
99 need to install the lvm2 package, which contains the device-mapper
100 userspace needed by udisks for automount handling, etc. You'd just not
101 create the lvm2 volumes (and could wait until it's pulled in as a udisks
102 dependency to merge lvm2 if desired).
103
104 Of course, this still documents grub-legacy, but as I mentioned, you can
105 either split up your /boot and install grub-legacy first, following the
106 official documentation reasonably closely, then install grub2 later, when
107 you have time to experiment with it, or ignore the grub bit too, and do
108 the grub2 thing right off, if you're comfortable enough with it already
109 that you can handle the lack of gentoo specific documentation for it.
110
111 http://www.gentoo.org/doc/en/gentoo-x86+raid+lvm2-quickinstall.xml
112
113 That's likely more than I should have written for the documentation list,
114 but it's topical in that it does represent the state of things, I guess.
115
116 Meanwhile, feel free to ignore the "list replies preferred" bit in the sig
117 and contact me directly, if you've more questions, since it should be
118 quite apparent by now that I have quite some interest and some experience
119 in this area. If you do contact me directly, please mention whether
120 amd64/x86/whatever (amd64/nomultilib, here), whether you're targeting
121 stable or ~arch and how comfortable you are with unmasking stuff like
122 grub2, etc, and reading other documentation, the number of spindles
123 you're raiding and metadata version, the desktop you'll be installing if
124 any and whether you care about the automount stuff (fwiw I'm a kde guy,
125 and have udisks and lvm2 installed as dependencies but don't have device-
126 mapper on in the kernel as I don't particularly care for automounting),
127 whether you're running an initr* (I don't and know little about them),
128 etc, as that could well save a few rounds of email-ping-pong. =:^)
129
130 --
131 Duncan - List replies preferred. No HTML msgs.
132 "Every nonfree program has a lord, a master --
133 and if you use the program, he is your master." Richard Stallman