1
00:00:00,000 --> 00:00:01,410
In this demonstration, we're going to go

2
00:00:01,410 --> 00:00:03,840
through the Linux boot process.

3
00:00:03,840 --> 00:00:05,910
It's important to understand the Linux boot process,

4
00:00:05,910 --> 00:00:07,560
especially when you're a system admin,

5
00:00:07,560 --> 00:00:11,610
just in case you get a major error called a kernel panic.

6
00:00:11,610 --> 00:00:14,460
Now, when these errors occur, they require intervention,

7
00:00:14,460 --> 00:00:16,620
so it's important to understand the components

8
00:00:16,620 --> 00:00:19,260
and the makeup of the process,

9
00:00:19,260 --> 00:00:22,110
so you can kind of identify any issues

10
00:00:22,110 --> 00:00:24,150
or where the problem might lay.

11
00:00:24,150 --> 00:00:26,820
Now, as sort of a high-level overview,

12
00:00:26,820 --> 00:00:29,160
what happens when the computer's first turned on

13
00:00:29,160 --> 00:00:30,720
or restarted?

14
00:00:30,720 --> 00:00:34,587
The processor checks for the BIOS or the UEFI,

15
00:00:34,587 --> 00:00:38,310
and the BIOS means it's the Basic Input Output System,

16
00:00:38,310 --> 00:00:42,660
and the UEFI is the more advanced version of the BIOS,

17
00:00:42,660 --> 00:00:46,560
which stands for the Unified Extensible Firmware Interface.

18
00:00:46,560 --> 00:00:48,570
Now, all that really means is the firmware,

19
00:00:48,570 --> 00:00:50,640
is what's hard coded into the processor,

20
00:00:50,640 --> 00:00:52,620
so as soon as the computer is booted,

21
00:00:52,620 --> 00:00:54,510
it has software to run it.

22
00:00:54,510 --> 00:00:56,640
The next thing that the BIOS needs to do is check

23
00:00:56,640 --> 00:00:57,990
for any bootable media.

24
00:00:57,990 --> 00:01:00,330
So, typically, don't look for any external

25
00:01:00,330 --> 00:01:03,780
or internal storage or peripherals, such as USB thumb drives

26
00:01:03,780 --> 00:01:06,270
or DVDs, et cetera.

27
00:01:06,270 --> 00:01:08,250
Once it locates a valid device,

28
00:01:08,250 --> 00:01:10,800
it starts to boot from that system.

29
00:01:10,800 --> 00:01:12,030
The next thing it's going to do is look

30
00:01:12,030 --> 00:01:13,920
for the primary bootloader.

31
00:01:13,920 --> 00:01:16,860
And that's typically going to be on the master boot record.

32
00:01:16,860 --> 00:01:18,360
That's if you're using the BIOS,

33
00:01:18,360 --> 00:01:21,750
or the GUID partition table,

34
00:01:21,750 --> 00:01:25,380
and that's if you're using the UEFI version,

35
00:01:25,380 --> 00:01:28,620
and once it pulls this information, then it's going to start

36
00:01:28,620 --> 00:01:31,470
to load a little bit more information again.

37
00:01:31,470 --> 00:01:33,330
Again, this is how all a boot strap,

38
00:01:33,330 --> 00:01:35,670
so, we're starting from a little bit of information,

39
00:01:35,670 --> 00:01:38,670
a few modules, and we're getting more and more complex.

40
00:01:38,670 --> 00:01:40,380
After we've located the boot loader,

41
00:01:40,380 --> 00:01:43,140
we're going to determine which kernel is required, and then,

42
00:01:43,140 --> 00:01:46,170
we're going to locate all the information for the kernel.

43
00:01:46,170 --> 00:01:48,660
And then we're also going to upload something

44
00:01:48,660 --> 00:01:53,660
called a initrd image, which stands for initial Ram disc.

45
00:01:54,300 --> 00:01:55,530
And what this does is pretty much,

46
00:01:55,530 --> 00:01:58,410
creates a temporary file system

47
00:01:58,410 --> 00:02:01,920
to start loading the other kernel modules

48
00:02:01,920 --> 00:02:04,260
as well as the necessary drivers.

49
00:02:04,260 --> 00:02:06,570
And once the kernel's fully up and running,

50
00:02:06,570 --> 00:02:09,389
next thing we're going to do is mount the root partition,

