Booting and Shuting Down WeeSan Lee. Roadmap Bootstrapping Boot Loaders Startup/Init Scripts Reboot & Shutdown Q&A.

Slides:



Advertisements
Similar presentations
Linux Boot Loaders. ♦ Overview A boot loader is a small program that exists in the system and loads the operating system into the system’s memory at system.
Advertisements

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+ Guide to Linux Certification, Second Edition
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.
Booting the Linux Kernel Dr. Michael L. Collard 1.
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Second Edition
CIS238/DL1 Chapter 15 Rebuilding the Linux Kernel Preparing the Source Code Locating the Source Code Installing the Source Code Read the Documentation.
Booting And Shutting Down. Bootstrapping  Bootstrapping is standard term for “starting up a computer”  During bootstrapping the kernel is loaded into.
 Starting up a computer › Load kernel into memory and execute it. (1)BIOS load and run the MBR (Master Boot Record) (2)MBR searches for the bootable.
Startup and Shutdown1-1 Booting and Shutting Down  Bootstrapping m The computer must pull itself up m Automatic and manual booting m Steps in the boot.
Linux+ Guide to Linux Certification, Second Edition Chapter 3 Linux Installation and Usage.
Linux Boot Up Process Bootstrapping –Bootstrapping is the standard term for “ starting up a computer”. During bootstrapping, the kernel is loaded into.
Unix kernel Kernel refers to the core part of an operating system Historically, UNIX kernels are monolithic Newer versions of UNIX allow part of the kernel.
S.Ha.R.K. Workshop28/02/05 S.Ha.R.K. Installation HowTo Tullio Facchinetti University of Pavia - Italy.
Bootloader / multi-boot
Starting and Stopping Linux. Boot Process BIOS initializes hardware –Loads the boot sector MBR loads the bootloader –Point to kernel Kernel initializes.
System Startup and Shutdown
Chapter 2 Booting Up and Shutting Down. Computer Center, CS, NCTU 2 Boot Up?
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.
IT2204: Systems Administration I 8. The Operating System and Booting.
Linux+ Guide to Linux Certification, Third Edition
CompTIA Linux+ Certification
Linux+ Guide to Linux Certification Chapter Three Linux Installation and Usage.
Booting Up and Shutting Down. Computer Center, CS, NCTU 2 Booting Up  Starting up a computer Load kernel into memory and execute it. (1)BIOS load and.
Booting and boot levels
Linux Booting Procedure
CIS 228 Grub Basics and Boot Security How we get there.
System Startup & Shutdown Objectives –to interpret the Unix startup and shutdown configuration files –to be able to create a customised run level Contents.
itec 400 System Startup/Shutdown
CIT 470: Advanced Network and System AdministrationSlide #1 CIT 470: Advanced Network and System Administration Booting and Runlevels.
COSC 4750 Customizing and maintenance. Installing software Redhat/Fedora (and linux in general) has a package installer, called rpm Many programs will.
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2010 by Scott Orr and the Trustees of Indiana University.
IT2204: Systems Administration I 8b).Booting (Supplementary Notes)
Guide to Linux Installation and Administration1 Chapter 4 Running a Linux System.
System Startup & Shutdown
ITI Chris Uriarte ITI-481: Unix Administration Meeting 2 Rutgers University Center for Applied Computer Technologies Chris Uriarte, Instructor.
CIS Lesson 5 Lesson 5 New Skills Boot time GRUB edits (review) Changing BIOS boot order on a VM (review) Mounting CD ISO and floppy Image files on.
Linux Startup Process Presenter: Dipu Gupta.
CIT 500: IT Fundamentals Startup. Slide #2 Topics 1.Booting 2.Bootstrap loaders 3.Run levels 4.Startup scripts 5.Shutdown and reboot.
Genesis: From Raw Hardware to Processes Andy Wang Operating Systems COP 4610 / CGS 5765.
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.
Linux Booting and Shutting Down UNIT - IV. 2 How Linux boot?
Sys Admin Course Service Management Fourie Joubert.
System initialization Unit objectives A.Outline steps necessary to boot a Linux system, configure LILO and GRUB boot loaders, and dual boot Linux with.
1 Setup and Compile Linux Kernel Speaker: Yi-Ji Jheng Date:
Overview A) Power on or reset B) 1st stage boot loader C) 2nd stage boot loader D) Operate system.
Linux Introduction Linux was developed in the early 1990’s by Linus Torvald computer science student at the University of Helsinki Linux is distributed.
Chap- 2 BOOTING & SHUTDOWN LINUX SYSTEM Created by: Asst. Prof. Ashish Shah, J.M.PATEL COLLEGE, GOREGOAN W 1.
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.
LPI 2010 NLLGG Trainer: Jeroen van Pelt Bijeenkomst 3: Systeem opstarten en werken met filesystemen
Chapter 8 Unix & Linux.
Booting Up and Shutting Down
Linux Start Sequence Summary
Booting Up and Shutting Down
CIT 470: Advanced Network and System Administration
Genesis: From Raw Hardware to Processes
OPS235: Week 1 Installing Linux (Lab1: Investigations 4 - )
SUSE Linux Enterprise Desktop Administration
Booting Up and Shutting Down
Objectives Topic 2.6 Understanding the boot process
Presentation transcript:

