Presentation is loading. Please wait.

Presentation is loading. Please wait.

SUSE Linux Enterprise Desktop Administration

Similar presentations


Presentation on theme: "SUSE Linux Enterprise Desktop Administration"— Presentation transcript:

1 SUSE Linux Enterprise Desktop Administration
Chapter 11 Manage System Initialization

2 Objectives Objective 1—Describe the Linux Load Procedure
Objective 2—GRUB (Grand Unified Bootloader) Objective 3—Manage Runlevels SUSE Linux Enterprise Desktop Administration

3 Objective 1—Describe the Linux Load Procedure
The basic steps of booting a computer with a Linux system installed BIOS and Boot Manager Kernel initramfs (Initial RAM File System) init SUSE Linux Enterprise Desktop Administration

4 SUSE Linux Enterprise Desktop Administration
Figure 11-1 The basic steps of booting a computer with Linux SUSE Linux Enterprise Desktop Administration

5 BIOS and Boot Manager BIOS (Basic Input Output System)
Performs a power-on self test, conducts the initial detection and setup of hardware, and accesses bootable devices If the bootable device is a hard drive, BIOS also reads the MBR (Master Boot Record) Using the code in the MBR, the BIOS starts the boot manager The boot manager (such as GRUB) loads the kernel and the initrd to memory and starts the kernel SUSE Linux Enterprise Desktop Administration

6 Kernel Kernel Uncompresses itself and then organizes and takes control of the continued booting of the system Checks and sets the console, reads BIOS settings, and initializes basic hardware interfaces Next, the drivers probe existing hardware and initialize it accordingly The kernel controls the entire system Managing hardware access and allocating CPU time and memory to programs SUSE Linux Enterprise Desktop Administration

7 initramfs (Initial RAM File System)
Initial RAM File System (initramfs) A cpio archive that the kernel can load to a RAM disk Provides a minimal Linux environment that enables the execution of programs before the actual root file system is mounted Provides an executable named init Should execute the actual init program on the root file system for the boot process to proceed Former SUSE Linux versions used an initial RAM disk, initrd, instead The kernel starts the program init SUSE Linux Enterprise Desktop Administration

8 init The program init is located in initramfs starts /sbin/init
Boots the system with all its programs and configurations The init process is always assigned a process ID number of 1 Relies on the /etc/inittab file for configuration information After the init process starts, it begins by accessing the /etc/init.d/boot script Controls the start of services SUSE Linux Enterprise Desktop Administration

9 init (continued) After the boot script has been completed, init starts the /etc/init.d/rc script Uses configured runlevels to start services and daemons Each runlevel has its own set of services that are initiated SUSE Linux Enterprise Desktop Administration

10 Objective 2—GRUB (Grand Unified Bootloader)
To manage GRUB, the Grand Unified Bootloader, you need to know the following: What a Boot Manager Is Boot Managers in SUSE Linux Start the GRUB Shell Modify the GRUB Configuration File Configure GRUB with YaST Boot a System Directly into a Shell SUSE Linux Enterprise Desktop Administration

11 What a Boot Manager Is Boot loader
A program that loads the operating system into memory Loads the operating system kernel, which then loads the system After running the power-on self test (POST), the PC BIOS searches for a boot loader If it finds one, it turns control of the boot process over to the boot loader The boot loader then locates the operating system files and starts the operating system SUSE Linux Enterprise Desktop Administration

12 What a Boot Manager Is (continued)
More than a boot loader Can also handle several operating systems Linux boot managers can be used to load Linux or other operating systems GRUB is designed with the following two-stage architecture: Stage 1—Usually installed in the Master Boot Record (MBR) of the hard disk Stage 2—Usually contains the actual boot loader SUSE Linux Enterprise Desktop Administration

13 Boot Managers in SUSE Linux
GRUB boot manager The standard boot manager in SUSE Linux Enterprise Desktop Some special features of GRUB: File system support Interactive control LILO boot manager LILO configuration file is /etc/lilo.conf Structure is similar to that of the GRUB configuration file SUSE Linux Enterprise Desktop Administration

14 Boot Managers in SUSE Linux (continued)
Map files, GRUB, and LILO The kernel is usually a file within a file system on a partition on a disk These concepts are unknown to the BIOS Maps simply note the physical block numbers on the disk that comprise the logical files When a map is processed, the BIOS loads all the physical blocks in sequence as noted in the map Building the logical file in memory GRUB tries to become independent from the fixed maps at an early stage SUSE Linux Enterprise Desktop Administration

