[No audio]
Linux boot process. So in this lesson, we
will learn how the system boots up. So
I'm sure you probably wondered that when
you press the power button on your
laptop or your computer, then after
a few minutes, a few seconds your
computer come up, you get a login prompt
and your system started. But have you
ever wondered what exactly happens under
the hood? Meaning you start up your car
and ignites the spark and start up your
car, right, but what happened exactly
behind the scene? So I want to cover
that because it's one of the very
important lessons. And some of the
things in this lesson are important in
terms of interview, a lot of people ask
you questions about what happen, or
tell us the sequence of boot process. In
this picture, you will see exactly the
six steps that a system takes place in
order to bring your system to a level
where you will be able to log in. The
first one is every time you press the
power button on your computer, it goes
to BIOS. What BIOS stands for is, basic
input and output of a system. At this
stage, it performs some system integrity
checks, loads and execute bootloader
program. It looks for bootloader like
floppy disk or CD ROM or your hard drive,
it tries to find out how to boot, where's
it located, where do I have to go to
bring the system up. The next thing that
it does, it goes to MBR. Now MBR stands
for master boot record. It is located in
the first sector of the bootable disk,
typically like DEV, HDA, or SDA Linux. So
this is the first sector on your disk
where it is located to start the computer.
MBR is somehow like 512 megabytes in
just bytes and sizes, very small. And
this, it contains information about GRUB.
The next step it does its goes to GRUB.
GRUB stands for grand unified boot
loader. If you have multiple kernel
images installed on your system, you can
choose which one to be executed. So
there could be older version of Kernel,
newer version of your Kernel, you could
start it on any of the Kernel, and that
option is given to you by GRUB. And GRUB
configuration files are located in slash
boot slash grub, and the file is
grub.conf. You can modify it if you want
to change the order of your system
startup. The next one, after the GRUB
comes the Kernel. The Kernel is the one
that mounts the root filesystem as
specified in the root equal in grub.conf
file. That's exactly in the
grub.conf file is, it actually execute the
init program. Kernel executes the slash sbin,
slash init program, then it starts
the initial RAM disk, and initial RAM
disk which is initrd is used by
Kernel as a temporary root filesystem
until Kernel is booted and the real
root filesystem is mounted. It
also contains necessary drives compiled
inside which helps us to access the hard
drive partition and other hardware. The
next one goes through the the boot
process is init. It looks like, the
slash etc inittab. This is the file
to decide the Linux run level. So if you
wanted to boot your system in a
different run levels, let's say there
are six run levels, actually seven run
levels. There is 0 for a halt, 1 for
single user mode, 2 for multiuser,
3 for full multiuser mode, and 5
is unused if sorry, 4 is unused,
5 is to boot the system in x11 and
6 is to reboot. These are the run
levels that are defined inside of the
init, slash inittab file.
[No audio]
Once it does that, then the runlevel program
begins to start, and every
run level program has its own directory,
and that directory is /etc/rc.d/rc,
enter digit, which is run level digit,
and .d. Every file, every boot order
is in these files. So here are the run
levels. We could go over a few of them
in our Linux environment. So let me log
into my Linux machine, clear the screen.
I want to become root, because some of
these files can only be accessed through
root. So the first one is BIOS, which is
located on the disk. The second one is
MBR, and let's go to the Kernel, which
is sbin/init. So we'll go etc,
sorry, sbin/init.
[Author typing]
Then you have other run programs, we
could go to the other run programs like
/etc/rc .d/, and here you see all
the run levels. If you wanted to start your
computer and run level five. So let's
see which run level we are in?who minus
r, we are in run level five. So we'll go
into rc5.d. And here it's
telling it to start the console, which
is the GUI, and start the network, which
is network. So this is what exactly run
level five is. And that's how your
computer is started, you get the login
prompt, and there are also many many
different documentation online you can
find out about how the system boots up.
And of course I will encourage you to go
look them up and understand exactly how
Linux boot process works.
[No audio]