SlideShare une entreprise Scribd logo
1  sur  21
Linux Startup
By: Amin Hashemi
AmirKabir University of technology
Computer Engineering & Information Technology Department
Contents
 System startup
 Services
 Controlling boot services
 References
System startup
System startup- BIOS
 BIOS stands for Basic Input/output System
 Performs some system integrity checks
 Searches, loads, and executes the boot loader program.
 It looks for boot loader in floppy, CD-ROM, or hard drive. You
  can press a key (typically F12 of F2, but it depends on your
  system) during the BIOS startup to change the boot
  sequence.
 Once the boot loader program is detected and loaded into
  the memory, BIOS gives the control to it.
 So, in simple terms BIOS loads and executes the MBR boot
  loader.
System startup- MBR
 MBR stands for Master Boot Record.
 It is located in the 1st sector of the bootable disk. Typically
  /dev/hda, or /dev/sda
 MBR is less than 512 bytes in size. This has three
  components:
   1) primary boot loader info in 1st 446 bytes
   2) partition table info in next 64 bytes
   3) MBR validation check in last 2 bytes.
 It contains information about GRUB (or LILO in old systems).
 So, in simple terms MBR loads and executes the GRUB boot
  loader.
System startup- GRUB
 GRUB stands for Grand Unified Bootloader.
 If you have multiple kernel images installed on your system,
  you can choose which one to be executed.
 GRUB displays a splash screen, waits for few seconds, if you
  don‟t enter anything, it loads the default kernel image as
  specified in the GRUB configuration file.
 GRUB has the knowledge of the filesystem (the older Linux
  loader LILO didn‟t understand filesystem).
System startup- Kernel
 Mounts the root file system as specified in the “root=” in
  grub.conf
 Kernel executes the /usr/src/linux/init/main.c program
 Since init was the 1st program to be executed by Linux
  Kernel, it has the process id (PID) of 1. Do a „ps -ef | grep init‟
  and check the pid.
 initrd stands for Initial RAM Disk.
 initrd is used by kernel as temporary root file system until
  kernel is booted and the real root file system is mounted. It
  also contains necessary drivers compiled inside, which helps
  it to access the hard drive partitions, and other hardware.
System startup- Kernel (cont.)
 Details about the specific sequence of events or
  what happens when the Linux kernel is loaded.
   Recognize, set up and initialize the CPU(s).
   Set up kernel memory and process handling.
   Initialize configured system devices.
   Start memory handling (paging, …).
   Set up and mount the file system.
   Start the init command.
System startup- init
 After the kernel has detected computer‟s hardware and load
  the correct device driver, init is started.
    The last step of kernel booting.
 It s the parent of all processes.
    PID = 1
 init role:
    The primary role of init is to create processes from a script stored
     in /etc/inittab.
    Running scripts in /etc/rc.d.
System startup- init- /etc/inittab
 This file describes how the init process should setup the
  system in a certain run level.
 /etc/inittab format:
     Id:run-level:action:process
     Id: a unique 1-4 character which identifies an entry in inittab.
     Run-level: run level number.
     Action: which action should be taken (wait, boot, initdefault, …)
     Process: the process to be executed.
System startup- init- /etc/rc.d
 rc
   Performs master control of which scripts to execute.
 rc.sysinit
   The system initialization script
 rc.local
   Used for local initialization
 /etc/rc.d/inid.d/
   A number of scripts used to start and stop services
 /etc/rc.d/rc*.d/ (* : 0–6)
   Each file is merely a soft link to a script under init.d
System startup- init- rc.sysinit
 This file is interpreted by init once at boot time.
 It contains bash shell script logic to perform some the
  following:
     Sets the system hostname
     Reads in network configuration data
     Prints welcome banner for login
     Configures the kernel
     Sets up the system time
     Sets the console and keyboard mapping
     …
System startup- Run levels
 A run-level is a software configuration of the system which
  allows only a selected group of processes to exist.
 When the Linux system is booting up, you might see various
  services getting started. For example, it might say “starting
  sendmail …. OK”. Those are the runlevel programs,
  executed from the run level directory as defined by your run
  level.
