Now of course, having already installed the package sysstat,
we've got access to our System Activity Reporter,
or sar.
And we can go through and use sar to report on our historical disk activity.
When we go through and look at sar ‑b,
it's really breaking it down for our block devices,
but it's aggregating all of our devices together.
If we want to look at individual disk devices, we can use sar ‑d.
As another option though and it doesn't really matter
that this is related to disk activity,
this could be related to any of our system activity reporting we want to do.
If we want to report on a different day rather than today,
we can go through and use the ‑f,
and we're going to find our log files inside of /var/log/sysstat.
And then the files are going to be numbered sa and then our day number.
So if we want to access it for a particular day of the month,
then we can go through and call up a different date file.
But we're going to dive out to our command line now because
it's way easier to understand it from actually working on the
command line than watching slides.
So we really encourage you to go out to your command line on
your demonstration machine and take a look at your disk
activity over a period of time.
We're going to go through and use sar ‑b,
so we're going to be able to see then all of our
block devices aggregated together,
but also then see each device separately using sar ‑d,
as well as reminding ourselves that we can query other days data.
So here we are working at our command line,
and if I go through and just use, say, sar ‑b,
this gives me like the great summary information.
We can see then that my system has been on since 8:47 this morning,
and we can see then when data was collected.
The main features that we're looking at are our transactions per second,
our read transactions per second, our write transactions per second.
We can then get our discarded transactions per second,
the bytes read per second, bytes written per second,
and then we can see our bytes discarded per second. And
obviously we're starting to see a high number of discarded
bytes or discarded transactions per second,
then I'm guessing there's probably some sort of failure that is about to happen
on at least part of your disk for those discards to happen.
But we get an idea of the throughput that we are having
through our transactions per second.
Now this is where we are at to today,
but if we want to go through and take a look at it from another day,
then we can clear this out.
And we can go through and take a look at then the ‑f option,
and we can go through and take a look in var/log/sysstat.
And within sysstat, we can then go through and see our sa files,
and I can then go through and say maybe put in the 16.
When we go through and take a look at it,
we can see then that we've got a fuller days activity,
obviously,
just depending on when the machine was turned on and
when the machine was turned off.
But obviously, use days that you have available.
If you've only just installed our sysstat package,
then you're probably going to find that you don't have
any other days than the current day.
As well as looking at our aggregated information,
we can go through and take a look at, we'll look at it for today,
and we can change this to our ‑d.
So with this, we're looking at our individual devices.
Now to understand those devices,
we really need to go through and look at our lsblk and then look at the numbers,
the MAJOR and MINOR numbers.
So as we take a look at the output,
we can go through and start seeing that device sdb is our
raw device without any extra partitions,
and that shows as 8:16.
Whereas, when we take a look at our sda device,
that's 8:0, and we've got our root file system,
which is 8:1.
So now that we understand a little bit about our numbers,
we can go back and take a look.
Where we see then 8:16, that's going to be /dev/sdb,
that's our raw device that we're able to see that we can get
quite fast read and writes through to.
As we then continue and look, 8:0 represents sda.
We don't see the separate partitions, but again,
you can see how many transactions per second,
our reads per second, and so forth to our root file system.
We're also seeing a lot of the device major 7,
which is representing our loop back devices,
which are made so common use of in Ubuntu.
But we're able now to be able to start reading our transactions,
our read and write transactions, and our queue sizes in our systems by the individual device itself.