Linux Part 1 | GRUB, Kernel, INIT


GRUB

• The Grand Unified Boot Loader.

• A typical GRUB volume looks like:    root (hd0,0) // First HD / First Partition #/boot
    kernel /vmlinuz-2.6.9-5.ELsmp ro root=LABEL=/ rhgb quiet
    initrd /initrd-2.6.9-5.img

• The three different stages that GRUB process goes through are:

    Stage 1 of the boot process. (MBR - 512 bytes)
    Stage 1.5 - Drivers for different file systems.
    Stage 2 - Boot process to the passed to the kernel.

KERNEL

LOCATION

    Find all the kernel packages --- rpm -qa | grep -i kernel
    Find the revision of the kernel --- uname -r
    There can be more than one kernel on a system.  Some types of kernels are:

        Ex. kernel-version: UNI Processor / supports up to 4GB RAM
        Ex. kernel-SMP-version: Multi-processing / supports up to 32GB RAM
        Ex. kernel-hugemem-version: supports up to 64GB RAM

    lsmod - Lists the kernel modules on the system.

            /boot/ (vmlinuz* config* initrd*)
            /lib/modules/kernel_ver*
            Devel: /usr/src/kernels

UPGRADE

up2date will do it for you automatically.
• Download the rpm or source files.
• Install the RPM, using the -ivh option for rpm.
• There should be a new kernel entry in /boot/grub/grub.conf
• Reboot the system.
uname -r to reveal the new (current running) kernel DELETE
• Remove them to clean your system.
rpm -e <nameofRPM>

INIT

• The very first process that is invoked is the INIT process.

BIOS
--> MBR(Primary Drive (IDE/SCSI/SATA))
   --> GRUB Stage1 (512 bytes)
      --> GRUB Stage 1.5
          --> FileSystem
              --> Invokes Kernel / Initrd
                  --> Invokes Init
                      --> Consults /etc/inittab Runlevel config file
RUNLEVELS

•  INIT 0 - Shutdown
•  INIT 6 - Reboot
•  INIT 1 or INIT S- SINGLE USER MODE
•  INIT 2 - MULTI-USER W/O NETWORKING
•  INIT 3 - NO GRAPHICS, MULTI-USER W/ NETWORKING
•  INIT 5 - Graphics w/ Networking
•  INIT 4 - NOT USED

•  INITTAB - Starts up the default run level
•  /etc/rc.d/init.d - Contains all the programs/scripts used.
•  /etc/rc.d/rc1...6.d - Contains the symlinks to the init.d directory.
•  The main difference with rc3.d & rc5.d is that rc5 starts the readahead_later script, where rc3 kills it.
•  The main difference with rc0.d & rc6.d is that rc0 starts the S01halt script to halt the system, where fc6 calls the S01reboot (halt) script to reboot the system.

TOOL MANAGEMENT

•  chkconfig - Sets scripts in the various run levels to either start during start up.
•  ntsysv - Another way to manipulate various run levels via a interface.