1 00:00:06,480 --> 00:00:07,313 - In this video, 2 00:00:07,313 --> 00:00:09,750 I would like to talk about storage options. 3 00:00:09,750 --> 00:00:11,625 So, it's all about the server, right? 4 00:00:11,625 --> 00:00:12,930 (pen squeaking) 5 00:00:12,930 --> 00:00:15,540 That is where Linux typically is seen. 6 00:00:15,540 --> 00:00:18,240 So here you have your nice, big server 7 00:00:18,240 --> 00:00:21,123 and you want to make sure that storage is proficient. 8 00:00:22,140 --> 00:00:23,010 You can do one thing, 9 00:00:23,010 --> 00:00:25,173 you can work with internal storage. 10 00:00:27,360 --> 00:00:28,770 Also quite common, 11 00:00:28,770 --> 00:00:30,510 is that you work with the SAN. 12 00:00:30,510 --> 00:00:32,550 SAN is the Storage Area Network. 13 00:00:32,550 --> 00:00:35,040 It's basically external storage. 14 00:00:35,040 --> 00:00:37,140 SAN is just a collection of drives, 15 00:00:37,140 --> 00:00:38,820 and this collection of drives 16 00:00:38,820 --> 00:00:43,820 is going to be represented to Linux in one way or another. 17 00:00:43,860 --> 00:00:48,423 A typical protocol to do so is the iSCSI protocol. 18 00:00:50,985 --> 00:00:53,490 Now the result is that you will have 19 00:00:53,490 --> 00:00:56,220 storage devices on your Linux system, 20 00:00:56,220 --> 00:00:59,070 and you can use a command like lsblk 21 00:00:59,070 --> 00:01:02,700 to figure out which storage devices are being used. 22 00:01:02,700 --> 00:01:05,400 And basically, all storage devices are the same 23 00:01:05,400 --> 00:01:08,130 but on the storage device itself, 24 00:01:08,130 --> 00:01:09,360 you can do stuff. 25 00:01:09,360 --> 00:01:11,110 So what are we going to do on the storage device? 26 00:01:11,110 --> 00:01:14,340 Well, let's zoom in a little bit on the storage device 27 00:01:14,340 --> 00:01:17,820 and let's assume that this is the storage device. 28 00:01:17,820 --> 00:01:19,564 In order to use your storage device, 29 00:01:19,564 --> 00:01:21,570 or your hard disc, 30 00:01:21,570 --> 00:01:25,410 you don't normally use an entire hard disc in Linux. 31 00:01:25,410 --> 00:01:27,210 Like in other operating systems, 32 00:01:27,210 --> 00:01:28,980 you would create partitions. 33 00:01:28,980 --> 00:01:29,813 And in Linux, 34 00:01:29,813 --> 00:01:32,550 it's very common to work with multiple partitions, 35 00:01:32,550 --> 00:01:35,280 where every file system is getting a partition 36 00:01:35,280 --> 00:01:37,727 for the purpose that you are using it for. 37 00:01:37,727 --> 00:01:38,642 For instance, 38 00:01:38,642 --> 00:01:42,998 you will often see that there's a small boot partition. 39 00:01:42,998 --> 00:01:44,820 That's a partition that is mounted 40 00:01:44,820 --> 00:01:46,830 on the slash boot directory. 41 00:01:46,830 --> 00:01:51,480 You might also see that there is a root partition. 42 00:01:51,480 --> 00:01:53,670 That's a partition that is mounted on slash, 43 00:01:53,670 --> 00:01:55,320 the root directory, 44 00:01:55,320 --> 00:01:57,600 but it's also possible to work with this thing 45 00:01:57,600 --> 00:01:59,400 that we call LVM, 46 00:01:59,400 --> 00:02:01,290 the Logical Volume Manager. 47 00:02:01,290 --> 00:02:02,220 And you know what? 48 00:02:02,220 --> 00:02:06,873 Logical Volume Manager is taking one or more partitions, 49 00:02:08,190 --> 00:02:10,285 and it's going to put these partitions 50 00:02:10,285 --> 00:02:12,990 in another level of abstraction. 51 00:02:12,990 --> 00:02:15,807 And that is the Logical Volume Level. 52 00:02:15,807 --> 00:02:18,390 So in the logical volume environment, 53 00:02:18,390 --> 00:02:20,970 you would create a volume group. 54 00:02:20,970 --> 00:02:22,410 In this volume group, 55 00:02:22,410 --> 00:02:25,590 really is the abstraction of all the storage that you have 56 00:02:25,590 --> 00:02:28,050 and you put your partitions in there. 57 00:02:28,050 --> 00:02:29,460 And the nice thing is, 58 00:02:29,460 --> 00:02:31,980 that if you run out of storage in your volume group, 59 00:02:31,980 --> 00:02:34,320 you can even add more partitions. 60 00:02:34,320 --> 00:02:36,930 And based on that in the volume group, 61 00:02:36,930 --> 00:02:39,210 you can create your logical volumes. 62 00:02:39,210 --> 00:02:43,260 Logical volumes take their storage from the volume group. 63 00:02:43,260 --> 00:02:44,745 You give them a specific size, 64 00:02:44,745 --> 00:02:47,160 you run out of disc space, 65 00:02:47,160 --> 00:02:50,490 then you can increase size of your logical volume. 66 00:02:50,490 --> 00:02:51,690 And that is really useful, 67 00:02:51,690 --> 00:02:52,950 because that allows you 68 00:02:52,950 --> 00:02:56,550 to be really flexible at the storage level. 69 00:02:56,550 --> 00:02:59,368 But these LVM logical volume groups 70 00:02:59,368 --> 00:03:02,490 are a little more complex to set up. 71 00:03:02,490 --> 00:03:03,323 In this course, 72 00:03:03,323 --> 00:03:05,520 we are not going to really talk about LVM, 73 00:03:05,520 --> 00:03:07,980 but I wanted to mention LVM anyway 74 00:03:07,980 --> 00:03:10,800 because you will see it a lot, 75 00:03:10,800 --> 00:03:12,330 even in a default server 76 00:03:12,330 --> 00:03:16,080 of anything in the Red Hat family and on Ubuntu server, 77 00:03:16,080 --> 00:03:18,182 you will get LVM by default. 78 00:03:18,182 --> 00:03:20,915 But we do need to focus on these partitions. 79 00:03:20,915 --> 00:03:24,630 And I will show you how this is going to be sda1, 80 00:03:24,630 --> 00:03:27,000 and this is going to be sda2, 81 00:03:27,000 --> 00:03:29,220 and these things are numbered. 82 00:03:29,220 --> 00:03:30,930 And I will tell you all about it 83 00:03:30,930 --> 00:03:32,523 in the next couple of videos. 84 00:03:34,650 --> 00:03:37,950 So let's summarize with the slides 85 00:03:37,950 --> 00:03:41,640 to list the block devices that you will encounter on Linux. 86 00:03:41,640 --> 00:03:43,507 So there's /dev/sda. 87 00:03:43,507 --> 00:03:46,050 /dev/sda's what you will see most commonly. 88 00:03:46,050 --> 00:03:49,320 It's the name of the first SCSI hard disc device. 89 00:03:49,320 --> 00:03:50,956 There's /dev/sdb. 90 00:03:50,956 --> 00:03:53,610 /dev/sdb's the second SCSI hard disc device. 91 00:03:53,610 --> 00:03:56,040 So, SD stands for SCSI disk, 92 00:03:56,040 --> 00:03:59,730 A is the first, B is second, and so on. 93 00:03:59,730 --> 00:04:01,410 Now we have /dev/vda. 94 00:04:01,410 --> 00:04:04,830 You will see that on a KVM virtual machine. 95 00:04:04,830 --> 00:04:07,350 KVM is Linux-based virtualization 96 00:04:07,350 --> 00:04:09,510 and you will see it in particular environments. 97 00:04:09,510 --> 00:04:13,050 And if it is used, vda is what you get. 98 00:04:13,050 --> 00:04:16,110 And if you have a new, fancy, fast SSD device 99 00:04:16,110 --> 00:04:18,810 you might see nvme0n1, 100 00:04:18,810 --> 00:04:21,270 which is the first NVME hard disc. 101 00:04:21,270 --> 00:04:23,277 And last, /dev/sr0, 102 00:04:23,277 --> 00:04:25,950 which is an optical drive. 103 00:04:25,950 --> 00:04:27,000 In the next video, 104 00:04:27,000 --> 00:04:30,453 I'll show you how to create partitions on an NBR device.