Booting And Shutting Down. Bootstrapping  Bootstrapping is standard term for “starting up a computer”  During bootstrapping the kernel is loaded into.

Slides:



Advertisements
Similar presentations
Troubleshooting Startup Problems
Advertisements

PC bootup Presented by: Rahul Garg (2003CS10183) Rajat Sahni (2003CS10184) Varun Gulshan(2003CS10191)
2 © 2004, Cisco Systems, Inc. All rights reserved. IT Essentials I v. 3 Module 4 Operating System Fundamentals.
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.
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+ 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
Hard-Disk Partitions Ref: Wikipedia. What and Why Disk partitioning –The creation of logical divisions upon a hard disk that allows one to apply operating.
Linux+ Guide to Linux Certification, Second Edition
Startup. Major phases  BIOS  MBR program  Boot loader (Partition boot program )  OS’s kernel Loader  CPU always starts running at x’FFFF0’=1,048,560.
计算机系 信息处理实验室 Lecture 5 Startup and Shutdown
Chapter 3 Understanding the Boot Process and Command Line.
Linux+ Guide to Linux Certification, Second Edition Chapter 3 Linux Installation and Usage.
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.
11 INSTALLING WINDOWS XP Chapter 2. Chapter 2: Installing Windows XP2 INSTALLING WINDOWS XP  Prepare a computer for the installation of Microsoft Windows.
1 Web Server Administration Chapter 3 Installing the Server.
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
Linux+ Guide to Linux Certification, Third Edition
CompTIA Linux+ Certification
Linux+ Guide to Linux Certification Chapter Three Linux Installation and Usage.
Linux Booting Procedure
By the end of this lesson you will be able to explain: 1. What is the BOOT process 2. A Cold Boot 3. A Warm Boot.
CIS 228 Grub Basics and Boot Security How we get there.
Guide to Linux Installation and Administration, 2e1 Chapter 3 Installing Linux.
DOS  In the 1980s or early 1990s, the operating system that shipped with most PCs was a version of the Disk Operating System (DOS) created by Microsoft:
Booting. Booting is the process of powering it on and starting the operating system. power on your machine, and in a few minutes your computer will be.
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2010 by Scott Orr and the Trustees of Indiana University.
Hardware Boot Sequence. Vocabulary BIOS = Basic Input Output System UEFI = Unified Extensible Firmware Interface POST= Power On Self Test BR = Boot Record.
Installation Overview Lab#2 1Hanin Abdulrahman. Installing Ubuntu Linux is the process of copying operating system files from a CD, DVD, or USB flash.
IT2204: Systems Administration I 8b).Booting (Supplementary Notes)
Virtual Memory Review Goal: give illusion of a large memory Allow many processes to share single memory Strategy Break physical memory up into blocks (pages)
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.
Chapter Thirteen Booting Windows XP. Objectives Understand the Windows XP boot process Understand the Windows XP boot process Troubleshoot system restoration.
Linux Startup Process Presenter: Dipu Gupta.
Chapter 8: Installing Linux The Complete Guide To Linux System Administration.
Genesis: From Raw Hardware to Processes Andy Wang Operating Systems COP 4610 / CGS 5765.
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2009 by Scott Orr and the Trustees of Indiana University.
Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 8- 0 Lesson 8 Secondary Management.
The Linux Operating System R.Bigelow. What is an Operating System An operating system is a collection of programs that manage a computer's resources.
Linux Booting and Shutting Down UNIT - IV. 2 How Linux boot?
System initialization Unit objectives A.Outline steps necessary to boot a Linux system, configure LILO and GRUB boot loaders, and dual boot Linux with.
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.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com The GRUB bootloader Michael.
Day 1 Tasks How do you backup the MBR (Master Boot Record) of a hard disk? How do you backup the primary partition table of an MBR type hard disk? How.
System Administration Startup Process. Why Care? ● Every process on your system comes about by following a specific chain of events from the machine startup.
NT1110 Computer Structure and Logic Unit 8 (Module 5A) COMPUTER OPERATION AND SECURITY.
The GRUB bootloader Michael Opdenacker Thomas Petazzoni Free Electrons
Chapter 8 Unix & Linux.
GRUB 2 Dave Soergel.
Chapter Objectives In this chapter, you will learn:
Guide to Linux Installation and Administration, 2e
Chapter 2: System Structures
Structure of Unix OS.
CONFIGURING HARDWARE DEVICE & START UP PROCESS
Booting Up 15-Nov-18 boot.ppt.
Genesis: From Raw Hardware to Processes
SUSE Linux Enterprise Desktop Administration
Presentation transcript:

