Booting and boot levels

Slides:



Advertisements
Similar presentations
Introduction to Linux Linux startup process Unix Shells and scripts.
Advertisements

Basic Unix system administration
Booting and Shuting Down WeeSan Lee. Roadmap Bootstrapping Boot Loaders Startup/Init Scripts Reboot & Shutdown Q&A.
Genesis: from raw hardware to processes System booting sequence: how does a machine come into life.
Chapter 9: Understanding System Initialization The Complete Guide To Linux System Administration.
Week 8 System Initialization and X Windows. Objectives  Summarize the major steps necessary to boot a Linux system  Configure the LILO and GRUB boot.
Booting and Shutting Down the UNIX Operating System Arcadio A. Sincero Jr. 6/6/2001 CMSC 691X, Section 6080.
Linux+ Guide to Linux Certification Chapter Nine System Initialization.
Linux Booting Procedure
Linux can be generally divided into four major components: 1. KERNEL – OS, ultimate boss The kernel is the core program that runs programs and manages.
Linux+ Guide to Linux Certification, Third Edition
LinuxChix System Startup and Recovery. What happens at startup? ● The BIOS loads and runs the MBR ● A series of "bootstrap" programs are loaded – see.
Chapter 2 Booting and Shutting Down Kim Grempler (Sections 2.0 to 2.3) Leon Dague (Sections 2.4 to 2.7)
Introduction to Linux Init Scripts In this session we will cover the Linux initialization process, run levels, how to change the run level and how to initialize.
Linux Intro Linux, the do it yourself OS Linux, successor to MINIX Linux, Unix for the masses (PC users) History:
Linux Boot Up Process Bootstrapping –Bootstrapping is the standard term for “ starting up a computer”. During bootstrapping, the kernel is loaded into.
Chapter 10 Linux 10.1 User Interface Administration
Starting and Stopping Linux. Boot Process BIOS initializes hardware –Loads the boot sector MBR loads the bootloader –Point to kernel Kernel initializes.
Processes & Daemons Chapter IV / Part III. Commands Internal commands: alias, cd, echo, pwd, time External commands, code is in a file: grep, ls, more.
Va-scanCopyright 2002, Marchany Unit 4 – The Boot Process Randy Marchany VA Tech Computing Center.
System Startup and Shutdown
Linux System Administration LINUX SYSTEM ADMINISTRATION.
Linux Operations and Administration
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.
Linux Filesystem Management
System Startup & Shutdown Objectives –to interpret the Unix startup and shutdown configuration files –to be able to create a customised run level Contents.
E X C E E D I N G E X P E C T A T I O N S RUNLEVELS Linux System Administration Dr. Hoganson Kennesaw State University A runlevel is a mode of operation.
Guide to Linux Installation and Administration, 2e1 Chapter 8 Basic Administration Tasks.
1 Linux Basics for Networking. 2 Module - Linux Basics for Networking ♦ Overview This module focuses on the basics of networking using Redhat Enterprise.
System Administration: Core Concepts Chapter 11. Introduction  What is the job of the system administrator?  Keep one or more systems in a useful and.
2/19/2003 Lecture 3 Computer System Administration Lecture 3 Setup (continued)
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2010 by Scott Orr and the Trustees of Indiana University.
The Linux Operating System Lecture 3: Becoming the Superuser and Users and Groups The Tonga Institute of Higher Education.
Basic Router Configuration 1.1 Global configuration Cisco allows us to configure the router to support various protocols and interfaces. The router stores.
Guide to Linux Installation and Administration1 Chapter 4 Running a Linux System.
System Startup & Shutdown
UNIX (Linux) Introduction Module-1. OS Kernel In computing, the kernel is the central component of OS. It is a bridge between applications and the actual.
ITI Chris Uriarte ITI-481: Unix Administration Meeting 2 Rutgers University Center for Applied Computer Technologies Chris Uriarte, Instructor.
Chapter 3 & 6 Root Status and users File Ownership Every file has a owner and group –These give read,write, and execute priv’s to the owner, group, and.
A Practical Guide to Fedora and Red Hat Enterprise Linux Unit 9: Basic Linux Administration Chapter 11: System Administration: Core Concepts Chapter 16:
Linux Startup Process Presenter: Dipu Gupta.
Core System Services. INIT Daemon The init process is the patron of all processes. first process that gets started in any Linux/ UNIX -based system.
70 Starting Network Services Version A.01 H3065S Module 7 Slides.
Linux booting How does it work?. First the bootloader The first step is for the bootloader to run BIOS indicates what devices to examine Bootstrap program.
Chap 11 System Admin: Core Concepts. A well-maintained system… Runs quickly enough so users don’t get frustrated Has enough storage to accommodate users’
System Administration. Logging in as System Administrator System Admin login (aka superuser, aka root) –login id: root –Default PS1 prompt: # –Home directory:
Runlevel initialization. Boot to Linux Grub interface.
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2009 by Scott Orr and the Trustees of Indiana University.
135 Shutdown and Reboot Version A.01 H3064S Module 17 Slides.
Unix System Administration Booting and Shutting Down Chapter 2.
Sys Admin Course Service Management Fourie Joubert.
1 Figure 6-5: Turning Off Unnecessary Services Unnecessary Services  Operating system vendors used to install many services by default  This made them.
Basic UNIX system administration CS 2204 Class meeting 14 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
System initialization Unit objectives A.Outline steps necessary to boot a Linux system, configure LILO and GRUB boot loaders, and dual boot Linux with.
Using Networks. Assignment Issues find syntax Permissions HW4 3c /proc vs /tmp vs /var.
Introduction to networking (Yarnfield) Configure a router.
The Linux startup process Jerry Feldman The Linux Expertise Center Hewlett-Packard Company Document produced via OpenOffice.org.
System Administration Startup Process. Why Care? ● Every process on your system comes about by following a specific chain of events from the machine startup.
Getting Started with Linux
The Linux Kernel About 6 million lines of code
Chap-I Network and System Configuration in Linux
System Programming and administration CS 308
Advanced Operating Systems
Linux Start Sequence Summary
Chapter 4 Booting and Shutdown
OPS235: Week 1 Installing Linux (Lab1: Investigations 4 - )
SUSE Linux Enterprise Desktop Administration
LINUX SYSTEM ADMINISTRATION
Linux Filesystem Management
Objectives Topic 2.6 Understanding the boot process
Presentation transcript:

