1
00:00:00,000 --> 00:00:17,760
Hey guys and welcome back. So now what I want to do in this nugget is to talk about our

2
00:00:17,760 --> 00:00:23,679
hard drives and how we can actually tune them and make amendments to their different parameters.

3
00:00:23,679 --> 00:00:30,559
There are a few terms that we want to have a good grasp of with respect to this objective here.

4
00:00:30,559 --> 00:00:39,600
The first one is something called DMA. This is direct memory access. Now the purpose of DMA

5
00:00:39,600 --> 00:00:46,000
is that it's going to allow hard drive devices themselves to actually access the RAM. So you've

6
00:00:46,000 --> 00:00:52,799
got the hard drive and it can reach in directly and access the RAM. Think about the name direct

7
00:00:52,799 --> 00:01:00,640
memory access. The hard drive is directly accessing the memory and this is enabled by the kernel.

8
00:01:00,640 --> 00:01:06,079
Now the purpose of this is that it's going to give you a great deal of performance going to be much

9
00:01:06,079 --> 00:01:10,799
more efficient for the hard drive to be able to do this operation. So when you're dealing with

10
00:01:10,799 --> 00:01:17,359
devices which happen to have to work with a large amount of data this operation i.e. been able to

11
00:01:17,359 --> 00:01:25,840
invoke DMA can be absolutely vital to you and being able to control how DMA is either used or not

12
00:01:25,840 --> 00:01:30,480
used. This is clearly something that's going to be very very important to us and we'll get to see

13
00:01:30,480 --> 00:01:35,760
how this relates to some of the tools we're going to talk about very very shortly. Now we also have

14
00:01:35,760 --> 00:01:43,280
things such as PATTA we want to be aware of. This is the parallel advanced technology attachments

15
00:01:43,359 --> 00:01:49,280
PATTA and this is ultimately an interface used by different hard disks. You may have heard at least

16
00:01:49,280 --> 00:01:57,439
I hope you have of an IDE. This is an integrated drive electronics device and this is a drive which

17
00:01:57,439 --> 00:02:04,960
uses that ATTA technology the advanced technology attachment. This is really used for older devices

18
00:02:04,960 --> 00:02:12,800
and was ultimately replaced by something called SATA. SATA standing for serial ATTA the advanced

19
00:02:12,800 --> 00:02:20,480
technology attachment and this is a more modern technology. So like I say IDE not often used so

20
00:02:20,480 --> 00:02:27,120
much very kind of old-school so to speak but one thing we do want to be aware of is with respect to

21
00:02:27,120 --> 00:02:33,200
the naming conventions if you happen to see a device and your Linux machine and the dev directory and

22
00:02:33,199 --> 00:02:42,719
it says HDA1 if you see an H you can infer that this is an IDE based device so we know it's IDE

23
00:02:43,280 --> 00:02:48,799
we know this would be the first disk disk A and so a lot of information we can derive from just the

24
00:02:48,799 --> 00:02:55,519
naming convention itself. So if we use HD for these IDE devices what do we use for these SATA

25
00:02:55,519 --> 00:03:01,919
devices well that is going to be as we've seen so many times before SD so that could be SDA

26
00:03:02,079 --> 00:03:10,079
SDB. So if you happen to check your dev directory and you see an S rather than an H you can infer

27
00:03:10,079 --> 00:03:16,560
that your device is using a SATA drive as opposed to an IDE drive which like I say SATA more modern

28
00:03:16,560 --> 00:03:25,519
much more common nowadays. Now whether we are using an IDE based drive or a SATA drive we have a

29
00:03:25,520 --> 00:03:33,760
particular tool which can work with both of these stale of drives. Now this tool is called HD Parm

30
00:03:33,760 --> 00:03:39,920
and I believe this stands for hard drive parameters so what we'll do is we will jump into the man page

31
00:03:39,920 --> 00:03:47,680
for HD Parm and to enter we can see here this tool is going to allow us to either retrieve or change

32
00:03:47,680 --> 00:03:54,879
SATA or IDE device parameters so this one tool HD Parm can work for both stale devices just

33
00:03:54,879 --> 00:04:00,000
remember that. Now before we actually look at this tool in some detail another tool we want to be

34
00:04:00,000 --> 00:04:08,079
aware of is one called SD Parm. Now the temptation might be that if you think you know if a device

35
00:04:08,079 --> 00:04:16,959
is dev HDA that would be an IDE based device because of the H and if you see dev SDA the S

