Hey, folks, and welcome to the control board process video.
In this lesson, we will learn the live export process said the default target used when booting the
system and Buddah system to a non a default target for the more we will cover about how to recover Rup
password in case you lose or don't remember the password, then what are the different ways to recover
the root password?
And then the last thing we will learn in this lesson is to repairing file system configuration or corruption
issues.
The boot sequence changes in S.O.S and RedHat, seven and above and some of the other operating systems
as well.
So if you're using RedHat five as five or six, you probably going to notice that it has or its uses
a different boot process in the in the newer version of S.O.S or Red, had it actually utilized a different
boot process.
And this is what we are going to cover.
The System D is a new service manager and sent to us and seven that actually manages the boot sequence.
It is backward compatible with System four and it's also a system five.
And it's crêpes is used by previous versions of RedHat Linux, including Réal five as well.
So you could use this process to run at that, could run on the previous versions as well.
Now every system administrators needs to understand the boot process of an operating system.
I would say, whether it's Linux, Windows or whatever the operating system is in order to troubleshoot
more effectively, because what happens if the system doesn't boot?
Then you need to understand all the sequence where it it goes through, how it goes through, which
part it reads.
So you could troubleshoot and go through each of them to identify the problem.
So let's go into the next slide and I will show you in a graphical way how this boot process works.
The first thing first is as soon as you power on a machine or a computer, it actually has a funny way
in it.
And remember, that firmware has nothing to do with the operating system.
That firmware actually comes in with that machine preinstalled by that manufacturer.
That firmware is called BIOS, which is referred to as basic input and output setting.
So it starts up it takes the power on, it starts up and it goes to the post-process and the post-process
is power on self-test started meaning it starts up and then it goes to all the hardware that is attached
that makes the entire computer system.
It goes through every one of them and checks.
Hey, you OK?
Are you OK?
Are you up.
Are there any problems with the hardware?
It goes through that post check.
After that, the NBER is loaded, NBER stands for Master Board record.
The information is saved in the first sector of the hard disk that is referred to as MDR, which indicates
where the Grubbed two is located so it can be loaded in the computer ram.
So bias looks up, does the post and then it it goes to the first sector of the disk and finds out that
NPR member has information of Grubert two and the Grubbed two stands for Grand Unified Bootloader.
And it is it is called as two meaning version two and it predates version one, which doesn't have one
it on it, but it just says Grupp.
So basically Grubbed two job is to load the kernel, the Linux kernel, and that information is in slash
boot slash grub to slash grub dot cfg, which is the config file.
So when you boot up your Linux operating system, you probably don't see the bios and pull post because
it goes through your screen so fast and MVR is probably not noticed because that's the time your machine
is looking for that sector.
But you will see at one point on your screen, on your black screen, it's going to show up as Linux
kernel and sometimes you probably going to see one, two, three or five different kernels that it needs
to load, it needs support from.
So you could at that time also move your cursor up and down and select the kernel you want to load or
let the system decide which kernel it's going to load it depending on the grub configuration.
All right.
So now the kernel comes up, Kernel says, OK, the grub asked me to to start, OK, the kernel is the
core of the operating system.
So what it does is it loads the required drivers and it r d dot img file.
Now this is the colonel's job is to load the driver, meaning every hardware that is attached to your
machine.
It in order for it to work, the kernel has to communicate to that hardware.
So the kernel in order for kernel to communicate it has to has that.
Why that talks to the hardware, say, loads up all those hardware, and then it starts the first,
very first OS, our operating system process that is called System D now system D, as I said earlier,
it's a new process introducing the newer version of Linux.
So it starts up the next step as the last of the system D starts up.
And of course, this is the first process in the system and by default it is given a process ID of no
one.
As the other process starts, that gets the incremental numbers of the process.
It's then start all the required processes that is needed that were enabled at the time.
Then it reads the azzi system D system default, the target file this this to bring the system to the
run level.
Now every system, every Linux system has a total of seven run levels.
That goes from six through zero through six, which defines where it's going to start.
It needs a networking single user mode or if it's actually needs to shut down.
All those run levels are actually defined in default dot target file.
So it looks up that in the file sees which target file it has to solve, which one level it has to start,
and that's how your system becomes online.
So this is a learning process.
And as I said, this is a newer process that's introduced to lately in newer versions.
So definitely go through this.
This is one of the important things that every system administrator needs to know, needs to remember
while they are troubleshooting the issue.
All right.
Good luck.
Hey, guys, in this slide, we will learn how to reboot or shut down your Linux machine to power off
or reboot a system from the command line, you could use the system CTL command.
Yes, it becomes a lot easier if you use system ctrl space with the option of power off.
This command will stop all running services, unmount all your file systems and then powers down your
system.
Then you could also use system ctrl reboot, which would do everything that a power would do.
In addition to that, it will reboot your system or bring the system back online.
Now they are sure to come in a shorter version of these commands that could be used, for example,
shut down power off and reboot, which are the symbolic links to this system, C equivalents.
Hey, guys, let's spend some time and learn how we could select a system D target their different targets
and we'll talk about that in this slide.
So System D, as you all know, is the very first a Linux process which decides at which are run level
the operating system needs to be in.
There are different run levels and a system Boutte's the run levels are from zero to six altogether.
They are seven run levels and each run level has a different meaning.
So these run levels are now referred to as targets.
The following table list the most important targets.
The first one is a graphical dot target.
That's how the option or argument is given to the command, which will cover in the next slide.
So the graphical dot target, its purpose is systems supports multiple user graphics and text based
login.
So the W when the system builds up, it will allow multiple users to log in.
It will give you a GUI based environment and text based logins.
Then the second one is multi dashi user dot target system support multiple users just like the graphical
dot target and text based logins only.
So it does not include the gooey, the graphical.
Then we have the third one rescue target as you log in prompts Basche system initialization completed
at this at this point.
And then we have emergency dot target as you login prompt and it ramp a file system, pivot complete
and system mount route mount on read only.
By the way these two target rescue dot target and emergency target target are the targets are given
to the system.
If you are going to perform any maintenances, any emergencies, any if you wanted to put off of a CD
or something like that.
All right.
So to check the current target or run level of our system for our running system, we will run the command
system, ctrl get divil.
So if you remember, System CTL is the command that we use to manage the system services, so we will
use the same command to manage the system targets.
So I have my Linux machine open.
It's up and running, logged then as a route, and to check the default targets that my system is in
right now, I would run system CTL, get DOT deploy
system ctrl.
Get ready for.
Oh, sorry, it's not Dot.
It's Desh, sorry, that's a mistake on my slide, which I will fix, but you could disregard that dot
and you have to run the command systems, you'll get dash default and you'll see right here the output
is graphical target.
So the reason we have this graphical target is because I am logged into the console.
I am I have the GUI right here and if you click on terminal activities, you'll see all the GUI activities.
I am I don't have a text based I mean, I could go in as a text book, but it's given me as.
As the graphical, which is equivalent to run level five.
All right, next one, you can also do who minus are so who minus R?
OK, right here, minimize this.
Who mines are right here, it says run level five.
So, as I said, around level five is equivalent to graphical target.
All right, then a target can be part of another target.
For example, a graphical target includes multiuse, a target which in turns depends on basic target
and others.
So there is a dependency.
If you want to run graphical target, it has to run multiple use a target and basic target.
Then moving on, you can view these dependencies with the following command system list.
Dash dependencies, graphical target, animal grep for target.
So let's go right in.
And we'll run the command system CTL list dependencies.
Graphical.
And let's move this graphic to target.
And real growth for Target, because it will give us a lot of information, we would just focus on the
target.
So right here, as you could see graphically, that target has dependency on multiuser, that target
and Multiuser has a dependency on basic target and so on.
All right.
Moving down, you can display the new ground level targets by issuing the following command.
So all the run levels which are run level is equal to which Target will find that out by running this
command.
Let me move this up.
And let's clear the screen now, that's minus a L dash lib system, CTL.
System, D.R.C. system.
Run level and just put an asterisk at the end and you're going to see, OK, let me just get rid of
a because A will give me all the files with the symbolic link as well.
All right.
So there it is.
That's my cell.
And you're going to notice right here, run level zero is actually referred to are actually getting
the target power off on level one is rescue run.
Level two is multiuser run.
Level three is multiuse a target as well.
Four is also multiuser target five is GraphicLy Target and six is a reboot target.
So all these run levels, if you are familiar with these run levels, you just have to remember now
that these run levels are now referred to as these targets and you could manage the process of your
system through these targets.
All right, then setting the default target so we know when we run system CTL get Dasch default, we'll
get the current run level.
What if you want to change their run though?
So let's go back to this machine again, clear the screen and we'll do system.
We'll get the default.
And this is telling me that my current target level is graphical target.
What if I wanted to change it to let's say multi-user target?
I will do system CTL set default mode the.
User sorry, I think it's multi dash user dot target when I would run that.
And now and I will if I try to log out or reboot the system, I'm not going to have that graphical view
that I'm looking at right now.
So if I do system still get Dashty fault, it will give me multiuser targets right here.
It's no longer give me the graphical target.
I'll have to do a reboot and it will not show me this graphical way.
So let me set it back.
To.
Graphical dash target and unit file graphical target does not exist, what's going on?
Oh, graphical dot target.
OK, let's check.
Get a default and its graphical dot target.
Not beautiful.
So this is how you could manage or change a different to run levels off your system when it builds up.
Recovering root password, every system administrator in his or her life faces this issue where they
have to recover old password.
And why do they face that is because they either have to comply with security standard to change the
password.
Every now and then they change it.
But then they forget after a year or two or they fat fingered while changing their password and now
they cannot recover it.
So how do we change it?
You have to restart your computer.
Why?
I could just simply tie password followed by the route and change it.
Right?
Well, now, because in order to run the command password space route, you have to be route and to
be route, you have to put in the password.
It's like catch 22.
So how do you solve that problem?
Well, I'd say it's not that simple.
Why?
Because you have to restart your entire computer and make sure you are in front of your computer.
If you can't get control access, perfect.
If not, then stay in front of the computer with a keyboard and monitor reboot.
It added the file, change the password and then rebooted again.
We'll try that.
This procedure in our lab environment and we think that we don't remember the password and will try
to change it.
Let's log into our Linux machine.
And this time, of course, we definitely wanted to go into the console, not through the putty session,
because as soon as you reboot your machine, the putty session will not allow you to see the reboot
process.
So now I have to reboot.
I have to run a command reboot.
But remember one thing, I have super user rights on certain commands, that's why I was able to reboot.
But if I was not able to reboot and it would have given me a message saying, you do not have permission
to reboot.
Right.
So in that case, you would have to go into a machine and type reset and then click on reset.
But now, since I already rebooted, I'll go in here and you have to be in this menu very quickly because
it starts your computer within five seconds.
So, Watson, you are in here.
You could just select anyone.
The first one is your actual operating system.
Second one is just a rescue of your operating system.
Select the first one once you are selected.
The first one, then select E to edit it.
You could also see at the bottom says press E to edit the selected item.
So I'm just going to click E, I'll come down to the parameters where I will see r o r o meaning read
only the system mouse on a read only I want to mount the system and read.
Right, so I'll go to the line.
You will see in a second where it says are to be right here are.
Oh right.
So I'm going to remove that and I have a parameter that I'm going to set that I have it written.
By the way, if you wanted to get out of this terminal type control key on the right side of your keyboard,
not the left one right side to release your mouse, I have this parameters written down here that I'm
going to follow.
Yes, administrators do have to follow some instructions.
They have to write it down.
A good administrator always write down the troubleshooting instructions.
OK, so now I will do RWC, my first line, my notepad RW space and it equal exists root slash bin slash
S.H..
Once I have typed atin simply type control x I remember this is not v.i. that you have to use insert
or any other, which is just a simple typing and once you type it just hit control x this will start
your computer in single user mode.
OK, now you simply type C, his route to mount your file system to this route type password to change
your password,
all passwords had been changed.
Tokens update perfect.
Now, exit out of that route we did.
We are out now simply to reboot and your system reboot.
Once the system comes back online, you will have the option to log in.
You can log in as rude of yourself, and that's how you change the route password.
I want you to try it in your lab environment and pretend that you have lost your password.
And this is one of the things that you will have to face.
I'm telling you, you will have to face when you become a system administrator or take the job in that
capacity.
Let's talk about repairing file system whenever there is a corruption so file system corruption can
occur when you either make mistakes in see all the configuration files that are in that's actually filed
or filesystem becomes corrupted at a disk level.
In either of the above cases, the system D, which is our first process, will not be able to put the
system in the defined target and bring the system in emergency mode.
Or you could say emergency target the following table, list some common errors and their results,
which, by the way, I got this table and the common errors right from the RedHat documentation.
OK, so first problem is corrupt or corrupted file system.
In that case system, the attempts to repair the file system, if the problem is too severe for an automatic
fix, the system drops the user to an emergency show.
Then we have Jewed in the first tab.
Dereference of it does not exist.
Then System D waits for a set amount of time waiting for the device to become available.
If the device does not become available, the system drops the user to an emergency shelter after the
time out.
OK, then the main point may be the mom point doesn't exist.
So we had the correct UID, but the directory where we are mounting the file system doesn't really exist.
Then the system drops the user to an emergency shelter.
OK, then we have incorrect mound option specified in at CFS step.
By the way, I'm sorry I'm missing the I and incorrect.
So my options we have all the way toward the right hand side in at CFS tab it will do the same thing.
System drops the user to emergency show are in any of these cases the administrator can use the emergency
target to diagnose and fix the issue because no file system are mounted before the emergency shell is
displayed when using emergency shelter fixed filesystem and we should do not forget to run system ctl
deman dash, reload after editing your ETSI first tab.
Because without this reload system, D may continue to use the older version of the first TAB files.
So keep that in mind.
Also, if you are having issues with your desk and VA system corruption is reporting disk errors, then
you can run FWC K or FS check command on your file system.
For example, FC K slash dev slash SDK or CDB to repair your file system manually.
These are the few topics that we want to talk about in this video, which was how the process works.
What are the different targets, how you can recover Rup password and how you could repair a file system
corruption.
I will see you in the next lecture.