public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* Re: [gentoo-user] /dev/sda* missing at boot
  2011-08-19 13:12 ` frares
@ 2011-08-19 13:48 Alan McKinnon
  2011-08-19 15:06 ` frares
  0 siblings, 1 reply; 6+ messages in thread
From: Alan McKinnon @ 2011-08-19 13:48 UTC (permalink / raw
  To: gentoo-user; +Cc: frares

On Fri 19 August 2011 13:12:25 frares@gmail.com did opine thusly:
> I the case I don't need a initram, I guess that the grub line for
> parameter   passing to the kernel would be empty. Am I wrong?

Yes.

Using or not using kernel parameters has nothing to do with whether 
you use an initramfs or not.

It's the initrd line in grub you do not need.

> 
> I was just looking on how to build my own initram. What is it
> supposed to   do anyway?

First, it's initramfs (the previous incarnation was initrd). You 
should use the correct name.

An initramfs is a filesystems image stored on disk in a place that 
grub can find. It contains a kernel, essential drivers and other bits 
and pieces. When booting, grub finds the image, bangs it into memory 
and instructs the cpu to start executing at a known point.

Why is this useful?

For Gentoo it usually isn't (there are times when it is - see below). 
Binary distros like Ubuntu and Fedora absolutely require this. These 
distros do not know what hardware you have and what drivers you 
require, so they supply drivers for everything. But Ubuntu cannot 
possibly compile into the kernel every possible driver you might need 
to boot as the list would be huge (every known floppy, CD, USB, every 
known MFM, IDE, SATA, SCSI, netboot, Fibre and more driver for a 
start), so what they do instead is probe the hardware at boot time, 
find out what you have, and load the driver modules you DO need.

This is the problem. The kernel wants to load disk drivers so that it 
can access the disk and continue booting. Where are the drivers? Well, 
they are on the disk. Oops, circular problem.

The difficulty is not finding and loading drivers, it's how do you get 
the disk driver off the disk before you have the disk driver in 
memory? (think chicken and egg here).

An initramfs solves this nicely. Grub shoved a disk image into memory 
when it booted. The kernel knows how to access it's memory it doesn't 
need a driver for that. And now the files containing the needed 
drivers are on a virtual disk *in memory*. The kernel loads them, and 
can now access the real physical disks.

Lots more complicated stuff then happens, like getting rid of the 
virtual filesystem from the initramfs and mounting the real filesystem 
from disk at /, but that's beyond the scope of this mail.

Gentoo mostly doesn't need any of this because you do know your 
hardware and can just compile your disk drivers into the kernel - this 
is the very thing that Ubuntu cannot do.

Some Gentoo users still need an initramfs, such as booting off drives 
in a RAID configuration. They need the RAID drivers first to read the 
disks so use an initramfs to fix this little problem exactly as Ubunut 
fixes their problem.

Make sense?


-- 
alan dot mckinnon at gmail dot com



^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: [gentoo-user] /dev/sda* missing at boot
@ 2011-08-19 10:09 Mick
  2011-08-19 13:12 ` frares
  0 siblings, 1 reply; 6+ messages in thread
From: Mick @ 2011-08-19 10:09 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: Text/Plain, Size: 2256 bytes --]

On Friday 19 Aug 2011 03:27:23 Mark Knecht wrote:
> On Thu, Aug 18, 2011 at 11:59 AM,  <frares@gmail.com> wrote:
> > Hi, guys
> > 
> > It is a shame, I know, but after several years using Gentoo, it is the
> > first time I try to build a kernel without "genkernel".
> > 
> > And now I can't boot to that new kernel, it does not find (and really do
> > not have a) /dev/sda* root partition ("real-root"); during the boot it
> > stops, complaining about that, gives me the option to get a shell, from
> > which I am able to see that there is no /dev/sda* .
> > 
> > I have included everything SATA, so it looks like that is not a kernel
> > problem, but a initramfs issue, I guess.
> > 
> > What am I missing?
> > 
> > Thanks a lot
> > Francisco
> > 
> > P.S.: my boot partition is sda2, sda3 is a swap partition, and everything
> > else is in sda4. sda1 is not used (up to now) and this is my grub.conf :
> > 
> > title Gentoo Linux 2.6.39-gentoo-r3
> > root (hd0,1)
> > kernel /boot/kernel-genkernel-x86_64-2.6.39-gentoo-r3 ro root=/dev/ram0
> > init=/linuxrc real_root=/dev/sda4 vga=0x318 video=uvesafb:1024x768-32
> > nodevfs udev devfs=nomount quiet CONSOLE=/dev/tty1
> > initrd /boot/initramfs-genkernel-x86_64-2.6.39-gentoo-r3
> 
> Maybe I'm missing the obvious here but have you taken a copy of
> whatever config file was used/generated by genkernel and used that as
> a jumping off point for building your own kernel. kernel's a kernel's
> a kernel. What it is capable of doing is in the .config file. If
> genkernel doesn't give you a .config file - I've never used genkernel
> so I don't know what it does - then assuming you have the feature
> turned on you can get the running config using zcat /proc/config.gz.
> Save that to a new .config file, put it in the kernel source directory
> and you should be good to go.
> 
> You can also use zcat /proc/config.gz on the install CD kernel if yuo
> boot from that. Save it to a disk and use it as the basis for creating
> your own config.

If you no longer use genkernel it is likely that you do not need an initram.  
Build chipset and fs modules into the kernel.  Other drivers you can choose if 
you want to build as modules. 

-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread
[parent not found: <CA czFiDeW6L8aYBWkch4Fu TrkXVtdJc3y11U1UY2hMsq1HZdA@mail.gmail.com>]
[parent not found: <CALzub=p5PVSg=TO=n4iqXMcWZqP8K fJAEyNH43CQsf4Ncrshg@mail.gmail.com>]

end of thread, other threads:[~2011-08-19 15:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CAK2H ed44eVYovNf_DT-N280dha6hYyONEUWogRrgsNDXAD1Vg@mail.gmail.com>
2011-08-19 13:08 ` Re: [gentoo-user] /dev/sda* missing at boot frares
2011-08-19 13:48 Alan McKinnon
2011-08-19 15:06 ` frares
  -- strict thread matches above, loose matches on Subject: below --
2011-08-19 10:09 Mick
2011-08-19 13:12 ` frares
2011-08-19 13:41   ` Gregory Woodbury
     [not found] <CA czFiDeW6L8aYBWkch4Fu TrkXVtdJc3y11U1UY2hMsq1HZdA@mail.gmail.com>
2011-08-18 19:17 ` frares
     [not found] <CALzub=p5PVSg=TO=n4iqXMcWZqP8K fJAEyNH43CQsf4Ncrshg@mail.gmail.com>
2011-08-18 19:15 ` frares

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox