1.106.1 Boot the system Weight 3 Angus Lees Context 1.106.1 Boot the system Weight 3 Linux Professional Institute Certification — 102 Objective Boot Process How BIOS finds boot loader Boot Loaders Chaining Boot Loaders dmesg /etc/modules.conf Angus Lees gus@inodes.org Nick Urbanik nicku@nicku.org This document Licensed under GPL—see section 9 License Of This Document 2005 July Outline 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process How BIOS finds boot loader Context Objective Boot Process How BIOS finds boot loader Boot Loaders LILO GRUB Other boot loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document Boot Loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document Topic 106 Boot, Initialization, Shutdown and Runlevels [6] Where we are up to 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process How BIOS finds boot loader Boot Loaders Chaining Boot Loaders dmesg 1.106.1 Boot the system [3] 1.106.2 Change runlevels and shutdown or reboot system [3] /etc/modules.conf License Of This Document Description of Objective 1.106.1 Boot the system 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process How BIOS finds boot loader Candidates should be able to guide the system through the booting process. This includes giving commands to the boot loader and giving options to the kernel at boot time, and checking the events in the log files. Boot Loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document Key files, terms, and utilities include: 1.106.1 Boot the system 1.106.1 Boot the system Weight 3 Angus Lees Context dmesg — command to show kernel message ring buffer /var/log/messages — main syslog file /etc/conf.modules or /etc/modules.conf — modprobe configuration file LILO — older bootloader system, less used now GRUB — newer, more flexible bootloader system Note that with Red Hat systems, 2.6 kernels use the file /etc/modprobe.conf, not /etc/modules.conf The name /etc/conf.modules has been out of favour for some years Objective Boot Process How BIOS finds boot loader Boot Loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document Booting Machine powers up, BIOS POST, spin up SCSI drives, etc BIOS boots boot loader (Boot loader may load its “second stage” from somewhere else) e.g., grub loads /boot/grub/stage2 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process How BIOS finds boot loader Boot Loaders Chaining Boot Loaders dmesg Boot loader loads Linux kernel Linux kernel starts up, detects hardware, etc Linux kernel creates a ram disk with kernel modules from initrd image file The drivers in the /boot/initrd.img file are often needed to access the hard disk. /etc/modules.conf License Of This Document After loading the Linux kernel mounts / Linux kernel starts init(8) init(8) starts up rest of system Finding the boot loader 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process (i386-specific) BIOS boots Master Boot Record (MBR), located at the beginning of the disk. Usual DOS MBR looks for “active” partition and loads the boot loader found in that partition. You can either install your boot loader in the MBR, replacing the DOS boot loader, or use a DOS-compatible boot loader and install your boot loader in the active partition. How BIOS finds boot loader Boot Loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document Outline 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process How BIOS finds boot loader Boot Loaders Context Objective Boot Process How BIOS finds boot loader Boot Loaders LILO GRUB Other boot loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document LILO GRUB Other boot loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document Boot Loaders LILO 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process “Usual” i386 boot loader at least it was a few years ago. How BIOS finds boot loader Boot Loaders LILO GRUB Other boot loaders lilo(8) install command generates suitable assembly code and installs it into either the MBR or a partition. Configured through /etc/lilo.conf Remembers actual disk blocks of kernel and uses that to access the file directly (using BIOS disk routines). Because the calculations are done at install time, LILO can get confused by changes in disk configuration. Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document Outline 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process How BIOS finds boot loader Boot Loaders Context Objective Boot Process How BIOS finds boot loader Boot Loaders LILO GRUB Other boot loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document LILO GRUB Other boot loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document Boot Loaders GRUB 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process How BIOS finds boot loader Boot Loaders LILO GRUB Other boot loaders The Grand United boot loader. Unlike LILO, GRUB understands some partition formats and reads files through “normal” means. GRUB has drivers for a number of different file systems depends on BIOS to be able to access the hard disk Reads the menu file /boot/grub/menu.lst directly from the hard disk No need to change MBR when install a new kernel Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document Outline 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process How BIOS finds boot loader Boot Loaders Context Objective Boot Process How BIOS finds boot loader Boot Loaders LILO GRUB Other boot loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document LILO GRUB Other boot loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document Boot loaders isolinux, loadlin 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process How BIOS finds boot loader Boot Loaders LILO GRUB CDROMs often use isolinux as the bootloader loadlin allows booting Linux after having booted MSDOS. Other boot loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document Chaining Boot loaders 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process One bootloader can load another bootloader This is how GRUB or LILO start Windows Windows has its own bootloader at the start of its partition We tell GRUB or LILO to “chainload” that boot loader How BIOS finds boot loader Boot Loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document It is often useful to have one GRUB bootloader start another bootloader For example, if you have several distributions on one disk, have one’s GRUB install its stage1 into the MBR Other distributions install GRUB at start of their partition The first GRUB chainloads the other GRUBs Keeps maintenance local within each distribution Snarfing kernel output 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process How BIOS finds boot loader Boot Loaders dmesg(8) gives you the last 16k of kernel messages. This is written to /var/log/dmesg to refer to after syslog starts up syslog gathers messages from many daemons as well as the kernel, and sends them to /var/log/messages Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document /etc/modules.conf 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process How BIOS finds boot loader Boot Loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document Configuration for modprobe(8) AKA /etc/modules.conf, or with the 2.6 kernel on Red Hat/Fedora systems, /etc/modprobe.conf Used to be called /etc/conf.modules till people realised that seems back to front Gives kernel module options, module aliases and a few more exotic options (like module pre/post load commands). Topics Covered Context Objective Boot Process How BIOS finds boot loader Boot Loaders LILO GRUB Other boot loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process How BIOS finds boot loader Boot Loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document Topics Covered Context Objective Boot Process How BIOS finds boot loader Boot Loaders LILO GRUB Other boot loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process How BIOS finds boot loader Boot Loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document Topics Covered Context Objective Boot Process How BIOS finds boot loader Boot Loaders LILO GRUB Other boot loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process How BIOS finds boot loader Boot Loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document Topics Covered Context Objective Boot Process How BIOS finds boot loader Boot Loaders LILO GRUB Other boot loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process How BIOS finds boot loader Boot Loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document Topics Covered Context Objective Boot Process How BIOS finds boot loader Boot Loaders LILO GRUB Other boot loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process How BIOS finds boot loader Boot Loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document Topics Covered Context Objective Boot Process How BIOS finds boot loader Boot Loaders LILO GRUB Other boot loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process How BIOS finds boot loader Boot Loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document Topics Covered Context Objective Boot Process How BIOS finds boot loader Boot Loaders LILO GRUB Other boot loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process How BIOS finds boot loader Boot Loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document Topics Covered Context Objective Boot Process How BIOS finds boot loader Boot Loaders LILO GRUB Other boot loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process How BIOS finds boot loader Boot Loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document Topics Covered Context Objective Boot Process How BIOS finds boot loader Boot Loaders LILO GRUB Other boot loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process How BIOS finds boot loader Boot Loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document Topics Covered Context Objective Boot Process How BIOS finds boot loader Boot Loaders LILO GRUB Other boot loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process How BIOS finds boot loader Boot Loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document Topics Covered Context Objective Boot Process How BIOS finds boot loader Boot Loaders LILO GRUB Other boot loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process How BIOS finds boot loader Boot Loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document Topics Covered Context Objective Boot Process How BIOS finds boot loader Boot Loaders LILO GRUB Other boot loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process How BIOS finds boot loader Boot Loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document License Of This Document 1.106.1 Boot the system Weight 3 Angus Lees Context Objective Boot Process How BIOS finds boot loader Boot Loaders Chaining Boot Loaders dmesg /etc/modules.conf License Of This Document Copyright c 2005, 2003 Angus Lees and Nick Urbanik . Permission is granted to make and distribute verbatim copies or modified versions of this document provided that this copyright notice and this permission notice are preserved on all copies under the terms of the GNU General Public License as published by the Free Software Foundation—either version 2 of the License or (at your option) any later version.