GRUB module query

Dave S ubuntu at pusspaws.net
Sat Aug 19 10:39:06 UTC 2006


On Thursday 17 August 2006 22:15, Tod Merley wrote:
> On 8/17/06, Dave S <ubuntu at pusspaws.net> wrote:
> > > Hi Dave!

Ahh my problem solved - I am no expert but I will tell you what I have found. 
If I am wrong let me know - its the way i learn :)


My PCI raid controller has its own BIOS - when I boot it gives me a config 
screen for various RAID options - I turn them off and use kernel software 
RAID.

> > >
> > > I do not understand.  If you need the raid driver to access the disk
> > > then how can you even fully load GRUB?!?!

Because GRUB is loaded by the BIOS. On power up it is the BIOS that is first 
started, the BIOS loads in the first few sectors of a HDD and executes them - 
hello GRUB ! Only the first HDD light of my RAID array flickers - its not in 
RAID mode yet.

So on boot the BIOS (and I guess my RAID card BIOS) conspire to load the first 
few sectors of my RAID hdd - so far so good :)

(NOTE BIOSs are getting too smart - I used to have 2 x ide controllers on the 
motherboard hda/b hdc/d. I plug in the raid card and the card assumes hda/b 
hdc/d and my motherboard ide controllers are shifted to hde/f hdg/h !)

So grub then asks the BIOS to load the kernel & initrd.img. initrd.img is the 
temporary RAM root file system (very stripped down) - you can find it 
in /boot and look whats inside by ...

root at dave-comp:/boot# mkdir /tmp/tmpinitrd
root at dave-comp:/boot# cd /tmp/tmpinitrd/
root at dave-comp:/tmp/tmpinitrd# cat /boot/initrd.img-2.6.15-26-386 | gzip -d | 
cpio -i --make-directories
31437 blocks
root at dave-comp:/tmp/tepinitrd# ls
bin  conf  etc  init  lib  modules  sbin  scripts  usr

Its a mini filesystem :)

Note the kernel has not accessed the HDDs yet, this exists entirely in RAM. 
The kernel then starts and access this filesystem. Inside the filesystem it 
executes /linuxrc to detect hardware and load appropriate modules - all from 
this RAM filesystem.

Once the modules are loaded it then accesses the HDDs and changes its root 
filesystem to the main HDD filesystem. (both HDD leds start blinking on my 
HDDs - RAID is working :)

My problem was that /linuxrc could not detect and load the needed module. My 
solution was ...

apt-get install initrd-tools
vi /etc/mkinitrd/modules
and add the line 'it821x'
apt-get install --reinstall linux-image-2.6.15-26-386

re-boot, the new initrd.img is loaded & everything works :)


> > >
> > > My limited understanding of GRUB is:
> > >
> > > Stage one - Master Boot Record  (First 512 bytes of BIOS chosen boot
> > > device).
> > >
> > > Stage "1.5" - Found by pointers in stage one - basically a chosen
> > > "file system reader" based upon the configuration of the disk where
> > > the ramdisk image (initrd) and Kernel can be found.
> > >
> > > Stage two - GRUB and boot.
> > >
> > > In your case I would be tempted to make my own little live CD's (see
> > > the GRUB manual - it looks pretty easy).  Not only would it solve the
> > > updates issue but it would be very secure.  No one could touch your
> > > MBR, Kernel, etc...
> > >
> > > Thanks for the information. This is quite interesting!
> > >
> > > Tod
> >
> > Sorry for the delay - I am doing research into the boot process - will
> > email again in a day or two  ... :)
> >
> > Dave
> >
> > --
> > ubuntu-users mailing list
> > ubuntu-users at lists.ubuntu.com
> > https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
> Hi again Dave!
>
> Sounds reasonable!
>
> BTW - I meant "Boot-CD" not "Live-CD" (kind of like "Boot Floppy").
>
> Looking forward to the rest of the story!
>
> Tod




More information about the ubuntu-users mailing list