CIT 500: IT Fundamentals Startup. Slide #2 Topics 1.Booting 2.Bootstrap loaders 3.Run levels 4.Startup scripts 5.Shutdown and reboot.

Slides:



Advertisements
Similar presentations
Booting and Shuting Down WeeSan Lee. Roadmap Bootstrapping Boot Loaders Startup/Init Scripts Reboot & Shutdown Q&A.
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
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.
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.
S.Ha.R.K. Workshop28/02/05 S.Ha.R.K. Installation HowTo Tullio Facchinetti University of Pavia - Italy.
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.
Processes & Daemons Chapter IV / Part III. Commands Internal commands: alias, cd, echo, pwd, time External commands, code is in a file: grep, ls, more.
System Startup and Shutdown
Linux Install. Resources Guide to Linux Installation and Administration, Nicholas Wells, Course Technology, 2000.
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.
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.
Guide to Linux Installation and Administration, 2e1 Chapter 3 Installing Linux.
System Startup & Shutdown Objectives –to interpret the Unix startup and shutdown configuration files –to be able to create a customised run level Contents.
1 Linux Basics for Networking. 2 Module - Linux Basics for Networking ♦ Overview This module focuses on the basics of networking using Redhat Enterprise.
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.
What is system software and what are its parts? Programs that control operation of computer Two parts are operating systems utility programs.
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2010 by Scott Orr and the Trustees of Indiana University.
Linux Administration. Pre-Install Different distributions –Redhat, Caldera, mandrake, SuSE, FreeBSD Redhat Server Install –Check HCL –Significant issues.
IT2204: Systems Administration I 8b).Booting (Supplementary Notes)
Guide to Linux Installation and Administration1 Chapter 4 Running a Linux System.
System Startup & Shutdown
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.
COMP075 OS2 Managing Linux Services. Services? Services are processes that start, usually when the system starts, and run, usually, until the system stops.
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.
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.
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.
1 COP 4343 Unix System Administration Unit 1: –Linux OS structure –Distributions –Hardware inventory –Disks and partitions –Installation steps –Boot loader.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com The GRUB bootloader Michael.
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.
The GRUB bootloader Michael Opdenacker Thomas Petazzoni Free Electrons
The Linux Kernel About 6 million lines of code
Booting Up and Shutting Down
Linux Start Sequence Summary
Structure of Unix OS.
Booting Up and Shutting Down
CIT 470: Advanced Network and System Administration
CONFIGURING HARDWARE DEVICE & START UP PROCESS
SUSE Linux Enterprise Desktop Administration
Booting Up and Shutting Down
Presentation transcript:

CIT 500: IT Fundamentals Startup

Slide #2 Topics 1.Booting 2.Bootstrap loaders 3.Run levels 4.Startup scripts 5.Shutdown and reboot

Slide #3 Booting 1.ROM boot code (BIOS in PCs)‏ 2.Master Boot Record (MBR)‏ 3.Bootloader 4.Kernel 5.Hardware detection and configuration 6.Creation of system processes 7.Multiuser operation

Slide #4 BIOS 1.Load CMOS settings. 2.Initialize registers and power management. 3.POST (Power On Self Test.)‏ 4.Display system settings (if key pressed.)‏ 5.Activate other BIOSes Disk interfaces Graphics cards Network interfaces 6.Find bootable device. 7.Load MBR. 8.Run MBR program.

MBR 4 primary partitions. One can be used as an extended partition, which is a link to an Extended boot record on the 1 st sector of that partition. Each logical partition is described by its own EBR, which links to the next EBR.

Slide #6 GRUB Installation At OS Install Time Most distributions install GRUB. Linux Install grub-install /dev/hda Native install Run grub command from live CD or hard disk. #>> root (hd0,0)‏ #>> setup (hd0)‏ #>> quit

Slide #7 GRUB Boot Auto boots default OS after timeout. Key sequences bring up – Menu of boot options (described in menu.lst)‏ – Edit kernel options (runlevel, other features)‏ – GRUB command shell A boot prompt password may be required before edit/shell access granted. – Can bypass OS security by specifying kernel options or accessing files from GRUB shell.

GRUB Menu

GRUB Edit Menu

Slide #10 /boot/grub/menu.lst # timeout (sec) before booting default timeout 10 titleCentOS ( el5) root (hd1,0)‏ kernel /boot/vmlinuz el5 root=/dev/hdb1 ro rhgb quiet initrd /boot/initrd el5.img boot titleWindows 2008 root (hd0,0)‏ makeactive chainloader +1

Slide #11 Booting with GRUB Direct Boot Specify OS kernel image to load. Chainloading Specify another bootloader to load. Chainload NTLDR to boot MS Windows.

GRUB Naming Convention GRUB uses BIOS hard disk numbers OS may not number disks identically to BIOS. Examples (hd0,0) First partition of first hard disk (hd1,2) Third partition of second hard disk.

Kernel 1.GRUB loads kernel file into memory /boot/vmlinuz-VERSION 2.Kernel uncompresses self and begins running. 3.Sets up interrupts and virtual memory. 4.Loads initial RAMdisk into memory /boot/initrd.img-VERSION 5.Kernel uncompresses initrd and mounts as /sysroot. 6.Kernel loads drivers and modules from /sysroot. SCSI and RAID drivers, ext3 filesystem module, etc. 7.Switches from real mode to protected mode. 8.Creates kernel threads (ksoftirq, khelper, kblockd)‏ 9.Starts init process.

Kernel Arguments in GRUB

