1 00:00:06,960 --> 00:00:07,793 - All right. 2 00:00:07,793 --> 00:00:10,050 So the next assignment was to manage storage 3 00:00:10,050 --> 00:00:12,630 on a second disc that is added to the server. 4 00:00:12,630 --> 00:00:16,680 And on this disc you create an LVM volume group VG exam 5 00:00:16,680 --> 00:00:18,630 with the size of two gigabytes. 6 00:00:18,630 --> 00:00:21,450 And this volume group should use two physical 7 00:00:21,450 --> 00:00:23,970 volumes that are created as partitions. 8 00:00:23,970 --> 00:00:26,910 And in this VG exam volume group 9 00:00:26,910 --> 00:00:28,440 you create a logical volume 10 00:00:28,440 --> 00:00:32,670 with the name lvexam formatted ext4 mounted 11 00:00:32,670 --> 00:00:35,520 on slash exam and copy all files bigger 12 00:00:35,520 --> 00:00:38,280 than one megabyte from the /etc directory 13 00:00:38,280 --> 00:00:41,760 to the new volume which is mounted on /exam. 14 00:00:41,760 --> 00:00:44,310 So that was all, let's have a look at the solution. 15 00:00:47,040 --> 00:00:49,980 Okay, so I need to check my storage. 16 00:00:49,980 --> 00:00:52,353 LSBLK will do that. 17 00:00:53,850 --> 00:00:56,070 And you can see SDB, SDC. 18 00:00:56,070 --> 00:00:58,650 So I'm going to use SDB G disk 19 00:00:58,650 --> 00:01:02,442 on dev sdb creating a new partition number one 20 00:01:02,442 --> 00:01:05,580 with size of one gigabyte. 21 00:01:05,580 --> 00:01:08,380 So last sector plus one application G 22 00:01:09,330 --> 00:01:11,430 and hex code. 23 00:01:11,430 --> 00:01:14,112 That will be eight E zero zero. 24 00:01:14,112 --> 00:01:17,194 And then we create petition number two. 25 00:01:17,194 --> 00:01:20,250 First sector is just a default last sector 26 00:01:20,250 --> 00:01:21,660 plus one gigabyte. 27 00:01:21,660 --> 00:01:24,916 And here also the hex code 8 0 0, 28 00:01:24,916 --> 00:01:26,749 using P to verify. 29 00:01:26,749 --> 00:01:28,080 Looking good. 30 00:01:28,080 --> 00:01:30,753 So V, yes we want to proceed. 31 00:01:32,760 --> 00:01:35,283 So next step would be vgcreate, 32 00:01:36,969 --> 00:01:38,386 vgcreate, vgexam, 33 00:01:40,254 --> 00:01:42,300 dev SDB one, 34 00:01:42,300 --> 00:01:44,343 dev SDB two. 35 00:01:45,480 --> 00:01:48,150 And I'm a little bit lazy here. 36 00:01:48,150 --> 00:01:53,150 You can create the physical volume before using pvcreate. 37 00:01:53,343 --> 00:01:56,070 I choose not to do that because this is more efficient. 38 00:01:56,070 --> 00:01:57,670 We have the volume group vgexam. 39 00:01:59,130 --> 00:02:01,350 Next we need to create this logical volume 40 00:02:01,350 --> 00:02:02,400 with the name lvexam. 41 00:02:03,780 --> 00:02:07,330 So lvcreate minus N LV exam 42 00:02:08,340 --> 00:02:12,330 minus lowercase L 100% 43 00:02:12,330 --> 00:02:14,913 free VG exam. 44 00:02:16,080 --> 00:02:18,630 This minus lowercase L 100% free. 45 00:02:18,630 --> 00:02:21,870 Well that explains itself and that avoids me 46 00:02:21,870 --> 00:02:22,830 from having to think 47 00:02:22,830 --> 00:02:26,610 about extents that they use for metadata and such. 48 00:02:26,610 --> 00:02:28,170 So it's a bit easier. 49 00:02:28,170 --> 00:02:31,623 MKFS ext4 on dev vgexam. 50 00:02:32,850 --> 00:02:34,866 Lvexam to format it 51 00:02:34,866 --> 00:02:38,733 and then we can put it in ETC FS step. 52 00:02:39,750 --> 00:02:41,970 Of course you can also use a systemD 53 00:02:41,970 --> 00:02:45,570 mount fell with ETC FS step for most people is easier. 54 00:02:45,570 --> 00:02:48,195 And on the exam I would always go for the solution 55 00:02:48,195 --> 00:02:50,223 that you are most comfortable with. 56 00:02:53,213 --> 00:02:56,403 So we need to mount it on slash exam, 57 00:02:56,403 --> 00:02:57,903 ext4. 58 00:03:00,256 --> 00:03:02,553 Defaults N zero zero. 59 00:03:05,280 --> 00:03:10,200 Let's create slash exam and do amount minus A. 60 00:03:10,200 --> 00:03:11,280 There we go. 61 00:03:11,280 --> 00:03:14,610 So next and final part, we need to copy all files 62 00:03:14,610 --> 00:03:18,030 with a size grade and one megabyte from the ETC directly 63 00:03:18,030 --> 00:03:21,930 to the new volume which is mounted on slash exam. 64 00:03:21,930 --> 00:03:23,640 That will be fine. 65 00:03:23,640 --> 00:03:25,240 So find slash ETC 66 00:03:26,245 --> 00:03:29,220 minus type F 67 00:03:29,220 --> 00:03:30,053 to make sure 68 00:03:30,053 --> 00:03:31,860 that it copies fail only, 69 00:03:31,860 --> 00:03:36,450 minus size plus one M 70 00:03:36,450 --> 00:03:39,450 and that'll find the files for us. 71 00:03:39,450 --> 00:03:42,450 And I like to, to learn this command to verify 72 00:03:42,450 --> 00:03:43,920 that indeed it finds the files 73 00:03:43,920 --> 00:03:45,720 and there's two of them, only two. 74 00:03:45,720 --> 00:03:47,040 Well that's good enough. 75 00:03:47,040 --> 00:03:50,055 I'm going to copy them using the minus XX statement 76 00:03:50,055 --> 00:03:54,390 on find so minus XX CP curly braces to refer 77 00:03:54,390 --> 00:03:56,490 to the result of the fine command. 78 00:03:56,490 --> 00:04:00,228 And then we copy that to slash exam. 79 00:04:00,228 --> 00:04:02,160 At the end of the line, 80 00:04:02,160 --> 00:04:05,610 backslash semicolon to close the minus XX statement. 81 00:04:05,610 --> 00:04:08,400 And that should do it LS on slash exam. 82 00:04:08,400 --> 00:04:09,510 And there we go. 83 00:04:09,510 --> 00:04:10,440 We are good. 84 00:04:10,440 --> 00:04:12,420 Don't worry about the loss plus found. 85 00:04:12,420 --> 00:04:14,190 Loss plus found directory is always 86 00:04:14,190 --> 00:04:15,700 a standard directory that you will find 87 00:04:15,700 --> 00:04:18,300 on any ext file system. 88 00:04:18,300 --> 00:04:19,133 That's all.