15 Start the GRUB Shell Start the GRUB shell in the running system
Enter the grub command as root As in a bash shell, you can complete GRUB shell commands with the Tab key Start the GRUB shell at the boot prompt From the graphical boot selection menu, press Esc A text-based menu appears Start the GRUB shell by typing c (U.S. keyboard layout) SUSE Linux Enterprise Desktop Administration

16 Modify the GRUB Configuration File
Configure GRUB by editing the /boot/grub/menu.lst file General structure of the file: General options Options for the various operating systems that can be booted with GRUB kernel /boot/vmlinuz initrd /boot/initrd SUSE Linux Enterprise Desktop Administration

17 Configure GRUB with YaST
To start the YaST Boot Loader module Start YaST, enter the root password, and then select System > Boot Loader or Start it directly from a terminal window by logging in as root and entering yast2 bootloader Select the Section Management tab to see the current GRUB settings for your system SUSE Linux Enterprise Desktop Administration

18 SUSE Linux Enterprise Desktop Administration
Figure 11-2 YaST Boot Loader module SUSE Linux Enterprise Desktop Administration

19 SUSE Linux Enterprise Desktop Administration
Figure 11-3 Section Management SUSE Linux Enterprise Desktop Administration

20 SUSE Linux Enterprise Desktop Administration
Figure 11-4 Clone Selected Section SUSE Linux Enterprise Desktop Administration

21 SUSE Linux Enterprise Desktop Administration
Figure 11-4 Clone Selected Section SUSE Linux Enterprise Desktop Administration

22 SUSE Linux Enterprise Desktop Administration
Figure 11-5 Boot Loader Installation tab SUSE Linux Enterprise Desktop Administration

23 Boot a System Directly into a Shell
Boot screen of the GRUB boot loader: Lets you enter parameters that modify the behavior of the Linux kernel At the bottom of the GRUB boot screen is the Boot Options field To add a boot option, select an operating system and type the additional boot option in the Boot Options field With the boot parameter init=new_init_program, you can change the first program loaded by the kernel SUSE Linux Enterprise Desktop Administration

24 Boot a System Directly into a Shell (continued)
You are directly logged in as root without being asked for a password Change the boot configuration to require a password before the kernel command line can be edited SUSE Linux Enterprise Desktop Administration

25 Exercise 11-1: Manage the Boot Loader
In this exercise, you practice booting into a shell and modifying /boot/grub/menu.lst SUSE Linux Enterprise Desktop Administration

26 Objective 3—Manage Runlevels
Managing runlevels is an essential part of Linux system administration In this objective, you learn what runlevels are, the role of the program init, and how to configure and change runlevels: The init Program and Linux Runlevels init Scripts and Runlevel Directories Change the Runlevel SUSE Linux Enterprise Desktop Administration

27 The init Program and Linux Runlevels
The system is initialized by /sbin/init Started by the kernel as the first process of the system This process, or one of its child processes, starts all additional processes SIGKILL has no effect on init The configuration file for init is /etc/inittab Part of the configuration in /etc/inittab is the runlevel the system uses after booting SUSE Linux Enterprise Desktop Administration

28 The init Program and Linux Runlevels (continued)
The runlevels Runlevels define the state of the system Table 11-1 The available runlevels SUSE Linux Enterprise Desktop Administration

29 The init Program and Linux Runlevels (continued)
Init configuration file (/etc/inittab) Each line in the /etc/inittab file uses the following syntax: id:rl:action:process The first entry in the /etc/inittab file contains the following parameters: id:5:initdefault: The next entry in /etc/inittab looks like this: si::bootwait:/etc/init.d/boot The next few entries describe the actions for runlevels 0 to 6 The final block of entries describes in which runlevels getty processes (login processes) are started SUSE Linux Enterprise Desktop Administration

30 init Scripts and Runlevel Directories
/etc/inittab defines the runlevel the system uses after booting is complete init scripts The /etc/init.d/ directory contains shell scripts that are used to perform certain tasks at bootup and start and stop services in the running system The shell scripts can be called up in the following ways: Directly by init when you boot the system Indirectly by init when you change the runlevel Directly by /etc/init.d/script parameter SUSE Linux Enterprise Desktop Administration

31 init Scripts and Runlevel Directories (continued)
Table 11-2 /etc/init.d/script parameters SUSE Linux Enterprise Desktop Administration

32 init Scripts and Runlevel Directories (continued)
init scripts (continued) Some of the more important scripts stored in /etc/init.d/: boot boot.local halt rc service SUSE Linux Enterprise Desktop Administration

