Storage Adapter Troubleshooting

Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
or

Already have an account? Sign In »

Time
21 hours 25 minutes
Difficulty
Intermediate
Video Transcription
00:00
>> Hey there, Cybrarians,
00:00
and welcome back to the Linux+ course here at Cybrary.
00:00
I'm your instructor, Rob Gills.
00:00
In today's lesson, we're going to
00:00
cover storage adapter troubleshooting.
00:00
Upon completion of this lesson,
00:00
you're going to be able to understand the types of
00:00
storage adapter issues that you
00:00
may see and need to troubleshoot.
00:00
We're going to see how we can locate
00:00
files and use commands to
00:00
troubleshoot storage adapters in
00:00
our demo at the end of this lesson.
00:00
Storage adapter issues are often
00:00
related to missing or out of date drivers
00:00
or firmware and we may also see
00:00
some less common failed hardware issues come up.
00:00
But just like we saw with missing devices,
00:00
Linux looks at an adapter through the lens of
00:00
a kernel module and
00:00
that module is what is used to access the device.
00:00
If the kernel module is missing or not loaded,
00:00
the device isn't going to function.
00:00
We can run lspci-v to see
00:00
the kernel modules that are associated with most devices.
00:00
In this lesson we're going to look at
00:00
information on the common types of storage adapters,
00:00
such as SCSI, RAID and SATA.
00:00
Then we're also going to talk about host bus adapters,
00:00
which can connect various
00:00
different types of storage as well.
00:00
Let's take a look at all of this with some demo time.
00:00
Here we are over in
00:00
our CentOS environment and right off the bat today,
00:00
let's take a look at SCSI.
00:00
We can troubleshoot the SCSI adapter by
00:00
searching for driver and module info.
00:00
The first place to start with this is with dmessage.
00:00
We can run dmessage and then we can grep for sd.
00:00
Here we'll see, for example,
00:00
this line right here,
00:00
sda, attached disk.
00:00
Now in this system, I know that most of
00:00
my actual physical drives are running off of sda.
00:00
That is the device that we're running
00:00
all the storage of for the most part.
00:00
We can see the SCSI drivers that
00:00
are available by looking in the sys file system.
00:00
Let's clear the screen we hit Control L,
00:00
and what we could do is we can do ls/sys/bus
00:00
because this is the SCSI bus.
00:00
We're going to look at SCSI and then drivers.
00:00
When we hit Enter, we'll see that we have
00:00
two different drivers and that makes sense,
00:00
our device is sda,
00:00
we have an SD driver.
00:00
Next we could use udevadm,
00:00
and this is used to get information on
00:00
the driver that's used for this particular device.
00:00
For instance, we could use
00:00
udevadm and we can go with info-an,
00:00
and we're going to get information on
00:00
that dev sda device.
00:00
What we'll do is we'll grep for drivers.
00:00
I'm going to do this case insensitive.
00:00
That's what the i flag is for,
00:00
so grep i for drivers,
00:00
and then I'm actually going to grep for sd.
00:00
In here we can see that this driver,
00:00
the sd driver, is in use on this particular device.
00:00
Now, we can search to see if the sd module is in fact
00:00
loaded on this system as well to make sure
00:00
that we don't have a module issue.
00:00
We could use the lsmod command to do that.
00:00
This returns a bunch of information though.
00:00
What we're going to want to do is
00:00
grep for sd, for example.
00:00
Now we can see that that SD mod is return.
00:00
We can see that the module is loaded.
00:00
We can get some more information about
00:00
this module if you want to you by running
00:00
modinfo and then specifying we want the information
00:00
about sd mod and that will return a bunch of information.
00:00
That is if you spell modinfo correctly, and there we go.
00:00
[LAUGHTER] Now we see a bunch of information.
00:00
Now if we don't see
00:00
this sd module loaded with lsmod, it's okay.
00:00
It might actually be built into the kernel.
00:00
The way that we can see things built into the kernel,
00:00
I'm going to go ahead and clear the screen
00:00
here by typing clear.
00:00
What we can do is we can cut out a file that is
00:00
the lib modules file and what we're going
00:00
to do is we're going to specify the current uname.
00:00
We're going to use uname-r to
00:00
specify the current kernel version.
00:00
I'm just using a sub-shell
00:00
so that I don't actually have to look up
00:00
and type out that kernel from uname-r.
00:00
I'm just telling uname-r to
00:00
put that information right here in my path,
00:00
and then we're looking for the file modules.builtin.
00:00
Now if we hit Enter we can see all of the kernel modules,
00:00
all of the drivers, the modules
00:00
that are built into the kernel.
00:00
If we were wondering if SD modules are built-in,
00:00
we could do a grep for sd.
00:00
We don't see anything here so
00:00
that means that on this system,
00:00
this is a module that gets loaded,
00:00
it's not a built-in module.
00:00
There are, however, other modules
00:00
that are built-in for SCSI.
00:00
If we go back here, let me clear
00:00
the screen and then just type SCSI.
00:00
We're going to grep for SCSI instead and we do see that
00:00
there are SCSI modules that are built into the kernel,
00:00
we just don't happen to have that
00:00
SD module as one of them.
00:00
Let's move on next to looking at SATA devices.
00:00
When we're looking at SATA adapters,
00:00
the first place we want to look at is
00:00
in the PCI list output.
00:00
We can do that with lspci-v,
00:00
and then we see down here at the bottom.
00:00
We can see the SATA controller right
00:00
here and we also see down at the bottom
00:00
that the kernel driver and kernel module in use is ahci.
00:00
As before, we can check to see if this module is loaded.
00:00
We could do an lsmod and then in
00:00
here we can do a grep for ahci.
00:00
We can see that it is loaded right here, ahci.
00:00
Now, next, maybe we want
00:00
to see a little bit more information about that.
00:00
Let's go and clear the screen,
00:00
and I'm going to type clear,
00:00
and then what I can do is I can run
00:00
that modinfo command
00:00
>> to get more information about ahci.
00:00
>> There's all the lovely information about ahci.
00:00
Lastly, if this doesn't come up,
00:00
we can check, again,
00:00
in our lib modules directory here,
00:00
so lib modules uname-r modules builtin.
00:00
But instead of grepping for scsi I'll grep
00:00
for ahci. This returns nothing.
00:00
Once again, this is a module that gets loaded,
00:00
it's not built into the kernel in this case.
00:00
Lastly, if you have
00:00
a SATA device and the disk supports it,
00:00
you can run smart CTL commands to check out
00:00
the health of the drive hardware as well.
00:00
That's something you may want to do
00:00
as well on a SATA device.
00:00
Next, let's take a look at RAID.
00:00
Linux systems can use both hardware and software RAID.
00:00
Software RAID is going to be implemented through
00:00
the multiple devices or MD driver.
00:00
We can review the status of software RAID by
00:00
looking at the file proc mdstat,
00:00
we can do that by doing less on proc mdstat.
00:00
In this case we have no used devices,
00:00
we have no personality, so this is empty.
00:00
I don't have a RAID configuration here,
00:00
so we won't see anything.
00:00
Now, one thing to mention is we just talked about
00:00
the AHCI drivers and when we're working with RAID,
00:00
particularly SATA RAID,
00:00
AHCI drivers are preferred.
00:00
That's because this module or
00:00
driver supports what's called haploid,
00:00
which means that if a drive goes offline in
00:00
a RAID array it won't halt the entire array.
00:00
You can pull that and replace it and rebuild.
00:00
Now, hardware-based arrays are
00:00
a little bit different and they're
00:00
managed with a physical adapter
00:00
connected to the Linux system,
00:00
generally running as a SCSI controller,
00:00
but these are usually connected through the PCI bus.
00:00
In order to look at that, lets
00:00
hit quit and get out of here
00:00
and what we could do is we can run lspci, again,
00:00
list all the PCI devices,
00:00
and now we can do a grep for RAID and I'm
00:00
going to do is case insensitive just in
00:00
case it's a raid lowercase and hit Enter.
00:00
In this case we don't have
00:00
a hardware RAID controller here,
00:00
so we don't see anything, there's nothing on there.
00:00
But that's how we'd go about trying to find
00:00
that information and then go
00:00
from there to start troubleshooting.
00:00
Now the last thing we'll talk about
00:00
today is the concept of
00:00
the host bus adapter or HBA.
00:00
HBA is a hardware device
00:00
that is used to attach a number
00:00
of different devices through a system.
00:00
HBAs could be a circuit board connected to a PCI or
00:00
PCIe or it could be
00:00
an integrated circuit adapter that's
00:00
built into the disk drive itself.
00:00
But HBAs are commonly used to attach
00:00
storage devices such as
00:00
Fibre Channel or serial attached SCSI,
00:00
which is also known as SAS.
00:00
Now I don't have serial attached SCSI
00:00
or Fibre Channel on this virtual machine.
00:00
This is just a virtual machine.
00:00
But if you're going to see these devices,
00:00
we would see them just as before by running lspci-v. We
00:00
do lspci-v to get
00:00
verbose output and then we could pipe this,
00:00
we could grep for SCSI or Fibre Channel.
00:00
I'm just going to hit less here,
00:00
and then we can just era through this information
00:00
and look and see if we see SCSI or Fibre Channel.
00:00
Now I don't have a SCSI or Fibre Channel in the system.
00:00
But if there was, we would see
00:00
the hardware adapter listed
00:00
here as something that's connected to that PCI bus.
00:00
Additionally, we can look for
00:00
a loaded module or driver in lsmod.
00:00
We can do an lsmod,
00:00
pardon me, we're going to quit out of that.
00:00
We can run lsmod and then pipe that to less,
00:00
and we could go through this information and we could
00:00
look for SAS or Fibre Channel.
00:00
We could also go back and take a look at
00:00
our built-in kernel modules.
00:00
We could do things, we could grep for SAS
00:00
or we could grep for Fibre Channel or
00:00
fibre or we can just do ls and we
00:00
can just go through here
00:00
and page through all the different kernel modules.
00:00
But in this case, I can tell you
00:00
we don't have them in the system,
00:00
so we won't see anything.
00:00
But with that, we've reached the end of this lesson.
00:00
In this lesson, we covered the types of
00:00
storage adapter issues
00:00
>> that you may need to troubleshoot,
00:00
>> as well as the files to search and commands
00:00
to run to troubleshoot storage adapters.
00:00
Thanks so much for being here
00:00
>> and I look forward to seeing you in the next lesson.
Up Next