Booting and boot levels

…The Boot Process Linux uses the init command and a directory structure based on run-levels to start running the system and loading processes 21/04/2017

The Initialisation Process… System States (or run levels) on early UNIX systems grew out of a need to separate how the system ran depending on the maintenance being performed Usually, this meant that to add new hardware (or software) a system reboot was necessary Today, with hot swappable devices, it is not strictly necessary to reboot systems in order to install new hardware or software 21/04/2017

…The initialisation Process… The /etc/inittab file contains settings for the init process and also defines the run levels for a Linux system 21/04/2017

/etc/inittab file # Default runlevel. The runlevels used by RHS are: # 0 - halt (Do NOT set initdefault to this) # 1 - Single user mode # 2 - Multiuser, without NFS (The same as 3, if you do not have networking) # 3 - Full multiuser mode # 4 - unused # 5 - X11 # 6 - reboot (Do NOT set initdefault to this) # 21/04/2017

init process init is sometimes referred to as the ‘father of all processes’ init is responsible for creating processes from a script stored in /etc/inittab Linux init command is compatible with the System V init command init starts as the last step of the kernel booting init is the first command that initialises and configures the system for use 21/04/2017

init process Init works by parsing the /etc/inittab file and by running scripts in the /etc/rc.d directories depending on the required run level Each individual script is designed to start or stop and individual service such as networking, mail, news, web, nfs, dhcp etc. 21/04/2017

/etc/rc.d directory The /etc/rc.d directory contains the following files: rc, rc.local, rc.sysinit And the following directories: init.d rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d 21/04/2017

Startup Scripts One of the most important scripts in /etc/inttab is rc.sysinit When init parses the inittab file, rc.sysinit is the first script found and executed 21/04/2017