51
00:02:09,389 --> 00:02:12,900
then, we're going to get started using the operating system.

52
00:02:12,900 --> 00:02:15,150
So just a note, some of the key information, again,

53
00:02:15,150 --> 00:02:18,600
the most important thing is realizing that the BIOS

54
00:02:18,600 --> 00:02:22,380
or the UEFI must be initialized before anything can happen.

55
00:02:22,380 --> 00:02:25,590
And we also have to have viable bootable media,

56
00:02:25,590 --> 00:02:28,950
and then we actually have to load the primary boot loader

57
00:02:28,950 --> 00:02:30,690
from a MBR.

58
00:02:30,690 --> 00:02:32,550
And after the boot loader is complete,

59
00:02:32,550 --> 00:02:36,000
remember, it's going to transfer control over to the kernel.

60
00:02:36,000 --> 00:02:38,520
Now, on newer systems, most people are going to go

61
00:02:38,520 --> 00:02:41,070
with the UEFI and some,

62
00:02:41,070 --> 00:02:43,800
some of the biggest reasons is because also the GPT,

63
00:02:43,800 --> 00:02:48,800
the GUID Partition Table has a lot more advantages

64
00:02:48,840 --> 00:02:51,060
over the legacy, MBR,

65
00:02:51,060 --> 00:02:53,340
because it has a larger maximum storage space

66
00:02:53,340 --> 00:02:54,300
for the partitions,

67
00:02:54,300 --> 00:02:56,040
and it also stores the boot data

68
00:02:56,040 --> 00:02:58,920
in multiple locations for redundancy purposes.

69
00:02:58,920 --> 00:03:01,500
So now you're not running into a issue where,

70
00:03:01,500 --> 00:03:02,940
for example, if you using the BIOS

71
00:03:02,940 --> 00:03:06,210
in the primaries and the first sector gets corrupted,

72
00:03:06,210 --> 00:03:08,310
and now you can no longer load the system.

73
00:03:09,420 --> 00:03:12,370
And one of the last things that's ran is the systemd

74
00:03:13,620 --> 00:03:16,440
and what that does is it just mounts the file system based

75
00:03:16,440 --> 00:03:19,500
off that configuration file that we configured earlier,

76
00:03:19,500 --> 00:03:22,560
the f staff file, and then begins the process

77
00:03:22,560 --> 00:03:24,720
of starting all the services that we're going to need

78
00:03:24,720 --> 00:03:26,460
to run the operating system.

79
00:03:26,460 --> 00:03:29,190
Now, note on a lot of systems today,

80
00:03:29,190 --> 00:03:31,320
especially when everything's becoming more connected

81
00:03:31,320 --> 00:03:35,520
and complex, a lot of organizations today,

82
00:03:35,520 --> 00:03:39,510
they're booting a lot of the operating systems from a NFS,

83
00:03:39,510 --> 00:03:41,430
so a network file share.

84
00:03:41,430 --> 00:03:42,420
We're going to actually go through,

85
00:03:42,420 --> 00:03:45,330
and configure how to set up a network file share

86
00:03:45,330 --> 00:03:48,150
for our server to create a bootable image

87
00:03:48,150 --> 00:03:50,190
to load on multiple machines.

88
00:03:50,190 --> 00:03:51,990
So let's get started with that.

89
00:03:51,990 --> 00:03:53,010
Okay, so, the first thing we're going to have

90
00:03:53,010 --> 00:03:56,400
to do is identify the kernel that we're currently using,

91
00:03:56,400 --> 00:03:59,433
and that's going to be the uname command to r option.

92
00:04:00,900 --> 00:04:02,433
Okay, so we see that version,

93
00:04:03,540 --> 00:04:08,220
now, probably go ahead and make an initial Ram disk.

94
00:04:08,220 --> 00:04:13,220
So that command is going to be sudo, make initial Ram disk.

95
00:04:13,500 --> 00:04:16,019
We use the verbose option to see everything

96
00:04:16,019 --> 00:04:17,730
as it's being processed.

97
00:04:17,730 --> 00:04:19,882
We're going to put it under the boot directory,

98
00:04:20,970 --> 00:04:22,740
init, rd,

99
00:04:22,740 --> 00:04:24,720
so this is going to be the name.

