The Linux IPL Procedure

Similar documents
Certification. System Initialization and Services

CST8177 Linux II. Linux Boot Process

Linux+ Guide to Linux Certification, Third Edition. Chapter 2 Linux Installation and Usage

System Administration. Startup Process

CompTIA Linux+ Guide to Linux Certification Fourth Edition. Chapter 2 Linux Installation and Usage

Booting up and Shutting down A primer for troubleshooting

MODULE 02. Installation

CSE 265: System and Network Administration

CSE 265: System and Network Administration

RHCE BOOT CAMP. The Boot Process. Wednesday, November 28, 12

HOW LINUX BOOTS. As it turns out, there isn t much to the boot process:

Chapter 6. Boot time configuration. Chapter 6 Boot time configuration

Saving Your Bacon Recovering From Common Linux Startup Failures

Introduction to Linux start-up. Hao-Ran Liu

SysadminSG RHCSA Study Guide

More on file systems, Booting Todd Kelley CST8177 Todd Kelley 1

More on file systems, Booting Todd Kelley CST8177 Todd Kelley 1

Booting Up and Shutting Down. lctseng / Liang-Chi Tseng

If you don't care about how it works but you just would like that it works read here. Other wise jump to the next chapter.

The Linux Boot Process

Chapter 02 Linux Installation and Usage

Using grub to Boot various Operating Systems

Chapter 7. Getting Started with Boot from Volume

Advanced Unix System Administration

Chapter 2 Booting Up and Shutting Down

The table below lists the domains measured by this examination and the extent to which they are represented in the examination.

Basic UNIX system administration

Please choose the best answer. More than one answer might be true, but choose the one that is best.

Disks, Filesystems 1

Runlevels, System Shutdown and Reboot

Exam Name: Red Hat Certified Engineer on Redhat

CompTIA Linux Course Overview. Prerequisites/Audience. Course Outline. Exam Code: XK0-002 Course Length: 5 Days

client X11 Linux workstation

UNIX System Administration

PL-I Assignment Broup B-Ass 5 BIOS & UEFI

Managing the Linux Boot Process

Critical Analysis and last hour guide for RHCSA/RHCE Enterprise 7

Unit 2: Manage Files Graphically with Nautilus Objective: Manage files graphically and access remote systems with Nautilus

Embedded Linux Architecture

Automatically Logging on a User at Linux System Boot time for Console Management

Guide to Linux+, Fourth Edition Chapter 2 Solutions

Manage Directories and Files in Linux. Objectives. Understand the Filesystem Hierarchy Standard (FHS)

Initialization: runlevels

HP-UX System Administration Course Overview. Skills Gained. Who will the Course Benefit?

At course completion. Overview. Audience profile. Course Outline. : 55187B: Linux System Administration. Course Outline :: 55187B::

"Charting the Course... MOC B: Linux System Administration. Course Summary

"Charting the Course... Enterprise Linux System Administration Course Summary

Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras

Server Consolidation with Xen Farming

Creating a low end server for SOHO.

Linux/Citrix Virtual Environment Documentation

Exam LFCS/Course 55187B Linux System Administration

Course 55187B Linux System Administration

SUSE Advanced Troubleshooting: The Boot Process Lecture

The kernel is not to be confused with the Basic Input/Output System (BIOS).

Booting Up and Shutting Down

Embedded System Design

Disks, Filesystems Todd Kelley CST8177 Todd Kelley 1

Exam Linux-Praxis - 1 ( From )

1 LINUX KERNEL & DEVICES

Disks, Filesystems, Booting Todd Kelley CST8177 Todd Kelley 1

Linux Files and the File System

Virtual Data Center (vdc) Manual

SA2 v6 Linux System Administration II Net Configuration, Software, Troubleshooting

NETW 110 Lab 3 Post-Installation Configuration Page 1

Oracle 1Z Enterprise Linux System Administration. Download Full Version :

Perl and R Scripting for Biologists

Getting Started with Linux

File System Hierarchy Standard (FHS)

The Early System Start-Up Process. Group Presentation by: Tianyuan Liu, Caiwei He, Krishna Parasuram Srinivasan, Wenbin Xu

Thousands of Linux Installations (and only one administrator)

Exam Actual. Higher Quality. Better Service! QUESTION & ANSWER

Prerequisites: General computing knowledge and experience. No prior knowledge with Linux is required. Supported Distributions:

ECE 471 Embedded Systems Lecture 16

Introduction to Linux Init Scripts

HP-UX System Administration

LINUX FUNDAMENTALS (5 Day)

ECE 550D Fundamentals of Computer Systems and Engineering. Fall 2017

ECE 471 Embedded Systems Lecture 16

Unit 2 System startup and shutdown

Installation of the OS