Booting And Shutting Down

Bootstrapping  Bootstrapping is standard term for “starting up a computer”  During bootstrapping the kernel is loaded into memory and begin its execution

Overview of Linux Booting

4 Overview Linux booting  Turn on  CPU jump to address of BIOS  BIOS runs POST (Power-On Self Test) and it also performs system integrity check  BIOS searches, loads, and executes boot loader program  BIOS finds bootable devices  BIOS gives control to MBR reads from the memory  BIOS loads and execute boot sector form MBR

Booting Process

Recovery Boot to a shell  Basic minimal shell is loaded in case of system failed to load.  This shell can be used as a recovery tool by system admins.  Traditionally known as booting in ‘single user mode’ or ‘maintenance mode’  On most system,you request a boot to ‘single user mode’ by passing an argument to kernel at boot time.  If system is alredy up and running, you can bring it down to single user mode with shutdown or telinit command.

7 Steps in the boot process 1. Reading of the boot loader from the MBR (Master Boot Record) 2. Loading and initialization of the kernel 3. Device detection and configuration 4. Creation of kernel processes 5. Administrator intervention (single-user-mode only) 6. Execution of system startup scripts

8 MBR (Master Boot Record)  OS is booted from a hard disk, where the Master Boot Record (MBR) contains the primary boot loader  The MBR is a 512-byte sector, located in the first sector of the bootable disk (sector 1 of cylinder 0, head 0)  After the MBR is loaded into RAM, the BIOS yields control to it.

9 MBR (Master Boot Record)

10 MBR (Master Boot Record)  The first 446 bytes are the primary boot loader, which contains both executable code and error message text  The next sixty-four bytes are the partition table, which contains a record for each of four partitions  The MBR ends with two bytes that are defined as the magic number (0xAA55). The magic number serves as a validation check of the MBR

11 Extracting the MBR  To see the contents of MBR, use this command:  # dd if=/dev/hda of=mbr.bin bs=512 count=1  # od -xa mbr.bin **The dd command, which needs to be run from root, reads the first 512 bytes from /dev/hda (the first Integrated Drive Electronics, or IDE drive) and writes them to the mbr.bin file. **The od command prints the binary file in hex and ASCII formats.

12 Boot loader  Boot loader could be more aptly called the kernel loader. The task at this stage is to load the Linux kernel  MBR contains information about boot loaders  MBR loads and executes GRUB (Linux boot loader)  GRUB(Grand Unified Bootloader) contains images of the kernel i.e. loads and execute kernel, it also loads initial RAM disk (init rd)

13 2. Loading and initialization of the kernel  Kernel is itself a program, and the first bootstrapping task is to get this program into memory so that it can be executed  Linux system kernel - /boot/vmlinuz  Kernel mounts root filesystem i.e. loads filesystems  Probes the system to determine how much RAM is available  Kernel executes init program located in /sbin/init

14 3. Device detection and configuration  Kernel loads device drivers  The kernel prints out a line of cryptic information about each device it finds

15 4. Creation of kernel processes  Kernel creates several “spontaneous” processes in user space  They are called spontaneous processes because they are not created through the normal system call fork  Processes sched have PID 0 and init have PID 1

16

17 5. Administrator intervention (single user mode – recovery mode)  During ‘single-user-boot’ user is prompted to enter the root password.  A root shell is spawned by Init process which is aware of the fact that system is booted in recovery mode. (because of the extra argument passed by kernel)  Only root portion is mounted  Fsck cmd is run during a normal boot to check and repair filesystems.  When the system in single user mode, need to run fsck by hand

18 6. Execution of startup scripts  Startup scripts are just normal shell scripts, and they are selected and run by init  Startup scripts serves in setting up the user environment  Finally boot process completed  But Init is not done with its job…. Continues to play an important role

19  Booting PCs  When a machine boots, it begins by executing boot code stored in ROMs.  The exact location and nature of this boot code varies, depending on the type of machine you have.  The boot code is typically firmware that knows how to use the devices connected to the machine, how to talk to the network on a basic level, and how to understand disk-based filesystems.  On PCs, the initial boot code is generally called a BIOS.

20  Built-in BIOS knows about some of the devices that live on the motherboard, IDE and disks, network interface, power and temperature meters and system hardware.  BIOS select which devices you want the system to try to boot from.  You can usually specify an ordered list of preferences such as “try to boot from DVD, USB drive, hard disk”.

