Gentoo Archives: gentoo-user

From: Paul Hartman <paul.hartman+gentoo@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Can't find init due to inconsistent drive order
Date: Mon, 01 Jul 2013 22:55:21
Message-Id: CAEH5T2NgSzp6U5jFAinQwf-AOmJiNM7yweHLFDJ3tUjzyeuF-g@mail.gmail.com
In Reply to: [gentoo-user] Can't find init due to inconsistent drive order by Grant Edwards
1 On Mon, Jul 1, 2013 at 4:52 PM, Grant Edwards <grant.b.edwards@×××××.com> wrote:
2 > I've just recently run into a problem where sometimes when a machine
3 > boots, the kernel can't find init. This appears to be because my grub
4 > configuration line says "root=/dev/sda5" and _sometimes_ the drive
5 > that contains my root partition is sdb instead of sda. AFAICT, for the
6 > past 30 years the linux kernel was 100% consistent in the order that
7 > hard drives were labelled -- but recently that has seems to have
8 > changed.
9
10 I wonder if it could be related to parallel initialization of disks. I
11 think there's a kernel toggle for that. I wonder if sometimes one
12 drive spins up faster than the other. (If that's even how it works...)
13
14 I have experienced situations where the drive names change depending
15 on what devices were plugged into the computer when it was turned on,
16 especially external hard drives, card readers or flash drives, or if a
17 disc in the CDROM drive. Not sure if that is due to the way the
18 computer's BIOS handled things during POST, or the way the linux
19 kernel does its thing.
20
21 > Are we really expected now to set up an initrd just so that the kernel
22 > can find the root partition??
23
24 As far as I know, the answer is "yes".
25
26 FWIW, I always resisted making an initrd until very recently, but
27 wanted to use UUID in my bootup on my new system. I used this command
28 (which I re-run whenever I deploy a new kernel):
29
30 dracut -H -o i18n -o resume -o usrmount --force /boot/initramfs.img
31
32 And then added one line to my grub2 config:
33
34 initrd /initramfs.img
35
36 and it just simply works... though it's still a bit of black magic to
37 me, and every time I reboot I feel a bit of nervousness when I see
38 "Loading initial ramdisk..." and don't breathe until it succeeds. :)

Replies

Subject Author
[gentoo-user] Re: Can't find init due to inconsistent drive order Grant Edwards <grant.b.edwards@×××××.com>