System startup- Run levels (cont.)
 Depending on your default init level setting, the system will execute the
  programs from one of the following directories:
 Run level 0 – halt (/etc/rc.d/rc0.d/) : Shuts down the system.
 Run level 1 – single user mode (/etc/rc.d/rc1.d/) :Mode for administrative
  tasks.
 Run level 2 – multiuser, without NFS (/etc/rc.d/rc2.d/) :Does not configure
  network interfaces and does not export networks services.
 Run level 3 – full multiuser mode (/etc/rc.d/rc3.d/) : Starts the system normally.
 Run level 4 – unused (/etc/rc.d/rc4.d/) :For special purposes.
 Run level 5 – Multi-User mode, with display manager as well as console
  logins(X11) (/etc/rc.d/rc5.d/) :As runlevel 3 + display manager.
 Run level 6 – reboot (/etc/rc.d/rc6.d/) :Reboots the system.
Services
 /etc/rc.d/init.d/
   A number of scripts used to start and stop services
Run Level and Services
 The scripts (in /etc/rc.d/rc*.d/) are actually symbolic links to
  system service scripts under the /etc/rc.d/init.d/ directory. So,
  /etc/rc0.d is linked to /etc/rc.d/rc0.d.
 Under the /etc/rc.d/rc*.d/ directories, you would see programs
  that start with S and K.
 Programs starts with S are used during startup. S for Startup.
 Programs starts with K are used during shutdown. K for kill.
 There are numbers right next to S and K in the program names.
  Those are the sequence number in which the programs should
  be started or killed.
 Example:
     K12mysql
     S12syslog
     S10network
     S80sendmail
Controlling Boot Services
 Manually rename Scripts
   Rename K to S and vice versa
   Change the number followed by K/S
 Manually start and stop services
   {start | stop | restart | status}
   /etc/rc.d/init.d/network start
   service network start
 Through graphical tool
   ntsysv
Controlling Boot Services
 Changing Run Levels
   The telinit command is used to change run-levels on-the-fly on a
    running Linux system.
    telinit 5
References
 http://www.thegeekstuff.com/2011/02/linux-boot-process/
 https://www.linux.com/news/enterprise/systems-
  management/8116-an-introduction-to-services-runlevels-and-
  rcd-scripts
 http://en.wikipedia.org/wiki/Linux_startup_process
 http://en.wikipedia.org/wiki/Runlevel
 Mr. Hamed Janzadeh‟s slides about linux startup
Thank you


 Website: Http://www.AminHashemi.com
 E-mail: Amin [at] aminhashemi [dot] com

Contenu connexe

Tendances

Course 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsCourse 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsAhmed El-Arabawy
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemSadia Bashir
 
Introduction to Linux
Introduction to Linux Introduction to Linux
Introduction to Linux Harish R
 
Linux scheduling and input and output
Linux scheduling and input and outputLinux scheduling and input and output
Linux scheduling and input and outputSanidhya Chugh
 
Linux User Management
Linux User ManagementLinux User Management
Linux User ManagementGaurav Mishra
 
Management file and directory in linux
Management file and directory in linuxManagement file and directory in linux
Management file and directory in linuxZkre Saleh
 
System and network administration network services
System and network administration network servicesSystem and network administration network services
System and network administration network servicesUc Man
 
Linux installation and booting process
Linux installation and booting processLinux installation and booting process
Linux installation and booting processSiddharth Jain
 
6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot processHari Shankar
 
Chapter07 Advanced File System Management
Chapter07      Advanced  File  System  ManagementChapter07      Advanced  File  System  Management
Chapter07 Advanced File System ManagementRaja Waseem Akhtar
 
Linux standard file system
Linux standard file systemLinux standard file system
Linux standard file systemTaaanu01
 
Basic command ppt
Basic command pptBasic command ppt
Basic command pptRohit Kumar
 

Tendances (20)

Linux basics
Linux basicsLinux basics
Linux basics
 
Course 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsCourse 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and Permissions
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File System
 