"Charting the Course... RHCE Rapid Track Course. Course Summary

CompTIA Linux+/LPIC-1 COPYRIGHTED MATERIAL

OPERATING SYSTEMS LINUX

Overview of the Cisco NCS Command-Line Interface

Manual File System Check Linux Command Line

The student will have the essential skills needed to be proficient at the Unix or Linux command line.

grub-md5-crypt --help Usage: grub-md5-crypt [OPTION] Encrypt a password in MD5 format.

ENTERPRISE LINUX SYSTEM ADMINISTRATION

CSE 265: System and Network Administration

Linux Installation Planning

RedHat Certified Engineer

Integrated Lights-Out 3 Virtual Serial Port configuration and operation

Installation Tools for Clusters. Rajesh K., Computer Division, BARC

How to Restrict a Login Shell Using Linux Namespaces

Linux for UNIX Administrators

Presented by Bill Genske Gary Jackson

Actual4Test. Actual4test - actual test exam dumps-pass for IT exams

Advanced SUSE Linux Enterprise Server Administration (Course 3038) Chapter 8 Perform a Health Check and Performance Tuning

Chapter 6. Linux File System

Transcription:

The Linux IPL Procedure SHARE - Tampa February 13, 2007 Session 9274 Edmund MacKenty Rocket Software, Inc.

Purpose De-mystify the Linux boot sequence Explain what happens each step of the way Describe why each step exists Tell you how to learn more DASD

General Design Principles Flexibility: uses not thought of by designers Extensibility: accommodate specific end-user needs Reuse-ability: of code and user data Controllability: higher-level code can drive it Portability: can operate in different environments Simplicity: easy to understand, use; limited side-effects

Overview Boot loader Kernel Initial RAM disk Init process Runtime configuration scripts User login

Concepts The Kernel Device drivers Kernel modules Filesystems Mounting a filesystem Processes The onion The two trees Run Levels The online manual

Manual Pages Online manual is a good source of information References to manpages use the form: page(section) Section 1: User Commands Section 2: System Calls Section 3: Library Functions Section 4: Special Files Section 5: File Formats Section 6: Games Section 7: Conventions and Miscellany Section 8: Administrative Commands To learn about init(8), use the command: man 8 init Use info(1) for more information about some commands The appropos(1) and whatis(1) commands do searches Different distros have different manpages available

Linux: The Onion Linux consists of many layers surrounding a kernel

Linux: The Two Trees Linux consists of two trees: Processes and Files Processes inherit properties from their parent Files reside within their parent directory

Structure of the Kernel The Linux kernel is not monolithic All device drivers and many sub-components may be built as modules, which can be loaded or unloaded as needed. This permits one kernel to run efficiently on lots of different hardware. The kernel build process is amazingly configurable. Some core components must be compiled in: Memory management Virtual filesystem layer Process scheduler Multi-processor support TCP/IP networking (if used) Examples of dynamically-loaded modules: Filesystems: ext3, reiserfs, jfs Support for specific hardware: SCSI, DASD, USB, Crypto Network drivers

Processes A unit of execution scheduled by the kernel Each process runs in its own address space Fork: creates a new, child, process Inherits code and data segments Gets copies of all open files, sockets, etc. Process execution returns from fork() call Exec: Loads a new program into a process All open files are closed New code and data segments are allocated Process execution continues at entry point of new program Running a program means a process forks and the child execs the program Process A fork() Process B exec() Process B

Filesystems A logical structure built within a disk partition to manage files Many kinds of filesystems are supported There is one root filesystem: the base of the directory tree A filesystem of any type may be mounted on a directory Mounting is how new storage devices are added Unreferenced filesystems may be unmounted / home root /bin /home /lib /usr... /fred /mack /nms usr /lib /local /X11 bin home lib usr fred mack nms lib local X11

The Boot Loader z/vm IPLs a Boot Loader from DASD zipl(8) is the boot loader for zseries Linux Knows where to find the kernel within the Linux filesystem Passes kernel command-line options Configured in /etc/zipl.conf [zipl.conf(5)] Uses the eckd0 program to store the subchannel address Reads kernel file into memory, jumps to entry point DASD zipl Memory Kernel

Starting the Kernel Kernel is usually in a compressed file Beginning of file is program that uncompresses the rest Kernel builds its memory pools Kernel detects processors, estimates their speed Kernel starts its internal threads Kernel initializes build-in device drivers Drivers do hardware detection Drivers can use kernel command line arguments

The Initial RAM disk What is an initial RAM disk, and why use one? Extra drivers and setup code Useful when entire kernel won't fit on a floppy (for x86) Lets a distro have a single kernel config across all platforms On zseries, initrd loads the DASD device driver Boot loader told kernel where to find initrd Kernel creates a temporary filesystem in memory Unpacks the initrd image into that filesystem Runs the program /linuxrc on it