Slide #15 Kernel Arguments Numeric arguments Specify runlevel. single also specifies single user mode Root device options root= specifies which root device to use ro, rw specify access type Console options console=ttyS1, 9600 will use serial console Hardware options Enable, disable specific hardware devices/features.

Slide #16 Run Levels 0 – Shutdown 1 – Single user 2 – Multi-user, no networking 3 – Multi-user, with networking 4 – Unused 5 – Multi-user, networking, and GUI 6 – Reboot

/etc/inittab # The default runlevel. id:2:initdefault: # Boot-time system configuration/initialization script. si::sysinit:/etc/init.d/rcS # What to do in single-user mode. ~~:S:wait:/sbin/sulogin # /etc/init.d executes the S and K scripts upon change 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 when CTRL-ALT-DEL is pressed. ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

rc Run by init with runlevel as argument. Starts and stops services for each runlevel. /etc/rc#.d scripts – Symlinks to actual scripts in /etc/init.d – Stops services beginning with K* – Starts services beginning with S* – Executes in ASCII order.

Scripts in runlevel 2 $ ls /etc/rc2.d S05vbesave S13gdm S20openntpd S89cron S08iptables S18hplip S20postfix S91apache2 S10acpid S18portmap S20powernowd S98usplash S10powernowd.early S19cupsys S20rsync S99acpi-support S10sysklogd S20apmd S20ssh S99rc.local S10syslog-ng S20argus-server S20xinetd S99rmnologin S11klogd S20hotkey-setup S21nfs-common S99stop-readahead S12dbus S20makedev S89anacron

Slide #20 Example init.d script #! /bin/sh case "$1" in 'start') if [ -f /usr/local/sbin/sshd ]; then echo "starting SSHD daemon" /usr/local/sbin/sshd & fi ;; 'stop')‏ PID=`/usr/bin/ps -e -u 0 | /usr/bin/fgrep sshd | /usr/bin/awk '{print $1}'` if [ ! -z "$PID" ] ; then /usr/bin/kill ${PID} >/dev/null 2>&1 fi ;; *) echo "usage: /etc/init.d/sshd {start|stop}“ ;; esac

Slide #21 Enabling or Disabling Services Add a new service Install startup script in /etc/init.d Create S symlinks in appropriate runlevels Create K symlinks in appropriate runlevels Prevent a service from starting on boot Remove S links from /etc/rc?.d/* Remove K links from /etc/rc?.d/*

Slide #22 Red Hat service Command Starting or stopping a service service NAME [start,restart,stop] is equivalent to /etc/init.d/NAME [start,restart,stop] Service command options: start restart stop status Use command without any options to get help message with all available options.

Slide #23 Red Hat chkconfig Command List configured services chkconfig Enabling or disabling a service at boot time chkconfig --level # NAME is equivalent to ln –s /etc/init.d/NAME /etc/init.d/rc.d/rc#.d/S??name Adding or removing a service entirely chkconfig --level

Red Hat Service Configuration Red Hat Linuxes use files in /etc/sysconfig VARIABLE=value format Documentation in RHEL manuals Examples desktop : select GNOME, KDE, XFCE desktop iptables : firewall configuration network : hostname, gateway router network-scripts/ifcfg-eth0 : eth0 config

Slide #25 Single User Mode Kernel boots (with arg 1 or “single”)‏ System asks for root password Root shell starts No system processes No networking Only root filesystem mounted (read-only). Remount for RW: mount –o remount,rw / Why? Fix w/o user interference: disks, backups, security.

Slide #26 What if single user mode doesn’t work? Bypass init by booting into shell Pass init=/bin/bash argument to kernel. Probably want to specify rw option as well. No need for root password. No housekeeping performed. Boot from CD RedHat CD with linux rescue Knoppix CD

Slide #27 Shutdown shutdown (or init 0 )‏ Offers time-delay option. Runs server stop scripts. Kill remaining processes. Flushes writes to disk. halt Kills processes. Flushes writes to disk ( sync ).

Slide #28 Reboot init 6 shutdown restarts system Ctrl-Alt-Del Defined in /etc/inittab ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now reboot halt restarts system

Slide #29 What's wrong with init? Performance – Starts services sequentially. – Shell scripts spawn lots of processes. Manual configuration – Order to start services determined manually. – i.e. network before auth before nfs. Reliability – Init doesn’t monitor or restart services after boot. Hotplug hardware – Drives mounted at boot. – What about USB or network drives?

Slide #30 Init Alternatives iniNG – Service config specifies dependencies. – need = system/initial net/all; – Starts services in parallel once dependencies met. launchd – Mac replacement for init, rc, cron, atd, inetd – Monitors services, starts on demand. Service Management Facility – Sun replacement for init with service monitoring.

Upstart Event-based init replacement. Supports wider range of events than launchd. – Hardware device has been added. – Filesystem has been mounted. – Time-based (can replace cron as well as init.) – File has been modified. – Another job has begun or finished running. Backwards compatible with /etc/init.d scripts. Respawns services that are down. Used in Ubuntu >= 6.10, Fedora >= 9

References 1.Red Hat, RHEL Installation Guide, US/Red_Hat_Enterprise_Linux/5.4/html/Installation _Guide/index.html, US/Red_Hat_Enterprise_Linux/5.4/html/Installation _Guide/index.html 2.Syed Mansoor Sarwar, Robert Koretsky, Syed Ageel Sarwar, UNIX: The Textbook, 2 nd edition, Addison- Wesley, Nicholas Wells, The Complete Guide to Linux System Administration, Thomson Course Technology, 2005.