Booting and Shuting Down WeeSan Lee

Roadmap Bootstrapping Boot Loaders Startup/Init Scripts Reboot & Shutdown Q&A

Bootstrapping (simplified version) BIOSBoot LoaderKernel Initialization init Runs scripts from /etc/rc[0-6].d/ Spawns getty processes login Spawns Xdm/gdm processes login

BIOS Basic Input/Output System Contains information about the machine’s configuration. Eg. IDE controller, NIC PC knows which device to boot from via BIOS PC tries to run code from the MBR, ie. 1 st 512 bytes, of the disk MBR tells the PC to load the boot loader from certain disk partition The boot loader loads the kernel

Boot Loaders - LILO Traditional and stable /etc/lilo.conf  boot=/dev/hda  root=/dev/hda1  timeout=5  image=/boot/vmlinuz  label=Linux  read-only  other=/dev/hdb1  label=Windows  table=/dev/hdb To install it  $ lilo lilo must be run after every reconfiguration

Boot Loaders – LILO (cont) At LILO prompt  LILO: linux init=/sbin/init  LILO: linux init=/bin/bash  LILO: linux root=/dev/hda5  LILO: linux single

Boot Loaders – GRUB GRand Unified Boot loader Default on Red Hat and SuSe Read configuration file at boot time Understand filesystems and kernel executable formats  ie. Only need to know the device, disk partition and kernel filename  GRUB device (hd0,0) → /dev/hda1 or /dev/sda1 To install GRUB (for the very first time)  $ grub-install ‘(hd0,0)’  Edit /boot/grub/grub.conf

Boot Loaders – GRUB (cont) /boot/grub/grub.conf  default=0  timeout=5  splashimage=(hd0,0)/boot/grub/splash.xpm.gz  title CentOS ( el5)  root (hd0,0)  kernel /boot/vmlinuz el5 ro root=LABEL=/  initrd /boot/initrd el5.img  title Windows  rootnoverify (hd1,0)  chainloader +1

Boot Loaders – GRUB (cont) At the splash screen  Hit ‘a’ and type “ single” to boot to single-user mode  Hit ‘c’ to enter command-line mode To boot other OSes that aren’t in grub.conf Display system information Press TAB to see possible commands

Kernel Initialization A program itself  /vmlinuz or /boot/vmlinuz Two-stage loading process  initrd (init RAM disk) A transient root filesystem in RAM before a real root filesystem is available Eg. It is used to install file system modules into the kernel  The real root filesystem Device detection and configuration  You tell the kernel what to expect  The kernel probes the H/W itself Kernel threads creation  Eg. init (a user process), kjournald, kswapd

Single-user mode A manual mode after kernel initialization and before running startup scripts “single” is passed to init, sulogin is run instead Most system processes are not running Users can’t log in, except root / is mounted read-only  $ mount -o rw,remount / Check/repair the disk if there are disk problems  $ fsck -y /dev/sda1 Run ‘exit’ to exit single-user mode

Startup/Init Scripts After Kernel initialization, a process called init is created with PID 1 init runs startup scripts (normal shell scripts) to perform specific tasks, eg.  Setting the hostname, time zone, etc  Checking and mouting the disks  Configuring network interfaces  Starting up daemons and network services

Startup/Init Scripts (cont) Startup scripts (rc files) are run based on run levels  0the level in which the system is completely shut down  1single-user mode  2multiuser mode w/out NFS  3full multiuser mode  4unused  5X11  6reboot level Starts with run level 0 to the default run level (usually 3) /etc/inittab tells init what to do at each level To find out which run level the system is current in  $ runlevel

Startup/Init Scripts (cont) init runs the scripts from /etc/rc.d/rc[0-6].d/  /etc/rc.d/rc0/K25sshd → /etc/init.d/sshd  /etc/rc.d/rc3/S55sshd → /etc/init.d/sshd Each server/daemon provides a master script  Stored in /etc/init.d  Understands the arguments: start, stop, restart /etc/init.d/sshd start run level 0 → 3  /etc/rc.d/rc3/S* start run level 3 → 0  /etc/rc.d/rc0/K* stop Pretty ugly!

Startup/Init Scripts (cont) Use chkconfig instead. Eg.  $ chkconfig --add sshd  $ chkconfig --del sshd Before that, need to add/modify /etc/init.d/sshd  # chkconfig: sshd should be started/stopped at run level 2, 3, 4 and 5 with the start priority of 55 and the stop priority of 25

Reboot & Shutdown To reboot  $ shutdown -r now  $ reboot  $ telinit 6 To halt  $ shutdown -h now  $ halt  $ telinit 0  $ poweroff

Reboot & Shutdown (cont) To shutdown gracefully  $ shutdown -h +15 “Shutdown in 15 mins”

References LAH  Ch 2: Booting and Shutting Down Grub manual 