Introduction to Linux
Introduction to Linux Introduction to Linux
Introduction to Linux
 
comparing windows and linux ppt
comparing windows and linux pptcomparing windows and linux ppt
comparing windows and linux ppt
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Linux operating system
Linux operating systemLinux operating system
Linux operating system
 
Linux scheduling and input and output
Linux scheduling and input and outputLinux scheduling and input and output
Linux scheduling and input and output
 
Linux User Management
Linux User ManagementLinux User Management
Linux User Management
 
User management
User managementUser management
User management
 
Linux
Linux Linux
Linux
 
Management file and directory in linux
Management file and directory in linuxManagement file and directory in linux
Management file and directory in linux
 
System and network administration network services
System and network administration network servicesSystem and network administration network services
System and network administration network services
 
Linux installation and booting process
Linux installation and booting processLinux installation and booting process
Linux installation and booting process
 
6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot process
 
Chapter07 Advanced File System Management
Chapter07      Advanced  File  System  ManagementChapter07      Advanced  File  System  Management
Chapter07 Advanced File System Management
 
Linux standard file system
Linux standard file systemLinux standard file system
Linux standard file system
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 

En vedette (15)

6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot process
 
IPTABLES
IPTABLESIPTABLES
IPTABLES
 
Hadoop on ec2
Hadoop on ec2Hadoop on ec2
Hadoop on ec2
 
Linux network file system (nfs)
Linux   network file system (nfs)Linux   network file system (nfs)
Linux network file system (nfs)
 
Linux booting procedure
Linux booting procedureLinux booting procedure
Linux booting procedure
 
Linux booting process!!
Linux booting process!!Linux booting process!!
Linux booting process!!
 
linux file system
linux file systemlinux file system
linux file system
 
4. linux file systems
4. linux file systems4. linux file systems
4. linux file systems
 
Linux Booting Steps
Linux Booting StepsLinux Booting Steps
Linux Booting Steps
 
File system.
File system.File system.
File system.
 
file system in operating system
file system in operating systemfile system in operating system
file system in operating system
 
NFS(Network File System)
NFS(Network File System)NFS(Network File System)
NFS(Network File System)
 
File system
File systemFile system
File system
 
File Systems
File SystemsFile Systems
File Systems
 
Linux File System
Linux File SystemLinux File System
Linux File System
 

Similaire à Linux startup

6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot processsagarpdalvi
 
Introduction to Operating Systems.pptx
Introduction to Operating Systems.pptxIntroduction to Operating Systems.pptx
Introduction to Operating Systems.pptxMohamedSaied877003
 
System Init
System InitSystem Init
System Initcntlinux
 
Bootloader and bootloading
Bootloader and bootloadingBootloader and bootloading
Bootloader and bootloadingArpita Gupta
 
Linux booting process - Linux System Administration
Linux booting process - Linux System AdministrationLinux booting process - Linux System Administration
Linux booting process - Linux System AdministrationSreenatha Reddy K R
 
Linux booting procedure
Linux booting procedureLinux booting procedure
Linux booting procedureDhaval Kaneria
 
Your first dive into systemd!
Your first dive into systemd!Your first dive into systemd!
Your first dive into systemd!Etsuji Nakai
 
6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot processTeja Bheemanapally
 
Linux boot process – explained
Linux boot process – explainedLinux boot process – explained
Linux boot process – explainedLinuxConcept
 
Unix Shell and System Boot Process
Unix Shell and System Boot ProcessUnix Shell and System Boot Process
Unix Shell and System Boot ProcessArvind Krishnaa
 
Order of boot process in Linux
Order of boot process in LinuxOrder of boot process in Linux
Order of boot process in LinuxSiddhesh Palkar
 

Similaire à Linux startup (20)

6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot process
 
Introduction to Operating Systems.pptx
Introduction to Operating Systems.pptxIntroduction to Operating Systems.pptx
Introduction to Operating Systems.pptx
 
Linux Booting Process
Linux Booting ProcessLinux Booting Process
Linux Booting Process
 