rc.sysinit script Sets some initial $PATH variables Configures Networking Sets up Swapping for Virtual Memory Sets the system hostname Checks root file systems for possible repairs Checks root filesystem quotas Turns on user and group quotas for root file system 21/04/2017

rc.sysinit script Remounts the root filesystem read/write Clears the mounted filesystems table /etc/mtab Enters the root filesystem into mtab Readies the system for loading modules Finds module dependencies Checks filesystems for possible repairs Mounts all other file systems 21/04/2017

rc.sysinit script Deletes UUCP lock files Deletes stale subsystem files Deletes stale pid files Sets the system clock Turns on swapping Initialises the serial ports Loads Modules 21/04/2017

rc.local script After the rc.sysinit script is run, init runs the rc.local script to carry out any site-specific operations that may be required upon system startup rc.local may examine the local system and create a message for the login prompt based on the hardware and software versions found If it does, it will put such details in the file /etc/issue which may be displayed on login 21/04/2017

Run Level 0: /etc/rc.d/rc0.d Starts the shutdown sequence Kills All Processes Turns off Virtual Memory File Swapping Unmounts swap and mounted file systems 21/04/2017

Run Level 1: /etc/rc,d/rc1.d Single user mode, or administrative state Used by sys admins while performing software maintenance Nobody else can log in Networking is turned off, but file systems are mounted 21/04/2017

Run Level 2: /etc/rc.d/rc2.d Multiuser state Networking is enabled, NFS is disabled 21/04/2017

Run Level 3: /etc/rc.d/rc3.d Usually the default run level specified as the first line in the /etc/inittab file Remote file sharing is enabled along with all other desired services 21/04/2017

Run Level 4: /etc/rc4.d Usually empty, not used If you want to define your own run level, this can be used to set up the appropriate links 21/04/2017

Run Level 5: /etc/rc.d/rc5.d Similar to the default run level, but with the named (internet DNS server) Usually the default run level for X11 21/04/2017

Run Level 6: /etc/rc5.d Reboot run level Contains links similar to level 0, but logic in the halt script in init.d determines whether the system is being shut down or rebooted 21/04/2017

Run Levels… Each run-level is defined by the services (daemons) that are normally running in that level The services to stop and start for each run level are defined in the rcX.d directories mentioned above These directories contain symbolic links to master scripts contained in the /etc/rc.d/init.d directory 21/04/2017

…Run Levels… The symbolic links contained in the rcX.d directories must be named so as to start with capital K or capital S For example: rc3.d contains the following symbolic links: K05saslauthd K87portmap S10network S25netfs S80sendmail S95anacron Any other files or symbolic links contained in the rcX.d directories will be ignored by the rc script 21/04/2017

…Run Levels… In addition to the inclusion of K or S at the start of the symbolic links, the file names also carry a number between 00 and 99 The combination of K or S followed by a number means that when the files are listed alphabetically, they appear in a particular order This order determines the order in which the scripts are run by the rc script 21/04/2017

…Run Levels When a symbolic link beginning with K is encuntered, rc runs that script with the stop parameter When a symbolic link beginning with S is encountered, rc runs that script with the start parameter 21/04/2017

/etc/rc/d/init.d directory This directory contains the master copies of all the scripts that may contain symbolic links in the rcX.d directories 21/04/2017

Adding Services to Run Levels If we want a service to start in a given run level we must: Create or copy the start/stop/status script to the /etc/rc.d/init.d directory Create a symbolic link in the required run level directory to start the script in the appropriate sequence ln -s /etc/rc.d/init.d/isdn /etc/rc.d/rc3.d/S20isdn 21/04/2017

Init Specify the run-level to put the machine into 21/04/2017

Shutdown shutdown [-krhfnc] [-t secs] time [warning message] -k: Don’t really shut down, just warn -r: reboot after shutdown -h: halt after shutdown -f: do a ‘fast’ reboot -n: do not go through ‘init’ but go down real fast -c: cancel a running shutdown -t <sec>: delay between warning and kill signal Shutdown –t60 –r now 21/04/2017

Halt Notifies the kernel of a shutdown or reboot 21/04/2017

Reboot Symbolic link to halt 21/04/2017