36
00:04:16,959 --> 00:04:22,800
denotes that this would be a SATA drive. The temptation like I say is to assume that HD Parm

37
00:04:22,800 --> 00:04:31,040
just deals with IDEs and SD Parm deals with SATA drives this is absolutely not the case so try to

38
00:04:31,040 --> 00:04:38,960
remember that HD Parm will do both. What SD Parm actually deals with are SCSI based devices and to

39
00:04:38,960 --> 00:04:46,720
be quite frank the use of SD Parm is nowhere near as common as HD Parm so that is the one that we're

40
00:04:46,800 --> 00:04:52,720
going to be looking at so we'll go back into man HD Parm and we can see the different types of

41
00:04:52,720 --> 00:04:58,640
operations that this utility is capable of doing but really as a summary whenever you want to

42
00:04:58,640 --> 00:05:04,320
manipulate the hard drive itself we want to change some particular parameters maybe things like

43
00:05:04,320 --> 00:05:10,880
parameters relating to DMA or direct memory access or if we want to deal with particular interrupts.

44
00:05:10,959 --> 00:05:17,600
Settings relating to these features can be tuned and modified and retrieved using this particular

45
00:05:17,600 --> 00:05:23,360
command HD Parm so if we scroll on down we can see some of the options we can do dash B to get

46
00:05:23,360 --> 00:05:29,439
the bus state or to set the bus state if we wish. Here's a very good example dash D this allows us

47
00:05:29,439 --> 00:05:36,240
to either get or set the using DMA flag for this drive and as it says here what we mentioned with

48
00:05:36,240 --> 00:05:44,160
respect to performance DMA always almost gives the best performance but crucially as we see here

49
00:05:44,160 --> 00:05:50,160
there are some configurations of particular chipsets for which DMA doesn't really give you any such

50
00:05:50,160 --> 00:05:57,280
thing and just having this set might even actually slow things down so in this case having the ability

51
00:05:57,280 --> 00:06:04,160
to toggle this to either turn direct memory access on or direct memory access off for that particular

52
00:06:04,160 --> 00:06:10,240
disk that you're targeting this can be very very useful now if we scroll on down now this one is

53
00:06:10,240 --> 00:06:17,360
a very useful switch the dash capital I this is going to allow us to see identification info right

54
00:06:17,360 --> 00:06:22,640
from the device so let's check this one out first then we'll press quit and what I will do is I'll say

55
00:06:22,640 --> 00:06:30,560
HD Parm dash I and I'll go into devsdb for example and of course I need to use super user privileges

56
00:06:30,560 --> 00:06:36,079
type in my password and we can see this information right here so we can see the model number the serial

57
00:06:36,079 --> 00:06:40,959
number obviously the model number is a little bit strange because this is a virtual hard disk and not

58
00:06:40,959 --> 00:06:45,759
a real one we can see information relating to the cylinders the heads and the sectors to all of these

59
00:06:45,759 --> 00:06:50,240
physical attributes and as we can see here a whole bunch of information we don't really have to

60
00:06:50,240 --> 00:06:55,439
understand all the details here because in the examination you're not going to be asked about

61
00:06:55,439 --> 00:07:00,319
specific output from this particular command but we do want to be aware that we can retrieve such

62
00:07:00,319 --> 00:07:08,000
information using these particular flags now like I say with respect to DMA if we want to turn on

63
00:07:08,000 --> 00:07:16,319
DMA support for our disk or turn off DMA support we can use that dash lowercase d flag now this is

64
00:07:16,319 --> 00:07:21,839
ultimately going to be a binary operation and that if we use the value zero that means we're going to

65
00:07:21,839 --> 00:07:28,240
turn DMA access off and if we use the value one we're going to turn DMA support on so let me show

66
00:07:28,319 --> 00:07:33,600
you how we can actually use this with the warning beforehand by the way that we actually cannot use

67
00:07:33,600 --> 00:07:40,560
or at least I cannot use DMA that is because I'm using a virtual machine and my disk is not actually

68
00:07:40,560 --> 00:07:47,040
a real SATA drive so as it is being emulated I'm going to get some pretty funky outputs when I try

69
00:07:47,040 --> 00:07:52,960
to toggle my DMA access on and off simply put because it's not possible but the good news for

70
00:07:52,960 --> 00:07:58,000
us is that all we have to know is to understand the syntax of the command and what the command