Unix Administration 2
Unix Administration 2Unix Administration 2
Unix Administration 2
 
Ch04 system administration
Ch04 system administration Ch04 system administration
Ch04 system administration
 
Ch04
Ch04Ch04
Ch04
 
System Init
System InitSystem Init
System Init
 
Bootloader and bootloading
Bootloader and bootloadingBootloader and bootloading
Bootloader and bootloading
 
Linux booting process - Linux System Administration
Linux booting process - Linux System AdministrationLinux booting process - Linux System Administration
Linux booting process - Linux System Administration
 
Linux booting procedure
Linux booting procedureLinux booting procedure
Linux booting procedure
 
Your first dive into systemd!
Your first dive into systemd!Your first dive into systemd!
Your first dive into systemd!
 
6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot process
 
Linux boot process – explained
Linux boot process – explainedLinux boot process – explained
Linux boot process – explained
 
Linux filesystemhierarchy
Linux filesystemhierarchyLinux filesystemhierarchy
Linux filesystemhierarchy
 
Linux basics
Linux basics Linux basics
Linux basics
 
OS_lab_file.pdf
OS_lab_file.pdfOS_lab_file.pdf
OS_lab_file.pdf
 
Linux basics
Linux basics Linux basics
Linux basics
 
Unix Shell and System Boot Process
Unix Shell and System Boot ProcessUnix Shell and System Boot Process
Unix Shell and System Boot Process
 
Order of boot process in Linux
Order of boot process in LinuxOrder of boot process in Linux
Order of boot process in Linux
 
101 1.2 boot the system
101 1.2 boot the system101 1.2 boot the system
101 1.2 boot the system
 