33 init Scripts and Runlevel Directories (continued)
Runlevel symbolic links To enter a certain runlevel, init calls the /etc/init.d/rc script with the runlevel as a parameter This script examines the respective runlevel /etc/init.d/rcx.d/ directory and starts and stops services depending on the links in this directory Each runlevel has a corresponding subdirectory in /etc/init.d/ SUSE Linux Enterprise Desktop Administration

34 init Scripts and Runlevel Directories (continued)
Runlevel symbolic links (continued) When you view the files in a directory such as /etc/init.d/rc3.d/, you see two kinds of files Those that start with a ‘‘K’’ and those that start with an ‘‘S’’ Entering ls -l in an /etc/init.d/rcx.d/ directory indicates that these files are actually symbolic links By using symbolic links in subdirectories, only the script version in /etc/init.d/ needs to be modified Usually, two links within a runlevel directory point to the same script SUSE Linux Enterprise Desktop Administration

35 init Scripts and Runlevel Directories (continued)
When you change from your current runlevel 5 to the new runlevel 3, three cases are possible: There is a Kxx link for a certain service in /etc/init.d/rc5.d/ and there is an Sxx link in /etc/init.d/rc3.d/ for the same service In this case, the service is neither started nor stopped There is a Kxx link for a certain service in /etc/init.d/rc5.d/ and there is no corresponding Sxx link in /etc/init.d/rc3.d/ In this case, the script in /etc/init.d/service is called with the stop parameter and the service is stopped SUSE Linux Enterprise Desktop Administration

36 init Scripts and Runlevel Directories (continued)
When you change from your current runlevel 5 to the new runlevel 3, three cases are possible: (continued) There is an Sxx link in /etc/init.d/rc3.d/ and there is no corresponding Kxx link for the service in /etc/init.d/rc5.d/ In this case, the script in /etc/init.d/service is called with the start parameter and the service is started The number after the K or S determines the sequence in which the scripts are called SUSE Linux Enterprise Desktop Administration

37 init Scripts and Runlevel Directories (continued)
Activate and deactivate services for a runlevel Possible to manually create the symbolic links in the runlevel subdirectories with the ln command To configure runlevels with YaST Start the YaST Runlevel Editor module by starting YaST and then selecting System>System Services (Runlevel) Or open a terminal window and, as root, enter yast2 runlevel Modes Simple mode Expert mode SUSE Linux Enterprise Desktop Administration

38 SUSE Linux Enterprise Desktop Administration
Figure 11-6 The YaST Runlevel Editor module SUSE Linux Enterprise Desktop Administration

39 SUSE Linux Enterprise Desktop Administration
Figure 11-7 The YaST Runlevel Editor module in expert mode SUSE Linux Enterprise Desktop Administration

40 init Scripts and Runlevel Directories (continued)
Activate and deactivate services for a runlevel (continued) Normally, the default runlevel of a SUSE Linux system is runlevel 5 Changes to the default runlevel take effect the next time you boot your computer To configure a service, select a service from the list Then, from the options below the list, select the runlevels you want associated with the service SUSE Linux Enterprise Desktop Administration

41 Change the Runlevel Change the runlevel at boot
Possible to boot to another runlevel by specifying the runlevel on the kernel command line of GRUB Manage runlevels from the command line Can change to another runlevel once the system is running by using the init command Like most modern operating systems, Linux reacts sensitively to being switched off without warning The shutdown command shuts down the system after the specified time SUSE Linux Enterprise Desktop Administration

42 Exercise 11-2: Manage Runlevels
In this exercise, you practice configuring runlevels SUSE Linux Enterprise Desktop Administration

43 Summary After performing a POST, the BIOS typically loads the boot manager from the MBR The traditional Linux boot manager is LILO To manage LILO, you can edit the /etc/lilo.conf file and run the lilo command A Linux system is categorized using runlevels The init program is responsible for loading and unloading daemons in a runlevel using its configuration file /etc/inittab SUSE Linux Enterprise Desktop Administration

44 Summary (continued) The /etc/inittab file runs scripts that start with S (start) or K (kill) in the /etc/init.d/rcrunlevel.d directory when changing runlevels You can view your current runlevel using the runlevel or who -r commands Individual daemons can be started by running the appropriate script in the /etc/init.d directory with the start argument The halt, poweroff, reboot, and shutdown commands can be used to safely change to runlevel 0 or 6 SUSE Linux Enterprise Desktop Administration


Download ppt "SUSE Linux Enterprise Desktop Administration"

Similar presentations


Ads by Google