Gentoo Archives: gentoo-user

From: frares@×××××.com
To: gentoo-user <gentoo-user@l.g.o>
Subject: Re: Re: [gentoo-user] /dev/sda* missing at boot
Date: Fri, 19 Aug 2011 15:08:21
Message-Id: bcaec5486186fddc5504aadd13cf@google.com
In Reply to: Re: [gentoo-user] /dev/sda* missing at boot by Alan McKinnon
1 Em 19/08/2011 10:48, Alan McKinnon <alan.mckinnon@×××××.com> escreveu:
2 > On Fri 19 August 2011 13:12:25 frares@×××××.com did opine thusly:
3
4 > > I the case I don't need a initram, I guess that the grub line for
5 > > parameter passing to the kernel would be empty. Am I wrong?
6
7 > Yes.
8
9 > Using or not using kernel parameters has nothing to do with whether
10 > you use an initramfs or not.
11
12 > It's the initrd line in grub you do not need.
13
14 > >
15 > > I was just looking on how to build my own initram. What is it
16 > > supposed to do anyway?
17
18 > First, it's initramfs (the previous incarnation was initrd). You
19 > should use the correct name.
20
21 > An initramfs is a filesystems image stored on disk in a place that
22 > grub can find. It contains a kernel, essential drivers and other bits
23 > and pieces. When booting, grub finds the image, bangs it into memory
24 > and instructs the cpu to start executing at a known point.
25
26 > Why is this useful?
27
28 > For Gentoo it usually isn't (there are times when it is - see below).
29 > Binary distros like Ubuntu and Fedora absolutely require this. These
30 > distros do not know what hardware you have and what drivers you
31 > require, so they supply drivers for everything. But Ubuntu cannot
32 > possibly compile into the kernel every possible driver you might need
33 > to boot as the list would be huge (every known floppy, CD, USB, every
34 > known MFM, IDE, SATA, SCSI, netboot, Fibre and more driver for a
35 > start), so what they do instead is probe the hardware at boot time,
36 > find out what you have, and load the driver modules you DO need.
37
38 > This is the problem. The kernel wants to load disk drivers so that it
39 > can access the disk and continue booting. Where are the drivers? Well,
40 > they are on the disk. Oops, circular problem.
41
42 > The difficulty is not finding and loading drivers, it's how do you get
43 > the disk driver off the disk before you have the disk driver in
44 > memory? (think chicken and egg here).
45
46 > An initramfs solves this nicely. Grub shoved a disk image into memory
47 > when it booted. The kernel knows how to access it's memory it doesn't
48 > need a driver for that. And now the files containing the needed
49 > drivers are on a virtual disk *in memory*. The kernel loads them, and
50 > can now access the real physical disks.
51
52 > Lots more complicated stuff then happens, like getting rid of the
53 > virtual filesystem from the initramfs and mounting the real filesystem
54 > from disk at /, but that's beyond the scope of this mail.
55
56 > Gentoo mostly doesn't need any of this because you do know your
57 > hardware and can just compile your disk drivers into the kernel - this
58 > is the very thing that Ubuntu cannot do.
59
60 > Some Gentoo users still need an initramfs, such as booting off drives
61 > in a RAID configuration. They need the RAID drivers first to read the
62 > disks so use an initramfs to fix this little problem exactly as Ubunut
63 > fixes their problem.
64
65 > Make sense?
66
67
68 Completely! Thanks a lot.
69
70 So I guess that my problem is to find an appropriate pair of driver and
71 hard disk operating mode.
72
73 > --
74 > alan dot mckinnon at gmail dot com
75
76
77 Thanks again
78 Francisco

Replies

Subject Author
Re: [gentoo-user] /dev/sda* missing at boot Alan McKinnon <alan.mckinnon@×××××.com>