Dernier

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Dernier (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

Linux startup

  • 1. Linux Startup By: Amin Hashemi AmirKabir University of technology Computer Engineering & Information Technology Department
  • 2. Contents  System startup  Services  Controlling boot services  References
  • 4. System startup- BIOS  BIOS stands for Basic Input/output System  Performs some system integrity checks  Searches, loads, and executes the boot loader program.  It looks for boot loader in floppy, CD-ROM, or hard drive. You can press a key (typically F12 of F2, but it depends on your system) during the BIOS startup to change the boot sequence.  Once the boot loader program is detected and loaded into the memory, BIOS gives the control to it.  So, in simple terms BIOS loads and executes the MBR boot loader.
  • 5. System startup- MBR  MBR stands for Master Boot Record.  It is located in the 1st sector of the bootable disk. Typically /dev/hda, or /dev/sda  MBR is less than 512 bytes in size. This has three components:  1) primary boot loader info in 1st 446 bytes  2) partition table info in next 64 bytes  3) MBR validation check in last 2 bytes.  It contains information about GRUB (or LILO in old systems).  So, in simple terms MBR loads and executes the GRUB boot loader.
  • 6. System startup- GRUB  GRUB stands for Grand Unified Bootloader.  If you have multiple kernel images installed on your system, you can choose which one to be executed.  GRUB displays a splash screen, waits for few seconds, if you don‟t enter anything, it loads the default kernel image as specified in the GRUB configuration file.  GRUB has the knowledge of the filesystem (the older Linux loader LILO didn‟t understand filesystem).
  • 7. System startup- Kernel  Mounts the root file system as specified in the “root=” in grub.conf  Kernel executes the /usr/src/linux/init/main.c program  Since init was the 1st program to be executed by Linux Kernel, it has the process id (PID) of 1. Do a „ps -ef | grep init‟ and check the pid.  initrd stands for Initial RAM Disk.  initrd is used by kernel as temporary root file system until kernel is booted and the real root file system is mounted. It also contains necessary drivers compiled inside, which helps it to access the hard drive partitions, and other hardware.
  • 8. System startup- Kernel (cont.)  Details about the specific sequence of events or what happens when the Linux kernel is loaded.  Recognize, set up and initialize the CPU(s).  Set up kernel memory and process handling.  Initialize configured system devices.  Start memory handling (paging, …).  Set up and mount the file system.  Start the init command.
  • 9. System startup- init  After the kernel has detected computer‟s hardware and load the correct device driver, init is started.  The last step of kernel booting.  It s the parent of all processes.  PID = 1  init role:  The primary role of init is to create processes from a script stored in /etc/inittab.  Running scripts in /etc/rc.d.
  • 10. System startup- init- /etc/inittab  This file describes how the init process should setup the system in a certain run level.  /etc/inittab format:  Id:run-level:action:process  Id: a unique 1-4 character which identifies an entry in inittab.  Run-level: run level number.  Action: which action should be taken (wait, boot, initdefault, …)  Process: the process to be executed.
  • 11. System startup- init- /etc/rc.d  rc  Performs master control of which scripts to execute.  rc.sysinit  The system initialization script  rc.local  Used for local initialization  /etc/rc.d/inid.d/  A number of scripts used to start and stop services  /etc/rc.d/rc*.d/ (* : 0–6)  Each file is merely a soft link to a script under init.d
  • 12. System startup- init- rc.sysinit  This file is interpreted by init once at boot time.  It contains bash shell script logic to perform some the following:  Sets the system hostname  Reads in network configuration data  Prints welcome banner for login  Configures the kernel  Sets up the system time  Sets the console and keyboard mapping  …
  • 13. System startup- Run levels  A run-level is a software configuration of the system which allows only a selected group of processes to exist.  When the Linux system is booting up, you might see various services getting started. For example, it might say “starting sendmail …. OK”. Those are the runlevel programs, executed from the run level directory as defined by your run level.
  • 14. System startup- Run levels (cont.)  Depending on your default init level setting, the system will execute the programs from one of the following directories:  Run level 0 – halt (/etc/rc.d/rc0.d/) : Shuts down the system.  Run level 1 – single user mode (/etc/rc.d/rc1.d/) :Mode for administrative tasks.  Run level 2 – multiuser, without NFS (/etc/rc.d/rc2.d/) :Does not configure network interfaces and does not export networks services.  Run level 3 – full multiuser mode (/etc/rc.d/rc3.d/) : Starts the system normally.  Run level 4 – unused (/etc/rc.d/rc4.d/) :For special purposes.  Run level 5 – Multi-User mode, with display manager as well as console logins(X11) (/etc/rc.d/rc5.d/) :As runlevel 3 + display manager.  Run level 6 – reboot (/etc/rc.d/rc6.d/) :Reboots the system.
  • 15. Services  /etc/rc.d/init.d/  A number of scripts used to start and stop services
  • 16. Run Level and Services  The scripts (in /etc/rc.d/rc*.d/) are actually symbolic links to system service scripts under the /etc/rc.d/init.d/ directory. So, /etc/rc0.d is linked to /etc/rc.d/rc0.d.  Under the /etc/rc.d/rc*.d/ directories, you would see programs that start with S and K.  Programs starts with S are used during startup. S for Startup.  Programs starts with K are used during shutdown. K for kill.  There are numbers right next to S and K in the program names. Those are the sequence number in which the programs should be started or killed.  Example:  K12mysql  S12syslog  S10network  S80sendmail
  • 17. Controlling Boot Services  Manually rename Scripts  Rename K to S and vice versa  Change the number followed by K/S  Manually start and stop services  {start | stop | restart | status}  /etc/rc.d/init.d/network start  service network start  Through graphical tool  ntsysv
  • 18. Controlling Boot Services  Changing Run Levels  The telinit command is used to change run-levels on-the-fly on a running Linux system.  telinit 5
  • 19. References  http://www.thegeekstuff.com/2011/02/linux-boot-process/  https://www.linux.com/news/enterprise/systems- management/8116-an-introduction-to-services-runlevels-and- rcd-scripts  http://en.wikipedia.org/wiki/Linux_startup_process  http://en.wikipedia.org/wiki/Runlevel  Mr. Hamed Janzadeh‟s slides about linux startup
  • 20.
  • 21. Thank you  Website: Http://www.AminHashemi.com  E-mail: Amin [at] aminhashemi [dot] com