CLICK HERE TO DOWNLOAD PPT ON Linux Booting Procedure
Linux Booting Procedure Presentation Transcript
1.Linux Booting Procedure
2.How Linux boot?
3.System startup
4.How computer startup?
Booting is a bootstrapping process that starts operating systems when the user turns on a computer system
A boot sequence is the set of operations the computer performs when it is switched on that load an operating system
Booting is a bootstrapping process that starts operating systems when the user turns on a computer system
A boot sequence is the set of operations the computer performs when it is switched on that load an operating system
5.Booting sequence
6.BIOS (Basic Input/Output System)
BIOS refers to the software code run by a computer when first powered on
The primary function of BIOS is code program embedded on a chip that recognises and controls various devices that make up the computer.
BIOS refers to the software code run by a computer when first powered on
The primary function of BIOS is code program embedded on a chip that recognises and controls various devices that make up the computer.
7.Boot loader
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 on the disk (sector 1 of cylinder 0, head 0)
After the MBR is loaded into RAM, the BIOS yields control to it.
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 on the 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.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
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.
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
LILO and GRUB are two of the popular boot loaders used today. LILO was used as the default boot loader in Linux for a very long time, but recently GRUB has taken its place
GRUB and LILO are the most popular Linux boot loader.
Boot loader could be more aptly called the kernel loader. The task at this stage is to load the Linux kernel
LILO and GRUB are two of the popular boot loaders used today. LILO was used as the default boot loader in Linux for a very long time, but recently GRUB has taken its place
GRUB and LILO are the most popular Linux boot loader.
13.Other boot loader (Several OS)
bootman
GRUB
LILO
NTLDR
XOSL
BootX
loadlin
Gujin
Boot Camp
Syslinux
GAG
bootman
GRUB
LILO
NTLDR
XOSL
BootX
loadlin
Gujin
Boot Camp
Syslinux
GAG
14.GRUB: GRand Unified Bootloader
GRUB is an operating system independant boot loader
A multiboot software packet from GNU
Flexible command line interface
File system access
Support multiple executable format
Support diskless system
Download OS from network
Etc.
GRUB is an operating system independant boot loader
A multiboot software packet from GNU
Flexible command line interface
File system access
Support multiple executable format
Support diskless system
Download OS from network
Etc.
15.What is GRUB?
GRUB (GNU GRand Unified Boot loader) is a boot loader developed by GNU project. GRUB allows the user to select from a list of operating systems to load, making it possible to have multiple operating systems on the same machine.
GRUB is the default boot loader used in most Linux distributions today. GRUB can be configured dynamically as it allows changes to the configuration at the time of booting. Users are provided with a simple command line interface to insert new boot configurations dynamically.
GRUB has many user-friendly features like high portability, support for many executable formats, independence from geometry translation and support for all types of files systems such as most UNIX systems, VFAT, NTFS, and LBA (Logical Block Address) mode.
16.GRUB boot process
The BIOS finds a bootable device (hard disk) and transfers control to the master boot record
The MBR contains GRUB stage 1. Given the small size of the MBR, Stage 1 just load the next stage of GRUB
GRUB Stage 1.5 is located in the first 30 kilobytes of hard disk immediately following the MBR. Stage 1.5 loads Stage 2.
GRUB Stage 2 receives control, and displays to the user the GRUB boot menu (where the user can manually specify the boot parameters).
GRUB loads the user-selected (or default) kernel into memory and passes control on to the kernel.
GRUB (GNU GRand Unified Boot loader) is a boot loader developed by GNU project. GRUB allows the user to select from a list of operating systems to load, making it possible to have multiple operating systems on the same machine.
GRUB is the default boot loader used in most Linux distributions today. GRUB can be configured dynamically as it allows changes to the configuration at the time of booting. Users are provided with a simple command line interface to insert new boot configurations dynamically.
GRUB has many user-friendly features like high portability, support for many executable formats, independence from geometry translation and support for all types of files systems such as most UNIX systems, VFAT, NTFS, and LBA (Logical Block Address) mode.
16.GRUB boot process
The BIOS finds a bootable device (hard disk) and transfers control to the master boot record
The MBR contains GRUB stage 1. Given the small size of the MBR, Stage 1 just load the next stage of GRUB
GRUB Stage 1.5 is located in the first 30 kilobytes of hard disk immediately following the MBR. Stage 1.5 loads Stage 2.
GRUB Stage 2 receives control, and displays to the user the GRUB boot menu (where the user can manually specify the boot parameters).
GRUB loads the user-selected (or default) kernel into memory and passes control on to the kernel.
17.Listing 2. Example grub.conf file
default=0
timeout=10
splashimage=(hd1,2)/grub/splash.xpm.gz
title Red Hat Linux
root (hd1,2)
kernel /vmlinuz-2.4.18-14 ro root=LABEL=/
initrd /initrd-2.4.18-14.img
title Windows XP
password --md5 $1$0peVt0$Y.br.18LyAasRsGdSKLYlp1
rootnoverify (hd0,0)
chainloader +1
18.Example GRUB config file
default=0
timeout=10
splashimage=(hd1,2)/grub/splash.xpm.gz
title Red Hat Linux
root (hd1,2)
kernel /vmlinuz-2.4.18-14 ro root=LABEL=/
initrd /initrd-2.4.18-14.img
title Windows XP
password --md5 $1$0peVt0$Y.br.18LyAasRsGdSKLYlp1
rootnoverify (hd0,0)
chainloader +1
18.Example GRUB config file
19.LILO: LInux LOader
Not depend on a specific file system
Can boot from harddisk and floppy
Up to 16 different images
Must change LILO when kernel image file or config file is changed
Not depend on a specific file system
Can boot from harddisk and floppy
Up to 16 different images
Must change LILO when kernel image file or config file is changed
20.LILO (LInux LOader)
LILO (LInux LOader) is a boot loader used in Linux operating systems. LILO can boot (up to 16) operating systems from floppy disks, hard disks, etc. because it is not dependent on a specific file system.
The user can place LILO in either the Master Boot Record (MBR) or the boot sector of a partition (and place something else in MBR to load LILO).
LILO was used as the default boot loader in Linux till late 2001. It is now included in the list of depreciated packages (in Red Hat).
LILO (LInux LOader) is a boot loader used in Linux operating systems. LILO can boot (up to 16) operating systems from floppy disks, hard disks, etc. because it is not dependent on a specific file system.
The user can place LILO in either the Master Boot Record (MBR) or the boot sector of a partition (and place something else in MBR to load LILO).
LILO was used as the default boot loader in Linux till late 2001. It is now included in the list of depreciated packages (in Red Hat).
21.
Listing 1. Example lilo.conf file
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=100
compact
default=Linux
image=/boot/vmlinuz-2.4.18-14
label=Linux
root=/dev/hdb3
read-only
password=linux
other=/dev/hda
label=WindowsXP
Listing 1. Example lilo.conf file
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=100
compact
default=Linux
image=/boot/vmlinuz-2.4.18-14
label=Linux
root=/dev/hdb3
read-only
password=linux
other=/dev/hda
label=WindowsXP
22.What is difference between GRUB and LILO ?
GRUB has a better interactive command line interface compared to LILO’s, which only allows a single command with arguments. Because LILO stores location information of operating systems in MBR, every time a new operating system is added, the user should manually overwrite the configuration file, and this could very easily create a misconfigured configuration file.
Compared to LILO, GRUB has very good technical support. LILO cannot boot from network, while GRUB certainly can. But on the other hand, since LILO was used, developed and tested for a very long time, most Linux administrators are well aware of configuring and handling problems with LILO even without any documentation.
GRUB has a better interactive command line interface compared to LILO’s, which only allows a single command with arguments. Because LILO stores location information of operating systems in MBR, every time a new operating system is added, the user should manually overwrite the configuration file, and this could very easily create a misconfigured configuration file.
Compared to LILO, GRUB has very good technical support. LILO cannot boot from network, while GRUB certainly can. But on the other hand, since LILO was used, developed and tested for a very long time, most Linux administrators are well aware of configuring and handling problems with LILO even without any documentation.
23.Kernel
24.Kernel image
The kernel is the central part in most computer operating systems because of its task, which is the management of the system's resources and the communication between hardware and software components
Kernel is always store on memory until computer is tern off
Kernel image is not an executable kernel, but a compress kernel image
zImage size less than 512 KB
bzImage size greater than 512 KB
The kernel is the central part in most computer operating systems because of its task, which is the management of the system's resources and the communication between hardware and software components
Kernel is always store on memory until computer is tern off
Kernel image is not an executable kernel, but a compress kernel image
zImage size less than 512 KB
bzImage size greater than 512 KB
25.Task of kernel
Process management
Memory management
Device management
System call
Process management
Memory management
Device management
System call
26.Major functions flow for Linux kernel boot
27.Init process
The first thing the kernel does is to execute init program
Init is the root/parent of all processes executing on Linux
The first processes that init starts is a script /etc/rc.d/rc.sysinit
Based on the appropriate run-level, scripts are executed to start various processes to run the system and make it functional
The first thing the kernel does is to execute init program
Init is the root/parent of all processes executing on Linux
The first processes that init starts is a script /etc/rc.d/rc.sysinit
Based on the appropriate run-level, scripts are executed to start various processes to run the system and make it functional
28.The Linux Init Processes
The init process is identified by process id "1“
Init is responsible for starting system processes as defined in the /etc/inittab file
Init typically will start multiple instances of "getty" which waits for console logins which spawn one's user shell process
Upon shutdown, init controls the sequence and processes for shutdown
The init process is identified by process id "1“
Init is responsible for starting system processes as defined in the /etc/inittab file
Init typically will start multiple instances of "getty" which waits for console logins which spawn one's user shell process
Upon shutdown, init controls the sequence and processes for shutdown
29.System processes
30.Inittab file
The inittab file describes which processes are started at bootup and during normal operation
/etc/init.d/boot
/etc/init.d/rc
The computer will be booted to the runlevel as defined by the initdefault directive in the /etc/inittab file
id:5:initdefault:
The inittab file describes which processes are started at bootup and during normal operation
/etc/init.d/boot
/etc/init.d/rc
The computer will be booted to the runlevel as defined by the initdefault directive in the /etc/inittab file
id:5:initdefault:
31.Runlevels
A runlevel is a software configuration of the system which allows only a selected group of processes to exist
The processes spawned by init for each of these runlevels are defined in the /etc/inittab file
Init can be in one of eight runlevels: 0-6
A runlevel is a software configuration of the system which allows only a selected group of processes to exist
The processes spawned by init for each of these runlevels are defined in the /etc/inittab file
Init can be in one of eight runlevels: 0-6
32.Runlevels
33.rc#.d files
rc#.d files are the scripts for a given run level that run during boot and shutdown
The scripts are found in the directory /etc/rc.d/rc#.d/ where the symbol # represents the run level
rc#.d files are the scripts for a given run level that run during boot and shutdown
The scripts are found in the directory /etc/rc.d/rc#.d/ where the symbol # represents the run level
34.init.d
Deamon is a background process
init.d is a directory that admin can start/stop individual demons by changing on it
/etc/rc.d/init.d/ (Red Hat/Fedora )
/etc/init.d/ (S.u.s.e.)
/etc/init.d/ (Debian)
35.Start/stop deamon
Admin can issuing the command and either the start, stop, status, restart or reload option
i.e. to stop the web server:
cd /etc/rc.d/init.d/
(or /etc/init.d/ for S.u.s.e. and Debian)
httpd stop
Deamon is a background process
init.d is a directory that admin can start/stop individual demons by changing on it
/etc/rc.d/init.d/ (Red Hat/Fedora )
/etc/init.d/ (S.u.s.e.)
/etc/init.d/ (Debian)
35.Start/stop deamon
Admin can issuing the command and either the start, stop, status, restart or reload option
i.e. to stop the web server:
cd /etc/rc.d/init.d/
(or /etc/init.d/ for S.u.s.e. and Debian)
httpd stop
36.System Services
A Linux service is an application (or set of applications) that runs in the background waiting to be used, or carrying out essential tasks. (Apache and MySQL).
Linux services are basically programs that start at boot time to provide certain features and services (Apache, the web server for example). After installation, every Linux distribution provides a list of enabled services.
I’ll start by explaining how to manage the system services, how to choose which ones will start on system boot and which don’t.
37.System services
The rc script is responsible for starting all the services that the users require. As the name suggests, services are useful facilities that the system provides. There are potentially lots of services to start. Most Linux systems will start sshd (the Secure Shell service), syslog (system logging facility), and lpd (printing service), but there could be many more. As an example, one of my Red Hat 9 system currently runs 29 services, but if I switched on all the services, this number would be closer to 50.
Where do services live?
On some Linux systems, services are sometimes located in the /etc/init.d/ directory
Services are usually found in the /etc/rc.d/init.d/ directory.
A Linux service is an application (or set of applications) that runs in the background waiting to be used, or carrying out essential tasks. (Apache and MySQL).
Linux services are basically programs that start at boot time to provide certain features and services (Apache, the web server for example). After installation, every Linux distribution provides a list of enabled services.
I’ll start by explaining how to manage the system services, how to choose which ones will start on system boot and which don’t.
37.System services
The rc script is responsible for starting all the services that the users require. As the name suggests, services are useful facilities that the system provides. There are potentially lots of services to start. Most Linux systems will start sshd (the Secure Shell service), syslog (system logging facility), and lpd (printing service), but there could be many more. As an example, one of my Red Hat 9 system currently runs 29 services, but if I switched on all the services, this number would be closer to 50.
Where do services live?
On some Linux systems, services are sometimes located in the /etc/init.d/ directory
Services are usually found in the /etc/rc.d/init.d/ directory.
38.Internet and Webservices
39. Internet
What is The Internet?
The Internet is a massive network of networks, a networking infrastructure. It connects millions of computers together globally, forming a network in which any computer can communicate with any other computer as long as they are both connected to the Internet. Information that travels over the Internet does so via a variety of languages known as protocols.
Fedora / Red Hat Network Configuration Files:
/etc/sysconfig/network Red Hat network configuration file used by the system during the boot process.
File: /etc/sysconfig/network-scripts/ifcfg-eth0 Configuration settings for your first Ethernet port (0). Your second port is eth1.
File:
/etc/modprobe.conf
/etc/modules.conf
40.The first thing your browser has to do is to establish a network connection to the machine where the document lives. To do that, it first has to find the network location of the host www.tldp.org The corresponding location is actually a number called an IP address (we'll explain the ‘IP’ part of this term later).To do this, your browser queries a program called a name server. The name server may live on your machine, but it's more likely to run on a service machine that yours talks to. When you sign up with an ISP, part of your setup procedure will almost certainly involve telling your Internet software the IP address of a nameserver on the ISP's network.
The nameserver will tell your browser that www.tldp.org's IP address is 152.19.254.81; knowing this, your machine will be able to exchange bits with www.tldp.org directly.
41.The Domain Name System
The whole network of programs and databases that cooperates to translate hostnames to IP addresses is called ‘DNS’ (Domain Name System). When you see references to a ‘DNS server’, that means what we just called a nameserver.
Internet hostnames are composed of parts separated by dots. A domain is a collection of machines that share a common name suffix. Domains can live inside other domains. For example, the machine www.tldp.org lives in the .tldp.org subdomain of the .org domain.
Each domain is defined by an authoritative name server that knows the IP addresses of the other machines in the domain. The authoritative (or ‘primary') name server may have backups in case it goes down; if you see references to a secondary name server or (‘secondary DNS') it's talking about one of those. These secondaries typically refresh their information from their primaries every few hours, so a change made to the hostname-to-IP mapping on the primary will automatically be propagated.
What is The Internet?
The Internet is a massive network of networks, a networking infrastructure. It connects millions of computers together globally, forming a network in which any computer can communicate with any other computer as long as they are both connected to the Internet. Information that travels over the Internet does so via a variety of languages known as protocols.
Fedora / Red Hat Network Configuration Files:
/etc/sysconfig/network Red Hat network configuration file used by the system during the boot process.
File: /etc/sysconfig/network-scripts/ifcfg-eth0 Configuration settings for your first Ethernet port (0). Your second port is eth1.
File:
/etc/modprobe.conf
/etc/modules.conf
40.The first thing your browser has to do is to establish a network connection to the machine where the document lives. To do that, it first has to find the network location of the host www.tldp.org The corresponding location is actually a number called an IP address (we'll explain the ‘IP’ part of this term later).To do this, your browser queries a program called a name server. The name server may live on your machine, but it's more likely to run on a service machine that yours talks to. When you sign up with an ISP, part of your setup procedure will almost certainly involve telling your Internet software the IP address of a nameserver on the ISP's network.
The nameserver will tell your browser that www.tldp.org's IP address is 152.19.254.81; knowing this, your machine will be able to exchange bits with www.tldp.org directly.
41.The Domain Name System
The whole network of programs and databases that cooperates to translate hostnames to IP addresses is called ‘DNS’ (Domain Name System). When you see references to a ‘DNS server’, that means what we just called a nameserver.
Internet hostnames are composed of parts separated by dots. A domain is a collection of machines that share a common name suffix. Domains can live inside other domains. For example, the machine www.tldp.org lives in the .tldp.org subdomain of the .org domain.
Each domain is defined by an authoritative name server that knows the IP addresses of the other machines in the domain. The authoritative (or ‘primary') name server may have backups in case it goes down; if you see references to a secondary name server or (‘secondary DNS') it's talking about one of those. These secondaries typically refresh their information from their primaries every few hours, so a change made to the hostname-to-IP mapping on the primary will automatically be propagated.
42.Web Services
The term Web services describes a standardized way of integrating Web-based applications using the XML, SOAP, WSDL and UDDI open standards over an Internet protocol backbone. XML is used to tag the data, SOAP is used to transfer the data, WSDL is used for describing the services available and UDDI is used for listing what services are available. Used primarily as a means for businesses to communicate with each other and with clients, Web services allow organizations to communicate data without intimate knowledge of each other's IT systems behind the firewall
Unlike traditional client/server models, such as a Web server/Web page system, Web services do not provide the user with a GUI. Web services instead share business logic, data and processes through a programmatic interface across a network. The applications interface, not the users. Developers can then add the
The term Web services describes a standardized way of integrating Web-based applications using the XML, SOAP, WSDL and UDDI open standards over an Internet protocol backbone. XML is used to tag the data, SOAP is used to transfer the data, WSDL is used for describing the services available and UDDI is used for listing what services are available. Used primarily as a means for businesses to communicate with each other and with clients, Web services allow organizations to communicate data without intimate knowledge of each other's IT systems behind the firewall
Unlike traditional client/server models, such as a Web server/Web page system, Web services do not provide the user with a GUI. Web services instead share business logic, data and processes through a programmatic interface across a network. The applications interface, not the users. Developers can then add the
43. …Web service to a GUI (such as a Web page or an executable program) to offer specific functionality to users.
Web services allow different applications from different sources to communicate with each other without time-consuming custom coding, and because all communication is in XML, Web services are not tied to any one operating system or programming language. For example, Java can talk with Perl, Windows applications can talk with UNIX applications.
Web services do not require the use of browsers or HTML.
Web services are sometimes called application services.
Web services allow different applications from different sources to communicate with each other without time-consuming custom coding, and because all communication is in XML, Web services are not tied to any one operating system or programming language. For example, Java can talk with Perl, Windows applications can talk with UNIX applications.
Web services do not require the use of browsers or HTML.
Web services are sometimes called application services.
0 comments