Title: SUSE Linux Enterprise Server Administration Course 3037
1SUSE Linux Enterprise Server Administration
(Course 3037)
- Chapter 5
- Manage System Initialization
2Objectives
- Describe the Linux Load Procedure
- Manage Runlevels
- Manage the Kernel
- Manage the GRUB Boot Loader
- Modify System Settings
3Describe the Linux Load Procedure
- Objectives
- BIOS and Boot Manager
- Kernel
- initrd and linuxrc
- init
4Describe the Linux Load Procedure (continued)
5Describe the Linux Load Procedure (continued)
- BIOS and Boot Manager
- Tasks performed by the BIOS
- Power-on self-test
- Initial detection and setup of hardware
- Accessing bootable devices
- BIOS also reads the MBR (Master Boot Record)
- BIOS starts the boot manager
- Using the code in the MBR
- Boot manager (such as GRUB)
- Loads the kernel and the initrd to memory and
starts the kernel
6Describe the Linux Load Procedure (continued)
- Kernel
- Uncompresses itself
- Organizes and takes control of the continued
booting of the system - Checks and sets the console
- Reads BIOS settings
- Initializes basic hardware interfaces
- Probes existing hardware and initialize it
accordingly - Manages hardware access
- Allocates CPU time and memory to programs
7Describe the Linux Load Procedure (continued)
- initrd and linuxrc
- Boot manager informs the kernel that an initrd
exists - And where it is located in memory
- If initrd exists, it is integrated into the
kernel - Kernel decompresses the initrd
- And mounts it as a temporary root file system
- linuxrc
- Loads modules required to mount root file system
- May be dynamically linked
- As soon as linuxrc finishes
- initrd is unmounted and the boot process continues
8Describe the Linux Load Procedure (continued)
- init
- Boots the system with all its programs and
configurations - init process has ID number of 1
- /etc/inittab file
- Configuration file
- /etc/init.d/boot script
- Controls the start of services
- /etc/init.d/rc script
- Uses configured runlevels to start services and
daemons
9Manage Runlevels
- Objectives
- Runlevel Basics
- How to Change the Runlevel at Boot
- How to Manage Runlevels from the Command Line
- How to Shut Down or Halt the System
- How to Set Runlevels with YaST
10Runlevel Basics
- What runlevels are
- Various runlevels define the state of the system
- init configuration file (/etc/inittab)
- Determines what happens on individual runlevels
- Syntax idrlactionprocess
- Standard entries parameters
- initdefault
- bootwait
- wait
- ctrlaltdel
- respwan
11Runlevel Basics (continued)
12Runlevel Basics (continued)
- init scripts
- Located in the directory /etc/init.d/
- Scripts can be called up
- Directly by init when you boot the system
- Indirectly by init when you change the runlevel
- Directly by the /etc/init.d/ script start or stop
commands - Some of the most important script include
- boot
- boot.local
- boot.setup
- halt
- rc
13Runlevel Basics (continued)
14Runlevel Basics (continued)
15Runlevel Basics (continued)
- Runlevel symbolic links
- Each runlevel has a subdirectory in /etc/init.d/
- Types of files
- Sxxservice
- Kxxservice
- Point to service scripts in /etc/init.d/
- Some links point to the same script
16Runlevel Basics (continued)
17Runlevel Basics (continued)
18Runlevel Basics (continued)
19Runlevel Basics (continued)
- How init determines which services to start and
stop - Script /etc/init.d/rc examines directories
- /etc/init.d/rccurrentrl.d/ and /etc/init.d/rcnewrl
.d - Options
- Kxx link in /etc/init.d/rccurrentrl.d/ and Sxx
link in /etc/init.d/rcnewrl.d/ for the same
service - Script in /etc/init.d/ is not called at all
- Kxx link in /etc/init.d/rccurrentrl.d/ and no Sxx
link in /etc/init.d/rcnewrl.d/ - Stop script in /etc/init.d/service
- Sxx link in /etc/init.d/rcnewrl.d/ and no Kxx
link in /etc/init.d/rccurrentrl.d/ - Start script in /etc/init.d/service
20Runlevel Basics (continued)
- Activate and deactivate services for a runlevel
- Use command insserv or YaST
- INIT INFO block at the beginning of script
- Determines in which runlevel the service should
start or stop - Used by insserv
- Use insserv after editing the INIT INFO block
- To create the needed links and renumber the
existing ones as needed - Use /etc/init.d/service stop, and then insserv -r
service - To remove all links for a service
21How to Change the Runlevel at Boot
- The standard runlevel is 3 or 5
- GRUP choices
- Linux
- Floppy
- Failsafe
- Entry Linux options
- root
- vga
- runlevel
- Example root/dev/hda4 vga791 1
22How to Manage Runlevels from the Command Line
- Change to another runlevel
- Using command init
- Stop the system
- Entering init 0
- Restart the system
- Entering init 6
- Ctrl Alt Backspace
- Restarts the X Window system
- Restart graphical system
- Enter init 5
23How to Shut Down or Halt the System
- System should always be shut down properly
- Command shutdown
- Controls the shutdown of the system
- Informs all users that the system will be shut
down - Does not allow other users to log in before it
shuts down
24How to Shut Down or Halt the System (continued)
25How to Set Runlevels with YaST
- Steps
- Start YaST Runlevel Editor module
- Switch to the Expert mode
- Select a new default runlevel (optional)
- Select a service and runlevels associated with it
- Select Start Now, Stop Now, or Refresh status
(optional) - Enable, disable the service
26How to Set Runlevels with YaST (continued)
27How to Set Runlevels with YaST (continued)
28Exercise 5-1 Manage Run Levels
- In this exercise you will manage run levels
29Manage the Kernel
- Objectives
- Kernel Module Basics
- How to Find Hardware Driver Information
- How to Manage Modules from the Command Line
- modprobe Configuration File (/etc/modprobe.conf)
- Kernel Module Loader (kmod)
30Kernel Module Basics
- Kernel is installed in directory /boot/
- Drivers can be compiled into the kernel
- Or be loaded as kernel modules
- Kernel modules are in lib/modules/version/kernel/
- Files and directories related to the kernel
- /boot/initrd
- /boot/vmlinuz
- /proc/sys/kernel/
- /proc/version
- /usr/src/linux/
31How to Find Hardware Driver Information
- Command hwinfo
- Detects the hardware of your system
- Selects the drivers needed to run this hardware
- Syntax
- hwinfo --hardware_type
- hwinfo --help (for a short introduction to the
command)
32Exercise 5-2 View Information about the Hardware
System
- In this exercise, you do the following
- Part I View General Information about the
Hardware System - Part II View Information about Specific Hardware
33How to Manage Modules from the Command Line
- lsmod
- Lists the currently loaded modules in the kernel
- insmod module
- Loads the indicated module into the kernel
- rmmod module
- Removes the indicated module from the kernel
- modprobe module
- Loads the indicated module into the kernel
- Or removes it (with option -r)
34How to Manage Modules from the Command Line
(continued)
- depmod
- Creates the file /lib/modules/version/modules.dep
- modinfo option module
- Displays information about the module indicated
35modprobe Configuration File (/etc/modprobe.conf)
- /etc/modprobe.conf
- Configuration file for the kernel modules
- Command types
- install
- Lets modprobe execute commands when loading a
specific module into the kernel - alias
- Determine which kernel module will be loaded for
a specific device file - options
- Options for loading a module
36Kernel Module Loader (kmod)
- kmod
- Most elegant way to use modules
- Performs background monitoring
- Makes sure modules are loaded by modprobe
- Activate kmod
- Option Kernel module loader needs to be set to
y (yes) - In the kernel configuration
- kmod is not designed to unload modules
automatically
37Exercise 5-3 Manage the Linux Kernel
- In this exercise, you view information about your
kernel, and load and unload kernel modules
38Manage the GRUB Boot Loader
- Objectives
- What a Boot Manager Is
- Boot Managers in SUSE Linux
- How to Start the GRUB Shell
- How to Modify the GRUB Configuration File
- How to Configure GRUB with YaST
39What a Boot Manager Is
- Boot loader
- Loads the operating system kernel
- Which then loads the system
- Locates the operating system files on the hard
drive - And starts the operating system
- Boot manager
- Can handle several operating systems
- Two-stage architecture
- Stage 1 contains code to load stage 2
- Stage 2 contains the actual boot manager
40Boot Managers in SUSE Linux
- GRUB Boot Manager
- Standard boot manager in SLES
- GRUB features include
- File system support
- Interactive control
- LILO Boot Manager
- Configuration file is /etc/lilo.conf
- Structure similar to GRUB configuration file
41Boot Managers in SUSE Linux (continued)
- Map files, GRUB, and LILO
- Kernel is a file within a file system on a
partition - Concepts unknown to the BIOS
- Maps
- Note physical block numbers on disk that comprise
logical files - BIOS loads all blocks listed in maps
- LILO relies entirely on maps
- GRUB tries to become independent from maps at an
early stage
42Boot Managers in SUSE Linux (continued)
- Additional information
- Linux system
- Manual pages and info file
- README files
- In the directory /usr/share/doc/packages/grub/
- In the directory /usr/share/doc/packages/lilo/
- Internet sites
- www.gnu.org/software/grub/
43How to Start the GRUB Shell
- From a running system
- Enter command grub as root
- Command find
- Finds out which partition contains the kernel
- Close GRUB shell by entering quit
- From the boot prompt
- From the graphical boot selection menu, press Esc
- A text-based menu appears
- Start the GRUB shell by typing c
44How to Modify the GRUB Configuration File
- Edit file /boot/grub/menu.lst structure
- File structure
- General options
- Options for various operating systems
- That can be booted with the GRUB
45How to Configure GRUB with YaST
- Steps
- Start YaST Boot Loader Configuration module
- Add, edit, or delete an option
- Display and edit the configuration files
(optional) - Select additional boot options (optional)
46How to Configure GRUB with YaST (continued)
47Exercise 5-4 Manage the Boot Loader
- In this exercise you do the following
- Part I Pass Kernel Parameters to the Boot Loader
- Part II Configure Boot Managers
48Modify System Settings
- Tasks involved
- View and Change System Settings (/proc/sys/)
- Modify Kernel and Hardware Parameters with
Powertweak - Configure /etc/sysconfig/ Files with YaST
49View and Change System Settings (/proc/sys/)
- Files in /proc/ and /proc/sys/ are kept in memory
- Changes to these files are lost after a reboot
- View the current configuration
- Use cat and less to view files in /proc/sys/
- Use sysctl to view modifiable values below
/proc/sys/ - Edit the current configuration
- Use echo to edit individual configuration values
- You can also use sysctl
- Use sysctl to load and set kernel parameters
- Execute script
- Activate it by entering insserv d boot.sysctl
50Modify Kernel and Hardware Parameters with
Powertweak
- Steps
- Start YaST Powertweak Configuration module
- Create the Powertweak configuration file
- Find a parameter
- Select or enter the setting
- Find and configure other setting (optional)
- Review and save the changes
51Modify Kernel and Hardware Parameters with
Powertweak (continued)
52Modify Kernel and Hardware Parameters with
Powertweak (continued)
53Modify Kernel and Hardware Parameters with
Powertweak (continued)
54Modify Kernel and Hardware Parameters with
Powertweak (continued)
55Configure /etc/sysconfig/ Files with YaST
- Changes to system configuration with YaST happen
in one of the following ways - Direct modification of configuration files
- YaST modifies the configuration files in
/etc/sysconfig/ - Directory /etc/sysconfig/
- Saves majority of configuration settings for SLES
- Edit these files by using
- YaST modules
- YaST module /etc/sysconfig Editor
56Configure /etc/sysconfig/ Files with YaST
(continued)
- Steps
- Start YaST /etc/sysconfig Editor module
- Find a setting
- Select or enter a setting
- Find and configure other settings
- Select Confirm Each Activation Command
- Review and save changes
57Configure /etc/sysconfig/ Files with YaST
(continued)
58Configure /etc/sysconfig/ Files with YaST
(continued)
59Configure /etc/sysconfig/ Files with YaST
(continued)
60Exercise 5-5 Change the Power Setting with YaST
- In this exercise you will change the power
setting of your SLES system using YaST
61Summary
- The boot manager starts the Linux kernel
- A Linux system is categorized using runlevels
- init daemon
- Loads and unloads daemons using its configuration
file /etc/inittab - /etc/inittab file
- Runs scripts in the /etc/init.d/rcrunlevel.d
- View current runlevel
- Using the runlevel command
62Summary (continued)
- Start individual daemons
- By running script in the /etc/init.d with start
argument - Or by using the rcdaemonname start command
- Device drivers are either
- Compiled into the Linux kernel
- Loaded into the kernel as modules
- Linux kernel is loaded into memory during system
initialization - By a boot loader or boot manager
63Summary (continued)
- LILO
- Traditional Linux boot manager
- GRUB boot loader
- Used by default in SLES
- /etc/lilo.conf file
- LILO configuration file
- /proc/sys/ directory
- Exists in memory
- Contains information and settings for a running
system