71
00:07:58,000 --> 00:08:04,160
is trying to do so I will say sudo hd param and I'll do dash D for direct memory access if I want

72
00:08:04,160 --> 00:08:11,040
to turn it off I would say the value zero and now I would specify the disk I want to target so I

73
00:08:11,040 --> 00:08:17,600
could maybe say dev I don't know MD zero if I want it and to enter and it says here as we can see

74
00:08:17,600 --> 00:08:24,079
DMA has failed we can't actually set this this is an inappropriate setting but again pretending we

75
00:08:24,079 --> 00:08:30,319
were on a real live physical device and not a virtual machine this would turn direct memory access

76
00:08:30,319 --> 00:08:35,840
off for that device and if we wanted to turn it on we would just change this value here to the value

77
00:08:35,840 --> 00:08:41,759
one and again of course we see we can't actually turn such a thing on due to the virtual nature of

78
00:08:41,759 --> 00:08:48,319
my device now speaking about hardware and kernel based information we want to really understand

79
00:08:48,319 --> 00:08:53,279
for the purposes of the LPIC examination the location where we can find such information we

80
00:08:53,279 --> 00:08:58,879
want to be looking in the PROC directory okay this is a very very important directory for us

81
00:08:58,879 --> 00:09:06,480
whenever we are thinking about information relating to kernel related data this is the go to guy so

82
00:09:06,480 --> 00:09:11,439
if you want to be able to find information relating to the interrupt used by a particular hardware

83
00:09:11,439 --> 00:09:17,360
device where would you go you would go into the PROC directory kernel based stuff goes there so

84
00:09:17,360 --> 00:09:21,839
what we would do is we would clear the screen and I would say cats go into the PROC directory

85
00:09:21,920 --> 00:09:27,440
and if I wanted interrupts we would choose the interrupts file and as we can see here that spits

86
00:09:27,440 --> 00:09:32,960
out all this information we can also find information relating to our system devices in the PROC

87
00:09:32,960 --> 00:09:38,960
devices file so again in this same directory PROC devices let's roll on up so we can see things

88
00:09:38,960 --> 00:09:45,280
like our block devices we can see we have sd which is our SATA devices we can see our md which is

89
00:09:45,280 --> 00:09:51,120
our multiple disks i.e we have our RAID devices now similarly if we wanted to change the way the

90
00:09:51,120 --> 00:09:57,600
kernel was operating we could actually make modifications to particular files now where would

91
00:09:57,600 --> 00:10:02,799
those files be well we know it's going to be somewhere within the PROC directory which it is

92
00:10:02,799 --> 00:10:07,840
but within here if we go into the sys directory we're going to find a directory structure and

93
00:10:07,840 --> 00:10:13,600
within here we could actually modify particular files say for example going to kernel ls all of

94
00:10:13,600 --> 00:10:19,279
these files ultimately can be used to change the configuration now for the purposes of the examination

95
00:10:19,279 --> 00:10:24,879
you absolutely do not have to worry about knowing what all these files are and all the potential

96
00:10:24,879 --> 00:10:30,240
configurations you can do to these files absolutely not no need to panic what we really want to focus

97
00:10:30,240 --> 00:10:36,959
on is where about these files actually reside so if you wanted to change some type of CD-ROM

98
00:10:36,959 --> 00:10:43,519
configuration again we could go into the DEV directory here we can have our CD-ROM configuration

99
00:10:43,600 --> 00:10:50,000
and we can modify this lock file change the value from 0 to 1 this would then mean that the CD-ROM

100
00:10:50,000 --> 00:10:56,559
drive will actually be locked when a CD is mounted again this is all kernel based behavior and you

101
00:10:56,559 --> 00:11:02,079
will notice of course that right now this file is unwriteable because in order to modify this

102
00:11:02,079 --> 00:11:07,919
i would actually have to have super user privileges so really the modification of different kernel

103
00:11:07,919 --> 00:11:14,879
behaviors can be modified within the proc sys directory and the subsequent subdirectories

104
00:11:14,879 --> 00:11:20,879
that follow okay so that is us for our introduction into looking at being able to tune particular

105
00:11:20,879 --> 00:11:25,919
hardware settings the next thing i want to talk to you about is related to SCSI and that's what

106
00:11:25,919 --> 00:11:30,000
we're going to be talking about in the very next nuggets i hope this has been informative for you

107
00:11:30,000 --> 00:11:35,600
and i'd like to thank you for viewing

