1 00:00:00,000 --> 00:00:07,040 All right. 2 00:00:07,040 --> 00:00:09,360 So you needed to create a new file system. 3 00:00:09,360 --> 00:00:11,480 In case you don't have the partition, 4 00:00:11,480 --> 00:00:14,320 you need to start by creating the partition. 5 00:00:14,320 --> 00:00:16,760 It happens that I had a technical issue, 6 00:00:16,760 --> 00:00:19,160 and for that reason, I needed to change my machine. 7 00:00:19,160 --> 00:00:24,680 So I'm going to create a new partition on my SDB device, 8 00:00:24,680 --> 00:00:31,280 making a partition number 3 and with a size of 4 gigabytes. 9 00:00:31,280 --> 00:00:31,959 There we go. 10 00:00:31,959 --> 00:00:33,480 W to write. 11 00:00:33,480 --> 00:00:42,439 And now I can create my file system MKXFS on dev SDB 3. 12 00:00:42,439 --> 00:00:47,119 Now, MKXFS is not the only thing that we wanted in this lab. 13 00:00:47,119 --> 00:00:50,799 We also wanted to generate a new UUID. 14 00:00:50,799 --> 00:00:53,560 So let me start by showing you block ID. 15 00:00:53,560 --> 00:00:58,119 And block ID, or BLKKID, is showing the current UUID 16 00:00:58,119 --> 00:01:00,560 that has been generated right here. 17 00:01:00,560 --> 00:01:01,320 Notice the name. 18 00:01:01,320 --> 00:01:03,959 It ends 9AE3. 19 00:01:03,959 --> 00:01:07,000 So if I want to generate a new UUID, 20 00:01:07,000 --> 00:01:14,400 I can use XFS admin minus U generate on dev SDB 3. 21 00:01:14,400 --> 00:01:18,400 And there you can see that the new UUID has been generated. 22 00:01:18,400 --> 00:01:23,360 And block ID is going to confirm that SDB 3 doesn't end in AE3 23 00:01:23,360 --> 00:01:24,559 anymore. 24 00:01:24,559 --> 00:01:26,080 So here we have it. 25 00:01:26,080 --> 00:01:28,440 This is the UUID. 26 00:01:28,440 --> 00:01:30,599 Now, I want to show you something cool. 27 00:01:30,599 --> 00:01:34,120 I want to mount this file system by using the UUID. 28 00:01:34,120 --> 00:01:36,440 Of course, in a graphical user interface, 29 00:01:36,440 --> 00:01:38,120 you can easily use your mouse. 30 00:01:38,120 --> 00:01:41,720 But what are you going to do in a non-graphical user interface? 31 00:01:41,720 --> 00:01:44,320 Well, there I would use BLKKID. 32 00:01:44,320 --> 00:01:47,680 And I would use a pipe and send the output to AWK. 33 00:01:47,680 --> 00:01:53,000 And next, I'm going to tell AWK to look for SDB 3. 34 00:01:53,080 --> 00:01:58,400 And then I want it to print $2, which is the second field. 35 00:01:58,400 --> 00:01:59,120 And there we go. 36 00:01:59,120 --> 00:02:00,800 Here we have the UUID. 37 00:02:00,800 --> 00:02:04,599 Now that I have isolated my UUID from the command line, 38 00:02:04,599 --> 00:02:06,879 I can use command line redirection. 39 00:02:06,879 --> 00:02:09,559 Don't forget to use a double redirector 40 00:02:09,559 --> 00:02:14,399 and not a single one to write the output to etc fstab. 41 00:02:14,399 --> 00:02:15,919 And then I need to mount it. 42 00:02:15,919 --> 00:02:18,279 So let's mount it on the directory new. 43 00:02:18,279 --> 00:02:20,199 Need to have something as a name. 44 00:02:20,240 --> 00:02:25,000 And in etc fstab, I can see the UUID is waiting for me. 45 00:02:25,000 --> 00:02:28,399 And I'm going to mount it on slash new 46 00:02:28,399 --> 00:02:34,080 with XFS as the file system and 0 and 0 as the mount options. 47 00:02:34,080 --> 00:02:38,440 So to test, mount minus A is always a good test. 48 00:02:38,440 --> 00:02:41,600 And oh, well, I'm happy I did it because you 49 00:02:41,600 --> 00:02:44,759 can see it's complaining about an unknown parameter. 50 00:02:44,759 --> 00:02:47,800 And is there a reason why we get an unknown parameter? 51 00:02:47,800 --> 00:02:49,639 Absolutely. 52 00:02:49,639 --> 00:02:51,360 Do you see what's going on? 53 00:02:51,360 --> 00:02:54,240 We are missing the defaults option. 54 00:02:54,240 --> 00:02:57,119 There is no line with the file system mount option. 55 00:02:57,119 --> 00:03:00,080 And for that reason, it was complaining. 56 00:03:00,080 --> 00:03:02,479 That is why mount minus A is convenient 57 00:03:02,479 --> 00:03:05,639 because if you just reboot, your reboot will fail 58 00:03:05,639 --> 00:03:07,880 and you need to go into troubleshooting. 59 00:03:07,880 --> 00:03:10,000 So now if I use mount minus A again, 60 00:03:10,000 --> 00:03:14,320 it's only giving me a hint about systemctl daemon reload, 61 00:03:14,320 --> 00:03:16,119 which I choose to ignore. 62 00:03:16,119 --> 00:03:19,080 My file system should be mounted. 63 00:03:19,080 --> 00:03:21,720 LSBLK is showing it. 64 00:03:21,720 --> 00:03:23,559 And there we go. 65 00:03:23,559 --> 00:03:27,440 SCB3 is mounted on the partition slash new. 66 00:03:27,440 --> 00:03:30,679 So that is what I had in mind for this lab.