Linux+ Guide to Linux Certification, Third Edition

  • Published on
    31-Dec-2015

  • View
    21

  • Download
    0

DESCRIPTION

Week 8 System Initialization and X Windows. Linux+ Guide to Linux Certification, Third Edition. Objectives. Summarize the major steps necessary to boot a Linux system Configure the LILO and GRUB boot loaders - PowerPoint PPT Presentation

Transcript

Week 8System Initialization and X WindowsLinux+ Guide to Linux Certification, 3eObjectivesSummarize the major steps necessary to boot a Linux systemConfigure the LILO and GRUB boot loadersExplain how the init daemon initializes the system at boot time into different runlevelsConfigure the system to start daemons upon entering certain runlevelsLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eObjectives (continued)Explain the purpose of the major Linux GUI components: X Windows, window manager, and desktop environmentList common window managers and desktop environments used in LinuxConfigure X Windows settingsLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eThe Boot ProcessPOST (Power On Self Test): series of tests run when computer initializesEnsures functionality of hardwareMBR: defines partitions and boot loader Normally located on first HDD sector Boot loader: program used to load an OSMBR might contain pointer to a partition containing a boot loader on the first sectorActive partition: partition pointed to by MBROne per HDDLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eThe Boot Process (continued)/boot: directory containing kernel and boot-related filesVmlinuz-: Linux kernel fileDaemon: system process that performs useful taskse.g., printing, scheduling, OS maintenanceInit (initialize) daemon: first process started by Linux kernelLoads all other daemonsBrings system to usable stateLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eThe Boot Process (continued) Linux+ Guide to Linux Certification, 3e*Figure 8-1: The boot processLinux+ Guide to Linux Certification, 3eBoot LoadersPrimary function: load Linux kernel into memoryOther functions:Passing information to kernel during startupBooting another OS: known as dual bootingTwo most common boot loaders:GRand Unified Boot loader (GRUB)Linux Loader (LILO)Linux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eGRUBMore common boot loader for modern LinuxStage1: first major part of GRUB Typically resides on MBRPoints to Stage1.5Stage1.5: loads filesystem support and Stage2Resides in /boot/grubStage2: performs boot loader functions Displays graphical boot loader screenResides in /boot/grubLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eGRUB (continued)Linux+ Guide to Linux Certification, 3e*Figure 8-2: GRUB boot loader screenLinux+ Guide to Linux Certification, 3eGRUB (continued)To configure, edit /boot/grub/grub.confRead directly by Stage2 boot loaderHDDs and partitions identified by numbers Format: (hd,)GRUB root partition: partition containing Stage2 boot loader and grub.conf fileGRUB normally allows manipulation of boot loaderTo prevent, enable password protectiongrub-md5-crypt command: generates encrypted password for use in grub.conf fileLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eGRUB (continued)If press any key during first five seconds after the BIOS POST get graphical GRUB boot menuManipulate the boot processGet a grub> prompt to enter commandsHelp screen provides list of all available commandsgrub-install command: installs GRUB boot loaderTypically for reinstallation when GRUB becomes damagedLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eGRUB (continued)Linux+ Guide to Linux Certification, 3e*Figure 8-5: Viewing help at the GRUB promptLinux+ Guide to Linux Certification, 3eLILOStands for Linux LoaderTraditional Linux boot loaderNo longer supported by FedoraTypically located on MBRLilo boot: prompt appears following BIOS POSTAllows choice of OS to load at startupTo configure, edit /etc/lilo.conf fileLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eLILO (continued) Linux+ Guide to Linux Certification, 3e*Table 8-1: Common /etc/lilo.conf keywordsLinux+ Guide to Linux Certification, 3eLILO (continued)append= keyword (in /etc/lilo.conf): Useful for manually passing information to Linux kernelCan pass almost any hardware informationFormat is hardware dependentMust reinstall LILO if /etc/lilo.conf file alteredlilo command: Reinstalls LILO-u option: Uninstall LILOLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eDual Booting LinuxNormally only one OS may be used at a timeCan use virtualization software to run multiple OSs at the same timeDual booting: configuration of boot loader which allows choice of OS at boot timeLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eUsing GRUB or LILO to Dual Boot Other Operating SystemsEasiest if Linux installed after another OSAllows installation program to detect other OSPlace appropriate entries in boot loader configuration fileGRUB and LILO cannot load Windows Kernel directlyGRUB loads Windows boot loader from Windows partitionLILO uses other= keyword to load boot loader in appropriate partitionLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eUsing GRUB or LILO to Dual Boot Other Operating Systems (continued)Linux+ Guide to Linux Certification, 3e*Figure 8-7: Configuring GRUB for a dual boot systemLinux+ Guide to Linux Certification, 3eUsing a Windows Boot Loader to Dual Boot LinuxUse EasyBCD to add components to Windows boot loaderWithin EasyBCD, use NeoGrub tab to modify Windows boot loader to include Linux supportCopy contents of grub.conf into C:\NST\menu.lstAt next boot, Windows boot loader will prompt to choose between Windows and starting the NeoGrub loader to load the Linux OSLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eUsing a Windows Boot Loader to Dual Boot Linux (continued)Linux+ Guide to Linux Certification, 3e*Figure 8-9: The EasyBCD programLinux+ Guide to Linux Certification, 3eUsing a Windows Boot Loader to Dual Boot Linux (continued)Linux+ Guide to Linux Certification, 3e*Figure 8-10: Booting Linux from a Windows boot loaderLinux+ Guide to Linux Certification, 3eLinux InitializationKernel assumes control after Linux loadedExecutes first daemon process (init daemon)/etc/inittab: configuration file for init daemonUsed to determine number of daemons to be loadedinit daemon responsible for unloading daemons when the system is halted or rebootedLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eRunlevelsRunlevel: defines number and type of daemons loaded into memory and executedinit daemon responsible for changing runlevelsOften called initstatesSeven standard runlevelsrunlevel command: displays current and most recent runlevelinit command: change OS runleveltelinit command: Alias to init commandLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eRunlevels (continued)Linux+ Guide to Linux Certification, 3e*Table 8-3: Linux runlevelsLinux+ Guide to Linux Certification, 3eThe /etc/inittab FileIndicates default runlevel which the init daemon entersSyntax: id:5:initdefault:Contains single uncommented line and series of explanatory commentsLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eRuntime Configuration ScriptsRuntime configuration (rc) scripts: scripts that prepare the system, start daemons and bring system to usable stateExecuted by init daemonAt boot time, run /etc/rc.d/rc.sysinit script Initialize the hardware components, set variables, check filesystems, and perform system tasksdmesg command: shows output of hardware detection and /etc/rc.d/rc.sysinit script Linux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eRuntime Configuration Scripts (continued)init daemon executes script for default runlevel (5) /etc/rc.d/rc5 scriptExecutes all files that start with S or K in the /etc/rc.d/rc5.d directoryEach file is symbolic link to script for starting or stopping daemonS/K indicate Start/Kill daemon upon entering the runlevelWhen user specifies runlevel1, init daemon runs default script but executes files in the /etc/rc.d/rc1.d directoryLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eRuntime Configuration Scripts (continued)Message during system initialization indicates whether each runtime configuration script has loaded successfullyHidden by graphical boot screen displayUse Esc key to remove the graphical screenOutput of runtime configuration scripts is logged to the /var/log/messages fileLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eRuntime Configuration Scripts (continued) Linux+ Guide to Linux Certification, 3e*Figure 8-11: The Linux initialization processLinux+ Guide to Linux Certification, 3eConfiguring Daemon StartupMost daemons started by init daemon from symbolic links in /etc/rc.d/rc*.d directoriesPoint to daemon executable files in /etc/rc.d/init.dMost daemons accept arguments start, stop, restartCan be used to manipulate daemons after system startupservice command: start, stop, or restart daemons within /etc/rc.d/init.d directoryLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eConfiguring Daemon Startup (continued)To add daemons to be automatically started:Add executable to /etc/rc.d/init.dCreate appropriate links to /etc/rc.d/rc*.dchkconfig command: view and modify daemons that are started in each runlevelntsysv utility: modifies file entries in /etc/rc.d/rc*.d directoriesService Configuration utility: easiest way to control daemon startup by runlevelLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eThe X Windows System: Linux GUI ComponentsLinux+ Guide to Linux Certification, 3e*Figure 8-15: Components of the Linux GUILinux+ Guide to Linux Certification, 3eX WindowsX Windows: core component of Linux GUIProvides ability to draw graphical images in windows that are displayed on terminal screenSometimes referred to as X serverX client: programs that tell X Windows how to draw the graphics and display the resultsNeed not run on same computer as X WindowsXFree86: OSS version of X WindowsOriginally intended for Intel x86 platformLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eWindows Managers and Desktop EnvironmentsWindow manager: modifies look and feel of X WindowsDesktop environment: standard set of GUI toolsWorks with a window manager to provide standard GUI environmentProvides toolkits that speed up process of creating new softwareKDE and GNOME are most commonLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eWindows Managers and Desktop Environments (continued)K Windows Manager (kwm): window manager that works under KDEQt toolkit: software toolkit used with KDEGNOME desktop environment: default desktop environment in Fedora LinuxMetacity window manager GTK+ toolkitCan configure KDE or GNOME to use different window managere.g., compizLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eWindows Managers and Desktop Environments (continued)Linux+ Guide to Linux Certification, 3e*Figure 8-16: The KDE desktop environmentLinux+ Guide to Linux Certification, 3eWindows Managers and Desktop Environments (continued)Linux+ Guide to Linux Certification, 3e*Figure 8-17: The GNOME desktop environmentLinux+ Guide to Linux Certification, 3eStarting and Stopping X WindowsRunlevel 5 starts GNOME Display Manager (GDM)Displays graphical login screenAllows user to choose the desktop environment.dmrc file: contains desktop environments that were manually selected in a session menuBy default, root user is not allowed to log into system using GDMTo change this, edit /etc/pam.d/gdm and /etc/pam.d/gdm-password files Linux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eStarting and Stopping X Windows (continued)For runlevel 3:Start gdm manually, orUse startx commandstartx command: start X Windows and Window Manager or desktop environment specified in .xinitrc file in home directoryUsually points to .Xclients-default fileLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eConfiguring X WindowsX Windows interfaces with video hardwareRequires information regarding keyboard, mouse, monitor, and video adapter cardAttempts to automatically detect required informationIf automatic detection fails, user needs to specify correct hardware information manuallyLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eConfiguring X Windows (continued)Mouse, keyboard, monitor, and video adapter card information stored in a file/etc/X11/xorg.conf file for X.org implementation of X Windows/etc/X11/XF86Config file for XFree86 implementation of X WindowsFiles can be edited manually or using a programmouse-test command: detect mouseShould be run as root userLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eConfiguring X Windows (continued)system-config-keyboard command: start the Keyboard tool in order to configure keyboardsystem-config-display command: start the Display Settings utility to configure video adapter cardxvidtune utility: fine-tune the vsync and hsync of the video card and monitorLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eConfiguring X Windows (continued)Linux+ Guide to Linux Certification, 3e*Figure 8-21: Selecting a keyboard layoutLinux+ Guide to Linux Certification, 3eConfiguring X Windows (continued)Linux+ Guide to Linux Certification, 3e*Figure 8-22: The Display Settings utilityLinux+ Guide to Linux Certification, 3eConfiguring X Windows (continued)Linux+ Guide to Linux Certification, 3e*Figure 8-23: Configuring video card and monitor modelLinux+ Guide to Linux Certification, 3eConfiguring X Windows (continued)Linux+ Guide to Linux Certification, 3e*Figure 8-24: Configuring dual display supportLinux+ Guide to Linux Certification, 3eConfiguring X Windows (continued)Linux+ Guide to Linux Certification, 3e*Figure 8-25: The xvidtune utilityLinux+ Guide to Linux Certification, 3eSummaryBoot loaders are typically loaded by the system BIOS from the MBR or the first sector of the active partition of a hard diskThe boot loader is responsible for loading the Linux kernel and to boot other OSs in a dual boot configurationThe GRUB boot loader uses the /boot/grub/grub.conf configuration file and the LILO boot loader uses the /etc/lilo.conf configuration file Linux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eSummary (continued)Seven standard runlevels are used to categorize a Linux system based on the number and type of daemons loaded in memoryThe init daemon is responsible for loading and unloading daemons when switching between runlevelsDaemons are typically stored in the /etc/rc.d/init.d directory and loaded at system startup from entries in the /etc/rc.d/rc*.d directoriesLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3eSummary (continued)The Linux GUI has several interchangeable components: X server, X clients, Window Manager, and optional desktop environmentX Windows is the core component of the Linux GUI that draws graphics to the terminal screen You can start the Linux GUI from runlevel 3 by typing startx at a command prompt, or from runlevel 5 by using the gdmThe hardware information required by X windows is automatically detected, but can be modifiedLinux+ Guide to Linux Certification, 3e*Linux+ Guide to Linux Certification, 3e

Recommended

View more >