100
00:04:24,720 --> 00:04:27,870
So this portion of the command is just specifying the name.

101
00:04:27,870 --> 00:04:29,790
Now, when we have this dollar character,

102
00:04:29,790 --> 00:04:31,890
it's, lets us use a variable,

103
00:04:31,890 --> 00:04:33,810
and it's going to be the variable that's returned

104
00:04:33,810 --> 00:04:36,090
after we execute this command.

105
00:04:36,090 --> 00:04:38,880
So dot image, so this is going to be the name

106
00:04:38,880 --> 00:04:39,810
of the actual file.

107
00:04:39,810 --> 00:04:41,250
So it's going to be in the boot folder

108
00:04:41,250 --> 00:04:44,250
and it's going to be init rd

109
00:04:44,250 --> 00:04:46,890
with a version dot kernel dot image.

110
00:04:46,890 --> 00:04:48,960
And then, the last specification we must have,

111
00:04:48,960 --> 00:04:51,780
is the actual kernel that we're going to be using.

112
00:04:51,780 --> 00:04:53,930
And again, we can use this variable, uname,

113
00:04:54,780 --> 00:04:56,280
and then we need our r option,

114
00:04:58,200 --> 00:05:00,543
put in our password, and we're going to run it.

115
00:05:08,230 --> 00:05:11,070
Okay, we see we have that complete there.

116
00:05:11,070 --> 00:05:13,290
Now let's just make sure that that actually was created.

117
00:05:13,290 --> 00:05:14,123
Want to list it out.

118
00:05:14,123 --> 00:05:15,220
We go to our booth folder,

119
00:05:16,950 --> 00:05:19,410
and we look at it where it says the date of June 13th.

120
00:05:19,410 --> 00:05:20,790
About halfway down the file,

121
00:05:20,790 --> 00:05:22,953
we'll see that new file was created.

122
00:05:23,880 --> 00:05:25,140
So the image we just created,

123
00:05:25,140 --> 00:05:26,610
it refers to the root file system,

124
00:05:26,610 --> 00:05:27,810
that's going to be temporary loaded

125
00:05:27,810 --> 00:05:30,570
into the memory upon system boot.

126
00:05:30,570 --> 00:05:31,890
Now, we're going to do the same thing,

127
00:05:31,890 --> 00:05:36,000
but we're going to create one with a network file share module.

128
00:05:36,000 --> 00:05:37,440
When they initially boot,

129
00:05:37,440 --> 00:05:39,450
the temporary root system will be coming

130
00:05:39,450 --> 00:05:41,880
from a external device across the network.

131
00:05:41,880 --> 00:05:43,500
So going back to that same command,

132
00:05:43,500 --> 00:05:45,210
so this is just going to add to the option

133
00:05:45,210 --> 00:05:49,800
with network file share V four,

134
00:05:49,800 --> 00:05:51,600
and we're just going to slightly change the name to,

135
00:05:51,600 --> 00:05:53,350
we're going to put network file share,

136
00:05:54,600 --> 00:05:56,973
NFS just for clarification,

137
00:05:58,470 --> 00:05:59,303
okay?

138
00:06:06,510 --> 00:06:08,520
All right now, let's just verify this really quick.

139
00:06:08,520 --> 00:06:10,743
We're going to go back to this boot folder,

140
00:06:15,540 --> 00:06:16,860
and we see they're right next to each other,

141
00:06:16,860 --> 00:06:19,320
so that's easy for us to identify.

142
00:06:19,320 --> 00:06:21,180
Let's make this a little readable here,

143
00:06:21,180 --> 00:06:25,410
and do the human readable, so we can get the bytes for this.

144
00:06:25,410 --> 00:06:28,080
Now, if you look, you'll see that the network file share,

145
00:06:28,080 --> 00:06:31,620
is slightly larger than the initial kernel,

146
00:06:31,620 --> 00:06:34,740
and that lets us know that it introduced a new module

147
00:06:34,740 --> 00:06:36,840
into the initial Ram disc.

148
00:06:36,840 --> 00:06:38,130
Okay, we just walked through how

149
00:06:38,130 --> 00:06:40,080
to create an initial Ram disc image,

150
00:06:40,080 --> 00:06:43,350
and also one with the network file share option,

151
00:06:43,350 --> 00:06:45,150
and I'll see you in the next lesson.