Initial RAM disks for zseries Loads kernel modules DASD device driver ext3 filesystem LVM drivers Does LVM initialization [see lvm(8), vgscan(8)] Mounts the real root filesystem from DASD Makes the real root filesystem be the system root The mkinitrd(8) tool creates the initrd image

Finishing Kernel Initialization Kernel continues when /linuxrc on the initrd ends Makes the root filesystem read-only, so it can be checked Finds /sbin/init and runs it

Init: process number one Init(8) is the first user-mode process It is the root of the process tree All other processes are started by init or its descendants Reads its configuration file: /etc/inittab [see inittab(5)] Invokes rc-scripts [see init.d(7)] Manages changes between runlevels

Example inittab file (SuSE SLES 8) # The default runlevel is defined here id:3:initdefault: # First script to be executed, if not booting in emergency (-b) mode si::bootwait:/etc/init.d/boot # /etc/init.d/rc takes care of runlevel handling l0:0:wait:/etc/init.d/rc 0 l1:1:wait:/etc/init.d/rc 1 l2:2:wait:/etc/init.d/rc 2 l3:3:wait:/etc/init.d/rc 3 #l4:4:wait:/etc/init.d/rc 4 l5:5:wait:/etc/init.d/rc 5 l6:6:wait:/etc/init.d/rc 6 # what to do in single-user mode ls:s:wait:/etc/init.d/rc S # what to do when CTRL-ALT-DEL is pressed ca::ctrlaltdel:/sbin/shutdown -r -t 4 now ~~:S:respawn:/sbin/sulogin /dev/ttys0 # on S/390 enable console login in all runlevels 1:012356:respawn:/sbin/mingetty /dev/ttys0

What is an rc-script? Runtime configuration scripts live in /etc/init.d Each rc-script manages a distinct service or daemon These are shell scripts (but they don't have to be) Each accepts a single command as an argument: start: starts the service, initializing some resource stop : stops the service, shutting down some resource restart: stops then starts the service status: tells you what state the service is currently in

What Is A Runlevel? A feature of the init(8) program Controls which processes are allowed to run Change to runlevel N with command: init N Runs master rc-script (/etc/init.d/rc) with new runlevel Stops all rc-scripts not in the new runlevel Starts all rc-script that are in the new runlevel Runlevels are implemented by directories containing symbolic links to rc-scripts (/etc/rc?.d) KXXname stops (kills) the service named name. SXXname starts the service named name.

Traditional Set Of Runlevels 0: Halt the system 1: Single user mode 2: Multi-user mode 3: Multi-user with networking 4: (unused) 5: Multi-user with networking and graphical desktops 6: Reboot

Boot-time rc-scripts Run at boot-time from /etc/init.d/rc via init(8) Bring up user-space (non-kernel) resources: Mount /proc and /sys pseudo-filesystems (kernel interfaces) Check the root filesystem [fsck(8)] Initialize the LVM subsystem, searching for devices using LVM [vgscan(8)] Check all remaining filesystems [fsck(8)] Enable any swap devices Re-mount root to be writable Mount all other filesystems as described by /etc/fstab [fstab(5)]

Service rc-scripts Initialize services and daemons for a particular runlevel Bookkeeping daemons: cron periodically run other commands hotplug detect newly-installed devices (DASD being linked) syslog collects logging output from other processes Network services: interfaces assign IP addresses or do DHCP, set up routes NFS mount network filesystems Network daemons: sendmail SMTP daemon listening on port 25 xinetd a meta-daemon listening on many ports, invokes FTP, TELNET... NTP Network Time Protocol daemon using UDP connections Applications: X-Windows Starts an X display manager to provide user desktops WebSphere Starts up a web services engine DB2 Starts one or more database instances

User Logins on Terminals Init(8) starts getty(8) processes on attached terminals Getty(8) sets up serial tty lines, auto-detecting speed, etc. Getty(8) presents a login: prompt Exec's login(1), giving it the username Login(1) gives password: prompt, does authentication If successful, login(1) invokes the user's shell init fork()/exec() getty exec() login exec() bash

User Logins from the Network An rc-script starts sshd(8) processes. Sshd(8) listens on port 22 for network connections Sshd(8) forks a child process to handle each connection SSH client negotiates user credentials with server Child sshd authenticates the user credentials If successful, child sshd forks the user's shell Child sshd continues to encrypt/decrypt data with SSH client init fork()/exec() fork()/exec() /etc/rc sshd fork() sshd fork()/exec() bash

The Linux IPL Procedure Contact Information: Presenter: Company: Ed.MacKenty@RocketSoftware.com http://www.rocketsoftware.com