21  Once the BIOS has figured out what device to boot from, it tries to read the first block of the device.  This 512-byte segment is known as the master boot record or MBR.  MBR contains a program that tells the computer from which partition to load a secondary boot program, the “boot loader”.  Default MBR contains a simple program that tells the computer to get its boot loader from the first partition on the disk.

22  MBR that knows how to deal with multiple operating systems and kernels.  Once the MBR has chosen a partition to boot from, it tries to load the boot loader specific to that partition. This loader is then responsible for loading the kernel.

23  GRUB : The Grand Unified Boot Loader  GRUB, developed by the GNU (Gnu’s Not Unix) project.  It is the default boot loader for most UNIX and Linux systems with Intel processors.  GRUB’s job is to choose a kernel from a previously assembled list and to load that kernel with options specified by the administrator.

24  There are two branches of the GRUB lineage: original GRUB called GRUB Legacy, and the newer GRUB 2.  Grub 2 is similar in concept but varies in its config file syntax.  By default, GRUB reads its default boot configuration from /boot/grub/menu.lst or /boot/grub/grub.conf.

25  GRUB reads the configuration file at startup time.  menu.lst and grub.conf files are slightly different but have a similar syntax.  Red hat system use grub.conf and solaris, suse and ubuntu still use menu.lst

GRUB 2 : New Layout  GRUB 2 places its files in three core locations: /boot/grub/grub.cfg : Should not be edited by hand /etc/grub.d/ Contains grub scripts, these scripts generate grub.cfg /etc/default/grub This file contains the GRUB menu settings that are read by the GRUB scripts and written into grub.cfg

27  Red Hat system - grub.conf file default=0 timeout=10 splashimage=(hd0,0)/boot/grub/splash.xpm.gz # displays splash image title Red Hat Enterprise Linux Server ( el5) root (hd0,0) # root file system kernel /vmlinuz el5ro root=LABEL=/ #Grub loads this kernel

28  Ubuntu system - menu.lst file

29  GRUB is an operating system independant boot loader  Flexible command line interface  File system access

30  Multibooting default=0 timeout=5 splashimage=(hd0,2)/boot/grub/splash.xpm.gz hiddenmenu title Windows XP rootnoverify (hd0,0) chainloader +1 title Red Hat root (hd0,1) kernel /vmlinuz

Grub Command Line  Press ‘c’ from grub boot screen to enter in command line mode  Press to obtain quick list of possible commands.  We can boot OS that is not in grub.cong file

32  GRUB command-line options Command Meaning reboot - Reboots the system find - Finds files on all mountable partitions root - Specifies the root device (a partition) kernel - Loads a kernel from the root device help - Gets interactive help for a command boot - Boots the system from the specified kernel image

33  Booting To Single-User Mode  Boot options should be easily modifiable and decided on the ‘a’ key as the appropriate tool.  To boot into single-user mode, add the single flag to the end of the existing kernel options.  ro root=LABEL=/rhgb quiet single

Init and start-up scripts  Bootloader loads the kernel, kernel spawns the init process.  Init executes start up scripts  Start up scripts are kept in /etc/init.d ( rc0.d, rc1.d and so on)

Tasks often performed by start-up scripts  Setting the name of computer  Setting the time zone  Checking the disk with fsck  Mounting the system disk  Removing old files from the temp directory  Configuring network settings  Starting up daemon and netwwork services

Init and its run level  Init controls the system run levels and decides (based on /etc/inittab) which set of processes to run at each run level  Each run level is normally a single digit (0 to 6) or S  When system is booted init first runs at level 1 or S.

Run levels  At level 0, the system is completely shut down.  Levels 1 and S represent single-user mode.  Levels 2 through 5 include support for networking.  Level 6 is a “reboot” level.

38  Rebooting and Shutting Down  Always a good idea to shut down the machine when possible.  Improper shutdown can result problem in the system.  To modify or make significant system changes, you should reboot just to make sure that the system comes up successfully.

39  Shutdown : the gentle way to halt the system  Shutdown sends messages to logged-in users at progressively shorter intervals, warning them of the impending downtime.  Warning simply say that the system is being shut down and give the time remaining until the event.

40

41  $ sudo shutdown –h +15 "system is going down for system halt after 15 minutes! “  $ sudo shutdown –r +1 “system is going down for system halt after 1 minutes!”  Halt cmd performs the essential duties required to shut the system down.  Halt logs the shutdown, kills nonessential processes, executes the sync system call, waits for filesystem writes to complete, and then halts the kernel.  Reboot is almost identical to halt, but it reboots instead of halting.