Gentoo Archives: gentoo-amd64

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-amd64@l.g.o
Subject: [gentoo-amd64] Re: Can initrd and/or RAID be disabled at boot?
Date: Thu, 27 Jun 2013 18:53:50
Message-Id: pan$1c1f0$15d94a4c$dd2793d$9fc594cf@cox.net
In Reply to: [gentoo-amd64] Can initrd and/or RAID be disabled at boot? by Mark Knecht
1 Mark Knecht posted on Tue, 25 Jun 2013 15:51:14 -0700 as excerpted:
2
3 > This is related to my thread from a few days ago about the
4 > disappointing speed of my RAID6 root partition. The goal here is to get
5 > the machine booting from an SSD so that I can free up my five hard
6 > drives to play with.
7
8 FWIW, this post covers a lot of ground, too much I think to really cover
9 in one post. Which is why I've delayed replying until now. I expect
10 I'll punt on some topics this first time thru, but we'll see how it
11 goes...
12
13 > SHORT SUMMATION: I've tried noninitrd and noraid in the kernel line of
14 > grub.conf but I keep booting from old RAID instead of the new SSD.
15 > What am I doing wrong?
16 >
17 > What I've done so far:
18 >
19 > 1) I've removed everything relatively non-essential from the HDD-based
20 > RAID6. It's still a lot of data (40GB) but my Windows VMs are moved to
21 > an external USB drive as is all the video content which is on a second
22 > USB drive so the remaining size is pretty manageable.
23
24 OK...
25
26 > 2) In looking around for ways to get / copied to the SDD I ran across
27 > this Arch Linux page called "Full System Backup with rsync":
28 >
29 > https://wiki.archlinux.org/index.php/Full_System_Backup_with_rsync
30
31 > Basically it boiled down to just a straight-forward rsync command, but
32 > what I liked about the description what that it can be done on a live
33 > system. The command in the page is
34 >
35 > rsync -aAXv /* /path/to/backup/folder
36 > --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost
37 +found}
38 >
39 > which I have modified to
40 >
41 > rsync -avx /* /path/to/backup/folder
42 > --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost
43 +found}
44 >
45 > because I don't use (AFAICT) any of the ACL stuff and the command simply
46 > wouldn't do anything.
47
48 For ACL you're probably correct. But you might be using xattributes. Do
49 you have any of the following USE flags turned on: caps xattr filecaps ?
50 (Without going into an explanation of the specific distinction between
51 the USE flags above, particularly caps and filecaps.) What filesystem do
52 you use on / (and /usr if separate), and if appropriate, are the extended
53 attributes and security label kernel options enabled for it?
54
55 For example, here I have ext4, reiserfs and btrfs enabled and use or have
56 used them on my various root filesystems, as well as tmpfs with the
57 appropriate options since I have PORTAGE_TMPDIR pointed at tmpfs (and
58 also devtmpfs needs some of the options):
59
60 zgrep 'REISER\|EXT4\|TMPFS\|BTRFS' /proc/config.gz
61
62 CONFIG_DEVTMPFS=y
63 CONFIG_DEVTMPFS_MOUNT=y
64 CONFIG_EXT4_FS=y
65 CONFIG_EXT4_USE_FOR_EXT23=y
66 # CONFIG_EXT4_FS_POSIX_ACL is not set
67 CONFIG_EXT4_FS_SECURITY=y
68 # CONFIG_EXT4_DEBUG is not set
69 CONFIG_REISERFS_FS=y
70 # CONFIG_REISERFS_CHECK is not set
71 # CONFIG_REISERFS_PROC_INFO is not set
72 CONFIG_REISERFS_FS_XATTR=y
73 # CONFIG_REISERFS_FS_POSIX_ACL is not set
74 CONFIG_REISERFS_FS_SECURITY=y
75 CONFIG_BTRFS_FS=y
76 # CONFIG_BTRFS_FS_POSIX_ACL is not set
77 # CONFIG_BTRFS_FS_CHECK_INTEGRITY is not set
78 # CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set
79 # CONFIG_BTRFS_DEBUG is not set
80 CONFIG_TMPFS=y
81 CONFIG_TMPFS_POSIX_ACL=y
82 CONFIG_TMPFS_XATTR=y
83
84 tmpfs only has ACL on for devtmpfs (and I'm not sure I need that, but to
85 avoid both security issues and broken device functionality...). The
86 others don't have that on, but where appropriate, they have XATTR on, as
87 well as FS_SECURITY. (Again, this is really only surface coverage,
88 here. TBH I don't fully understand the depths myself, certainly not well
89 enough to be comfortable discussing it in depth, tho I'm reasonably sure
90 I have the options I want enabled, here.)
91
92 The deal is that file capacities in one form or another can be used to
93 avoid having to SETUID root various executables that would otherwise need
94 it, which is a good thing since that reduces the security vulnerability
95 window that SETUID root otherwise opens, often necessarily.
96
97 And these file capacities are implemented using xattrs. So if your
98 system is setup to use them, a good thing from a security perspective but
99 somewhat complicated by the kernel config requirements in addition to the
100 USE flags, you'll probably want to use the -X option, tho you should
101 still be safe without -A (tho it shouldn't hurt).
102
103 However, the penalty for NOT using -X, provided you're not using xattrs
104 for anything else, should simply be that you'll need to become root to
105 run some commands that would otherwise be runnable without root (with the
106 corresponding open security window, should it be possible for a cracker
107 to get those commands running as root to do something unintended). So
108 the potential cost of getting it wrong is actually quite limited, unless
109 you happen to be the target of a cracker with both good timing and a
110 reasonable skill level, as well.
111
112 And of course if you have only part of the pieces above enabled, say the
113 appropriate filesystem options in the kernel but not the USE flags, or
114 the reverse, then you're not covered and the rsync options won't matter
115 in any case.
116
117 But the -AX options shouldn't do any harm in any case, so here I'd have
118 just left them on, making it -avxAX.
119
120
121 Meanwhile, while I always see people worried about copying a live
122 filesystem around, I've never had a problem here simply doing a
123 cp --archive, or the equivalent in mc (midnight commander, ncurses-based
124 commander-style dual-pane file manager).
125
126 What I do for root is use a root-bind script:
127
128 #!/bin/bash
129 me=${0##*/}
130
131 case $me in
132 rootbind) mount --bind / /mnt/rootbind;;
133 rootbindu) umount /mnt/rootbind;;
134 *) echo rootbind: bad call; exit 1;;
135 esac
136
137 (That allows the script to be called rootbind, with a symlink to it
138 called rootbindu, that does the corresponding umount.)
139
140 What a bind-mount does is mount an already mounted filesystem at a
141 different mountpoint. In particular, it does NOT do recursive mounts
142 (tho there's another mount option that copies the full mount tree, it's
143 just not what I want here), so what I'm using it for here is to get a
144 "clean" copy of the rootfs, WITHOUT other filesystems such as /dev and
145 /home mounted on top.
146
147 Then I can do a nice clean cp --archive of my rootfs to a (normally
148 freshly formated, so cp and rsync would accomplish the same thing) backup
149 root, and that's what I've used for backup, for years.
150
151 And I test those backups too, and occasionally reboot to the backup and
152 do a clean mkfs and copy back from the backup to the normally working
153 copy too, just to take care of fragmentation and any possibility of
154 unresolved filesystem damage or bitrot that might have set in, as well as
155 ensuring that I can switch to the backups for operational use by actually
156 doing so. So I know the technique works for me.
157
158 Now if I was running some active database that was continuing to update
159 as I did my copy, yes, that would be a problem, and I'd want to do a
160 snapshot or otherwise "freeze" the live filesystem in ordered to get a
161 good self-consistent copy. But, for root anyway, unless I'm trying to do
162 an emerge --update in the background or something at the same time (and
163 why would I, both the copy and the update could be trying to access the
164 filesystem at once, slowing both down, and it needlessly complicates
165 things, so there's no purpose to doing so), a simple cp --archive of the
166 live filesystem, from the bind-mount so I get JUST the root filesystem,
167 no more no less, is sufficient.
168
169 For /home, there's a /bit/ more concern, say with the firefox sqlite
170 databases, if I'm browsing at the same time I'm trying to do the backup.
171 However, that's simple enough to avoid. Just don't do anything that's
172 going to be actively changing the filesystem at the same time I'm trying
173 to make an accurate backup of it.
174
175 Of course with your VMs that's a bit different story, rather like the
176 active database case. A snapshotting filesystem (like btrfs) or sub-
177 filesystem block-device layer (like lvm2) can be used here, taking the
178 snapshot and copying it while the activity continues on the live
179 filesystem, or, likely a simpler solution for those where it's possible,
180 just do the copy when the database/vms aren't active and in use.
181
182 But unless your vms/databases are files on your rootfs, that shouldn't be
183 a problem with the rootfs backup, in any case. And if they are and you
184 can't shut down the vms/databases for long enough to do a backup, I'd
185 personally have questions of the strategy that put them on rootfs to
186 begin with, but whatever, THAT is when you'd need to worry about taking
187 an accurate copy of the live rootfs, but ideally, that's not a case you
188 need to worry about, and indeed, from what I've read it's not a problem
189 in your case at all. =:^)
190
191 > I ran this command the first time to get 98% of everything copied while
192 > in KDE, but before I moved forward I exited KDE, stopped X and ran it as
193 > root from the console. After the second run it didn't pick up any new
194 > file changes so I suspect it's pretty close to what I'd get dealing with
195 > a Live CD boot. (COMMENTS?)
196
197 As the above commentary should indicate, if anything I think you're being
198 overly cautious. In the vast majority of cases, a simple cp --archive,
199 or your equivalent rsync, should be fine. The caveat would be if you
200 were trying to backup the vms while they were in operation, but you've
201 taken care of that separately, so (with the possible caveat about file
202 capacities and xattrs) I believe you're good to go.
203
204 > 3) I added a new boot options in grub.conf:
205
206 (Long) Note in passing: You should probably look into upgrading to grub2
207 at some point. Now may not be a good time, as you've got a lot on your
208 plate right now as it is, but at some point. Because while there's a bit
209 of a learning curve to getting up and running on grub2, it's a lot more
210 flexible than grub1, with a lot more troubleshooting possible if you're
211 not getting the boot you expect, and direct support of all sorts of fancy
212 stuff like mdadm, lvm2, btrfs, zfs, etc, as well as an advanced command-
213 line shell much like sh/bash itself, so it's very possible to browse your
214 whole filesystem directly from inside grub, as I said, making
215 troubleshooting **MUCH** easier. Plus its scripting (including if/then
216 conditionals and variable handling much like bash) and menu system make
217 all sorts of advanced boot configs possible.
218
219 And while I'm at it, I'd strongly recommend switching to gpt partitioning
220 from the old mbr style partitions, either before switching to grub2 or at
221 the same time. GPT is more reliable (checksummed partitioned table with
222 two copies, one at the beginning and one at the end of the device, unlike
223 mbr with just one, with no checking, that if it goes bad...) and less
224 complicated (no primary/secondary/logical partition distinction, up to
225 128 partitions handled by default, with a possibility for even more if
226 you setup a larger gpt than mbr. Plus, it allows partition labels much
227 like the filesystem labels people already use, only on the partitions
228 themselves, so they don't change with the filesystem. That in itself
229 makes things much easier, since with labels it's much easier to keep
230 track of what each partition is actually for.
231
232 The reason I recommend switching to gpt before switching to grub2, is
233 that gpt has a special BIOS-reserved partition type, that grub2 can make
234 use of to store its core (like grub1's stage-1.5 and 2), making the grub2
235 administration and updates less problematic than they might be
236 otherwise. (This of course assumes bios, not efi, but grub2 works with
237 efi as well, I'm just not familiar with its efi operation, and besides,
238 efi folks are likely to already be running grub2 or something else,
239 instead of legacy grub1, so it's likely a reasonably safe assumption.)
240
241 Actually, when I switched to gpt here, while still on grub1, I was
242 forward thinking enough to setup both a bios-reserved partition, and an
243 efi-reserved partition, even tho neither one was used at the time. They
244 were small (a couple MB for the BIOS partition, just under 128 MB for the
245 efi partition, so the both fit in 128 MB, an eighth of a gig). Then I
246 upgraded to grub2 and it found and used the gpt bios partition without
247 issue, instead of having to worry about fitting it in slack space before
248 the first partition or whatever. The efi-reserved partition is still
249 unused, but it's there in case I upgrade to efi on this machine (I doubt
250 I will as I have no reason to), or decide to fit the existing disk into a
251 new machine at some point, without full repartitioning.
252
253 (FWIW, I use gptfdisk, aka gdisk, as my gpt-partitioner analogous to
254 fdisk. However, gparted has supported gpt for awhile, and even standard
255 fdisk, from the util-linux package, has (still experimental) gpt support
256 now. Tho the cfdisk variant (also from util-linux) doesn't have gpt
257 support yet, but cgdisk, from the gptfdisk package, does, and that's the
258 executable from the gptfdisk package I tend to use here. (I use gdisk -l
259 to spit out the partition list on the commandline, similar to cat-ing a
260 file. That's about it. I use cgdisk for actual gpt partition table
261 editing.))
262
263 It's just that reading your post, I'm translating to grub2 in my head,
264 and thinking how much simpler grub2 makes troubleshooting, when you can
265 effectively browse all hard drives in read-only mode directly from grub,
266 not only browsing around to know for sure that a particular partition is
267 the one you need, but paging thru various files in the kernel
268 Documentation dir, for instance, to get options to plug in on the kernel
269 commandline in grub, etc. It really does make troubleshooting early boot
270 problems MUCH easier, because grub2 simply gives you far more to work
271 with in terms of troubleshooting tools available to use at the grub
272 prompt.
273
274 The one caveat for gpt is for people multi-booting to other than Linux.
275 From what I've read, MS does support GPT, but with substantially less
276 flexibility (especially for XP, 7 is better) than Linux. I think it can
277 install to either, but switching from one to the other without
278 reinstalling is problematic, or something like that, whereas with Linux
279 it's simply ensuring the appropriate support is configured into (or
280 available as modules if you're running an initr*) the kernel. (I have
281 little idea how Apple or the BSDs work with GPT.)
282
283 But while you do MS, AFAIK it's all in VMs, so that shouldn't be a
284 problem for you, so gpt should be fine.
285
286 And of course grub2 should be fine as well, gpt or not, but based on my
287 experience, gpt makes the grub2 upgrade far easier, at least as long as
288 there's a bios-reserved partition setup in gpt already, as there was here
289 when I did my grub2 upgrade, since I'd already done the gpt upgrade
290 previously.
291
292 But as I said, now may not be the best time to think about that as you
293 have enough on your plate ATM. Maybe something for later, tho... Or
294 maybe consider doing gpt now, since you're repartitioning now, and grub2
295 later...
296
297 (grub1 menu entries:)
298
299 > title fastVM 3.8.13-gentoo using LABEL (SSD, initramfs in kernel)
300 > root (hd5,0)
301 > kernel (hd0,0)/boot/bzImage-3.8.13-gentoo root=LABEL=fastVM video=vesafb
302 > vga=0x307title
303 >
304 > fastVM 3.8.13-gentoo using LABEL (SSD, initramfs in kernel)
305 > root (hd5,0)
306 > kernel (hd0,0)/boot/bzImage-3.8.13-gentoo root=/dev/sda1 video=vesafb
307 > vga=0x307
308
309 I'll assume that "vga=0x307title" is a typo, and that "title" starts the
310 second menu entry...
311
312 ... Making the difference between the two entries the root=LABEL=fastVM,
313 vs root=/dev/sda1
314
315 > I am relatively confident that (hd5,0) is the SSD. I have 6 drives in
316 > the system - the 5 HDDs and the SSD. The 5 hard drives all have multiple
317 > partitions which is what grub tells me using tab completion for the line
318 >
319 > root(hdX,
320 >
321 > Additionally the SDD has a single partition to tab completion on
322 > root(hd5 finishes with root(hd5,0). I used /dev/sda as that's how it's
323 > identified when I boot using RAID.
324
325 This is actually what triggered the long grub2 note above. "Relatively
326 confident", vs. knowing, because with grub2's mdadm support, you can
327 (read-only) browse all the filesystems in the raid, etc (lvm2, etc, if
328 you're using that...), as well. So you know what's what, because you can
329 actually browse it, direct from the grub2 boot prompt.
330
331 However, while my grub1 knowledge is getting a bit rusty now, I think
332 you're mixing up grub's root(hdX,Y) notation, which can be thought of as
333 sort of like a cd in bash, simply changing the location you're starting
334 from if you don't type in the full path, with the kernel's root=
335 commandline option.
336
337 Once the kernel loads (from hd0,0 in both entries), its root= line may
338 have an entirely DIFFERENT device ordering, depending on the order in
339 which it loaded its (sata chipset, etc) drivers and the order the devices
340 came back in the device probes it did as it loaded them.
341
342 That's actually why kernel devs and udev folks plus many distros tend to
343 recommend the LABEL= (or alternatively UUID=) option for the kernel's
344 root= commandline option, these days, instead of the old /dev/sdX style,
345 because in theory at least, the numbering of /dev/sdX devices can change
346 arbitrarily. In fact, on most home systems with a consistent set of
347 devices appearing at boot, the order seldom changes, and it's *OFTEN* the
348 same as the order as seen by grub, but that doesn't HAVE to be the case.
349
350 Of course the monkey wrench in all this is that as far as I'm aware
351 anyway, the LABEL= and UUID= variants of the root= kernel commandline
352 option *REQUIRE* an initr* with working udev or similar (I'm not sure if
353 busybox's mdev supports LABEL=/UUID= or not), which might well be a given
354 on binary-based distros that handle devices using kernel modules instead
355 of custom built-in kernel device support, and thus require an initr* to
356 handle the modules load anyway, but it's definitely *NOT* a given on a
357 distro like gentoo, which strongly encourages building from source and
358 where many, perhaps most users, use a custom-built kernel with the
359 drivers necessary to boot builtin, and thus may well not require an initr*
360 at all. For initr*-less boots, AFAIK root=/dev/* is the only usable
361 alternative, because the /dev/disk/by-*/ subdirs that LABEL= and UUID=
362 depends on are udev userspace created, and those won't be available for
363 rootfs mount in an initr*-less boot.
364
365 > Now, the kernel has the initrd built into it so if it cannot be
366 > turned off I guess I'll try building a new kernel without it. However I
367 > found a few web pages that also said RAID could be disabled using a
368 > 'noraid' option which I thought should stop the system from finding the
369 > exiting RAID6 but no luck.
370
371 FWIW, the best reference for kernel commandline options is the kernel
372 documentation itself. Sometimes you need more, but that's always the
373 place to look first.
374
375 Specifically, $KERNELDIR/Documentation/kernel-parameters.txt , for the
376 big list in one place, with additional documentation often provided in
377 the various individual files documenting specific features.
378
379 kernel-parameters.txt lists noinitrd:
380
381 noinitrd [RAM] Tells the kernel not to load any configured
382 initial RAM disk.
383
384 So that should work. It doesn't say anything about it not working with
385 a built-in initramfs, either, so if it doesn't, there's a bug in that it
386 either should say something about it, or it should work.
387
388 FWIW, depending on what initramfs creation script you're using and its
389 content, you should be able to tell whether the initramfs activated or
390 not.
391
392 Here, I /just/ /recently/ started using dracut, since it seems multi-
393 device btrfs as root doesn't work reliably otherwise, and that's what I'm
394 using as my rootfs now (btrfs raid1 mode on dual SSDs, I could only get
395 it to mount the dual-device btrfs raid1 in degraded mode, seeing only one
396 of the two devices, without the btrfs device scan in the initramfs, tho a
397 google says some people have it working, <shrug>).
398
399 But even booting to my more traditional reiserfs rootfs backups on the
400 "spinning rust", where booting from the initramfs isn't mandatory, I can
401 tell whether the initramfs was loaded or not by the boot-time console
402 output. Among other things, if the initramfs is loaded and run, then
403 /proc and /run are already loaded when the openrc service that would
404 normally mount them gets run, because the initramfs mounted them. But
405 apparently the initramfs mounts at least /run with different permissions,
406 so openrc mentions that it's changing permissions on /run when it runs
407 after the initramfs, but simply mounts it with the permissions it wants,
408 when the initramfs hasn't run.
409
410 But unfortunately, I've not actually tried the noinitrd kernel commandline
411 option, so I can't VERIFY that it works here, with my now builtin
412 initramfs. I'll have to reboot to try that, and will try to get back to
413 you on that. (Note to self. Test the root=LABEL with initramfs-less
414 boot too, while I'm at it.)
415
416 If you're using a dracut-created initr*, then there's several other
417 helpful kernel commandline options that it hooks. See the
418 dracut.comandline manpage for the full list, but rd.break and its
419 rd.break=<brkpoint> variants allow dropping to the initr*'s builtin shell
420 (AFAIK dash by default for dracut, but bash is an option... which I've
421 enabled) at various points, say right before or right after the initr*'s
422 udev runs, right before mounting the real rootfs, or right before the
423 final switchroot and start of the init on the real rootfs. If you're
424 using some other initr* creator, obviously you'd check its documentation
425 for similar options.
426
427 I know rd.break works here, as I tested it while I was figuring out how
428 to work this new-to-me initramfs thing. And it's obvious that I'm in the
429 initr*'s bash, because its shell prompt isn't anything like my customized
430 shell prompt.
431
432 Meanwhile, I DO NOT see "noraid" listed in kernel-parameters.txt, altho
433 that doesn't mean it doesn't (or didn't at some point) exist. I DO see a
434 couple raid-options, md= and raid=, however, with references to
435 Documentation/md.txt.
436
437 Based on the md.txt file, it appears raid=noautodetect is the option
438 you're looking for. This also matches my now slightly rusty recollection
439 from when I ran mdraid before. noraid didn't look quite right, but
440 raid=noautodetect looks much closer to what I remember.
441
442 (If you're using dracut-based initr*, there's a similar option for it,
443 rd.auto, rd.auto=(0|1), that defaults off with current versions of dracut,
444 according to the dracut.cmdline manpage. That governs autoassembly of
445 raid, lvm, etc. But since it already defaults off, unless you're running
446 an old version where that defaulted on, or have it as part of your
447 builtin commandline as configured in your kernel or something, that
448 shouldn't be your problem.)
449
450 > Does anyone here have any ideas? fdisk info follows at the end.
451 > Ask for anything else you want to see.
452 >
453 > If I can get to booting off the SSD then for the next few days I
454 > could build different RAIDs and do some performance testing.
455
456 Hmm... This didn't turn out to be so hard to reply to after all. Maybe
457 because I kept my initr* remarks to dracut-based, which is all I know
458 anyway...
459
460 Some other remarks...
461
462 FWIW, if you're running an md-raid rootfs, at least with gpt and a
463 dedicated bios partition, installing grub2 is easier than installing or
464 updating grub1, as well. I remember the pain it was to install grub1 to
465 each of the four drives composing my raid, back when I had that setup, in
466 particular, the pain of trying to be sure I was installing to the
467 physical drive I /thought/ I was installing to, while at the same time
468 ensuring it was actually pointed at the /boot on the same drive, not at
469 the /boot on a different drive, so that if that drive was the only one I
470 had left, I could still boot from it. The problem was that because I was
471 on mdraid, grub1 was detecting that and I had to specify the physical
472 device one way to tell it where to install stage1, and a different way to
473 tell it where to put stage2 in /boot.
474
475 With grub2, things were so much easier that I had trouble believing I'd
476 actually installed it already. But I rebooted and it worked just fine,
477 so I had. Same thing when I switched to the pair of ssds with btrfs in
478 raid1 mode as my rootfs. I installed to the first one... and thought
479 surely there was another step I had missed, but there it was. After
480 reboot to test, I installed to the second one, and rebooted to it (using
481 the boot selector in the BIOS) to test. All fine. =:^)
482
483 Of course part of that, again, is due to using gpt with the reserved bios
484 partition for grub to put its stage2 core in, quite apart from what it
485 puts in /boot. I suppose I'd have had a similar problem as I did with
486 grub1, if I was still using mbr or didn't have a reserved bios partition
487 in my gpt layout, and grub had to stick the stage2 core either in slack
488 space before the first partition (if there was room to do so), or in
489 /boot itself, and hope the filesystem didn't move things around afterward
490 (which reiserfs did do a couple of times to me back with grub1, tho it
491 wasn't usually a problem).
492
493 I glossed over what to do with non-dracut-based initr*, as I've not used
494 anything other than dracut and direct no-initr*, and dracut's only very
495 recently. However, I'd be quite surprised if others didn't have
496 something similar to dracuts rd.break options, etc, and you certainly
497 should be able to tell whether the initr* is running or not, based on the
498 early-boot console output. Of course, whether you're /familiar/ enough
499 with that output or not to tell what's initr* and what's not, is an
500 entirely different question, but if you know well what one looks like,
501 the other should be enough different that you can tell, if you look
502 closely.
503
504 From the initrd, it should be possible to mount something else other than
505 the old raid as rootfs, and by that time, you'll have the kernel
506 populated /dev tree to work with as well as possibly the udev populated
507 disk/by-* trees, so finding the right one to mount shouldn't be an issue
508 -- no worries about kernel device order not matching grub device order,
509 because you're past grub and using the kernel already, by that point.
510 That was definitely one of the things I tested on my dracut-based initr*,
511 that from within the initr* (using for instance rd.break=pre-mount to
512 drop to a shell before the mount), I could find and mount backup root
513 filesystems, should it be necessary.
514
515 From within the initrd, you should be able to mount using label, uuid or
516 device, any of the three, provided of course that udev has populated the
517 disk/by-label and by-uuid trees, and I could certainly mount with either
518 label or device (I didn't try uuid), using my dracut-based initramfs,
519 here.
520
521 So really, you shouldn't need the noinitrd option for that. Tho as long
522 as your selected rootfs doesn't /require/ an initr* to boot (as my multi-
523 device btrfs rootfs seems to here), you should be able to boot to it with
524 an appropriate kernel commandline root= option, with or without the
525 initr*.
526
527 > c2RAID6 ~ # fdisk -l
528 >
529 > Disk /dev/sda: 128.0 GB [snip]
530 >
531 > Device Boot Start End Blocks Id System
532 > /dev/sda1 2048 250069679 125033816 83 Linux
533 >
534 > Disk /dev/sdb: 500.1 GB
535 >
536 > Device Boot Start End Blocks Id System
537 > /dev/sdb1 * 63 112454 56196 83 Linux
538 > /dev/sdb2 112455 8514449 4200997+ 82 Linux swap
539 > /dev/sdb3 8594775 976773167 484089196+ fd Linux raid
540 >
541 > Disk /dev/sdc: 500.1 GB
542 >
543 > Device Boot Start End Blocks Id System
544 > /dev/sdc1 * 63 112454 56196 83 Linux
545 > /dev/sdc2 112455 8514449 4200997+ 82 Linux swap
546 > /dev/sdc3 8594775 976773167 484089196+ fd Linux raid
547 >
548 > Disk /dev/sde: 500.1 GB
549 >
550 > Device Boot Start End Blocks Id System
551 > /dev/sde1 2048 8594774 4296363+ 83 Linux
552 > /dev/sde3 8594775 976773167 484089196+ fd Linux raid
553 >
554 > Disk /dev/sdf: 500.1 GB
555 >
556 > Device Boot Start End Blocks Id System
557 > /dev/sdf1 2048 8594774 4296363+ 83 Linux
558 > /dev/sdf3 8595456 976773167 484088856 fd Linux raid
559 >
560 > Disk /dev/sdd: 500.1 GB
561 >
562 > Device Boot Start End Blocks Id System
563 > /dev/sdd1 * 63 112454 56196 83 Linux
564 > /dev/sdd2 112455 8514449 4200997+ 82 Linux swap
565 > /dev/sdd3 8594775 976773167 484089196+ fd Linux raid
566 >
567 > Disk /dev/md3: 1487.1 GB
568 >
569 > c2RAID6 ~ #
570
571 --
572 Duncan - List replies preferred. No HTML msgs.
573 "Every nonfree program has a lord, a master --
574 and if you use the program, he is your master." Richard Stallman

Replies

Subject Author
Re: [gentoo-amd64] Re: Can initrd and/or RAID be disabled at boot? Mark Knecht <markknecht@×××××.com>
[gentoo-amd64] Re: Can initrd and/or RAID be disabled at boot? Duncan <1i5t5.duncan@×××.net>