%% $Header: /cvsroot/lcdp/lpic/general-linux-2/slides/gl2.106.1.slides.tex,v 1.1 2003/07/26 03:13:31 geoffr Exp $ \input{gl2.slide-header} \begin{document} \begin{slide} \begin{center} \LARGE \textsf{-- General Linux 2 -- \\ } \LARGE Booting the System\\[2mm] \large \textsf{(Linux Professional Institute Certification)}\\[1mm] \end{center} \vfill \tiny \begin{verbatim} $Id: gl2.106.1.slides.tex,v 1.1 2003/07/26 03:13:31 geoffr Exp $ \end{verbatim} \hrule \footnotesize Copyright \copyright\ 2005, 2003 Angus Lees, Nick Urbanik, Geoffrey Robertson. 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. \end{slide} \begin{slide} \slideheading{Boot the system} \slidesubheading{Objective} 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. \end{slide} \begin{slide} \Slideheading{Boot the system} \slidesubheading{Key files, terms, and utilities} \begin{alltt} dmesg /var/log/messages /etc/conf.modules \textrm{or} /etc/modules.conf LILO GRUB \end{alltt} \begin{itemize} \item Note that 2.6 kernels use the file \texttt{/etc/modprobe.conf}, not \texttt{/etc/modules.conf} \item The name \texttt{/etc/conf.modules} has been out of favour for some years \end{itemize} \end{slide} \begin{slide} \Slideheading{Booting} \begin{itemize} \item Machine powers up, \textsc{BIOS POST}, spin up \textsc{SCSI} drives, etc \item \textsc{BIOS} boots boot loader \item \emph{(Boot loader may load its ``second stage'' from somewhere else)} \begin{itemize} \item e.g., grub loads \texttt{/boot/grub/stage2} \end{itemize} \item Boot loader loads Linux kernel \item Linux kernel starts up, detects hardware, etc \item Linux kernel creates a ram disk with kernel modules from initrd image file \begin{itemize} \item The drivers in the \texttt{/boot/initrd.img} file are often needed to access the hard disk. \end{itemize} \item After loading the \item Linux kernel mounts / \item Linux kernel starts \texttt{init}(8) \item \texttt{init}(8) starts up rest of system \end{itemize} \end{slide} \begin{slide} \slideheading{Finding the boot loader} \begin{itemize} \item (i386-specific) \item BIOS boots Master Boot Record (MBR), located at the beginning of the disk. \item Usual DOS MBR looks for ``active'' partition and loads the boot loader found in that partition. \item You can either install your boot loader \begin{itemize} \item in the MBR, replacing the DOS boot loader, or \item use a DOS-compatible boot loader and install your boot loader in the active partition. \end{itemize} \end{itemize} \end{slide} \begin{slide} \Slideheading{Boot Loaders} \slidesubheading{LILO} \begin{itemize} \item ``Usual'' i386 boot loader \begin{itemize} \item at least it was a few years ago. \end{itemize} \item \texttt{lilo}(8) install command generates suitable assembly code and installs it into either the MBR or a partition. Configured through \texttt{/etc/lilo.conf} \item Remembers actual disk blocks of kernel and uses that to access the file directly (using BIOS disk routines). \item Because the calculations are done at install time, LILO can get confused by changes in disk configuration. \end{itemize} \end{slide} \begin{slide} \Slideheading{Boot Loaders} \slidesubheading{GRUB} \begin{itemize} \item The Grand United boot loader. \item Unlike LILO, GRUB understands some partition formats and reads files through ``normal'' means. \item GRUB has drivers for a number of different file systems \item depends on BIOS to be able to access the hard disk \item Reads the menu file \texttt{/boot/grub/menu.lst} directly from the hard disk \item No need to change MBR when install a new kernel \end{itemize} \end{slide} \begin{slide} \slideheading{Boot loaders} \slidesubheading{isolinux} \begin{itemize} \item CDROMs often use isolinux as the bootloader \end{itemize} \end{slide} \begin{slide} \slideheading{Chaining Boot loaders} \begin{itemize} \item One bootloader can load another bootloader \item This is how GRUB or LILO start Windows \begin{itemize} \item Windows has its own bootloader at the start of its partition \item We tell GRUB or LILO to ``chainload'' that boot loader \end{itemize} \item It is often useful to have one GRUB bootloader start another bootloader \begin{itemize} \item For example, if you have several distributions on one disk, have one's GRUB install its \texttt{stage1} into the MBR \item Other distributions install GRUB at start of their partition \item The first GRUB chainloads the other GRUBs \item Keeps maintenance local within each distribution \end{itemize} \end{itemize} \end{slide} \begin{slide} \slideheading{Snarfing kernel output} \begin{itemize} \item \texttt{dmesg}(8) gives you the last 16k of kernel messages. \item \texttt{syslog} usually logs this to \texttt{/var/log/messages} and \texttt{/var/log/dmesg} or \texttt{/var/log/kern.log} for posterity. \item \texttt{syslog} gathers messages from many daemons as well as the kernel, and sends them to \texttt{/var/log/messages} \end{itemize} \end{slide} \begin{slide} \slideheading{/etc/modules.conf} \begin{itemize} \item Configuration for \texttt{modprobe}(8) \item AKA \texttt{/etc/modules.conf}, or with the 2.6 kernel, \texttt{/etc/modprobe.conf} \begin{itemize} \item Used to be called \texttt{/etc/conf.modules} till people realised that seems back to front \end{itemize} \item Gives kernel module options, module aliases and a few more exotic options (like module pre/post load commands). \end{itemize} \end{slide} \end{document}