1 00:00:08,130 --> 00:00:12,000 - So, let's start with f disk on dev sdb. 2 00:00:12,000 --> 00:00:13,290 I think we still have some place 3 00:00:13,290 --> 00:00:15,900 to create logical partitions. 4 00:00:15,900 --> 00:00:17,178 I'm using p, 5 00:00:17,178 --> 00:00:20,210 and I'm checking that we have sdb 4, 6 00:00:21,071 --> 00:00:24,150 sdb 4 goes all the way to the end 2 0 9, 7 00:00:24,150 --> 00:00:28,260 and we have available space after the end of sdb 5, 8 00:00:28,260 --> 00:00:31,110 and also before sdb 5 9 00:00:31,110 --> 00:00:35,340 because we removed one of these partitions before. 10 00:00:35,340 --> 00:00:36,173 You know what? 11 00:00:36,173 --> 00:00:38,100 Let's do something funny. 12 00:00:38,100 --> 00:00:39,870 Look carefully, and try to understand. 13 00:00:39,870 --> 00:00:41,970 I'm using N for new. 14 00:00:41,970 --> 00:00:44,160 And it creates partition number 6, 15 00:00:44,160 --> 00:00:44,993 that's okay. 16 00:00:44,993 --> 00:00:48,447 And it wants to create it at starting 0.8392704, 17 00:00:50,040 --> 00:00:53,730 which is actually before sdb 5. 18 00:00:53,730 --> 00:00:55,200 I'm going to accept that, 19 00:00:55,200 --> 00:00:58,650 and I'm going to use the end 104889855, 20 00:01:01,050 --> 00:01:04,020 which is still before sdb 5. 21 00:01:04,020 --> 00:01:06,750 Now the funny thing is, that it's telling me, 22 00:01:06,750 --> 00:01:10,650 partition 6 contains an ext4 signature. 23 00:01:10,650 --> 00:01:12,360 Do you want to remove this signature? 24 00:01:12,360 --> 00:01:13,500 I don't. 25 00:01:13,500 --> 00:01:14,500 What is it telling here? 26 00:01:14,500 --> 00:01:18,090 It is telling that it has found an ext4 file system, 27 00:01:18,090 --> 00:01:19,980 and here it's asking do you want to remove it? 28 00:01:19,980 --> 00:01:20,973 No, I don't. 29 00:01:21,926 --> 00:01:24,240 I want to show you that 30 00:01:24,240 --> 00:01:27,480 by deleting a partition, you don't really delete anything, 31 00:01:27,480 --> 00:01:31,650 and if you just deleted the partition, it's easy to recover. 32 00:01:31,650 --> 00:01:35,790 So now I'm using p and we can see sdb 6. 33 00:01:35,790 --> 00:01:37,620 And the partitions are not in this order. 34 00:01:37,620 --> 00:01:39,660 I don't care about that too much. 35 00:01:39,660 --> 00:01:44,040 I'm going to use this partition using the UUID. 36 00:01:46,980 --> 00:01:51,780 So I'm going to write this, and blkid, 37 00:01:51,780 --> 00:01:56,613 and blkid on sdb 6 is showing me this UUID. 38 00:01:59,340 --> 00:02:01,740 I'm copying the UUID, 39 00:02:01,740 --> 00:02:04,233 and I'm getting into etc fstab. 40 00:02:05,070 --> 00:02:08,520 And in etc fstab, I'm adding a new line, 41 00:02:08,520 --> 00:02:12,720 and I'm telling it to mount this on lesson 12 lab. 42 00:02:12,720 --> 00:02:15,657 And the file system type is ext4, 43 00:02:15,657 --> 00:02:18,273 and the mount options are defaults, 44 00:02:20,100 --> 00:02:21,633 and zero and zero. 45 00:02:23,640 --> 00:02:28,473 And now, I create my lesson 12 lab directory. 46 00:02:29,400 --> 00:02:31,920 I do my mount minus a, 47 00:02:31,920 --> 00:02:33,840 and oh boy, that's disappointing. 48 00:02:33,840 --> 00:02:36,930 Special device UUID doesn't exist. 49 00:02:36,930 --> 00:02:38,970 How is that possible? 50 00:02:38,970 --> 00:02:40,293 Did I make a typo? 51 00:02:41,430 --> 00:02:42,750 Well you know what? 52 00:02:42,750 --> 00:02:45,660 In partitioning, rebooting is always a good idea. 53 00:02:45,660 --> 00:02:47,943 Let's reboot, and let's see how it works out. 54 00:02:49,844 --> 00:02:52,715 Alright, so something obviously didn't go well, 55 00:02:52,715 --> 00:02:54,093 let's troubleshoot. 56 00:02:56,310 --> 00:03:00,480 So, we can see that time out waiting for device, 57 00:03:00,480 --> 00:03:02,340 and then we have the UUID. 58 00:03:02,340 --> 00:03:04,230 You can still see it on top of the screen. 59 00:03:04,230 --> 00:03:07,770 It's a UUID ending fb73. 60 00:03:07,770 --> 00:03:12,753 So, I would say blkid to see if we have fb73. 61 00:03:14,310 --> 00:03:18,690 So fb73 and I'm looking at sdb 5, 62 00:03:18,690 --> 00:03:21,570 and sdb 5 does not have it, 63 00:03:21,570 --> 00:03:25,650 and sdb 6 does have this fb73. 64 00:03:25,650 --> 00:03:27,480 Hmm, that's interesting. 65 00:03:27,480 --> 00:03:31,200 So, the big question is, what is going on here? 66 00:03:31,200 --> 00:03:32,970 Well, in order to troubleshoot, 67 00:03:32,970 --> 00:03:36,690 the troubleshooting is definitely related to the UUID. 68 00:03:36,690 --> 00:03:40,380 I would like to mount this, by UUID 69 00:03:40,380 --> 00:03:41,550 and see if that works. 70 00:03:41,550 --> 00:03:44,130 And if I can mount it manually by UUID, 71 00:03:44,130 --> 00:03:45,963 we can put it in etc fstab. 72 00:03:46,920 --> 00:03:50,130 In order to mount it by UUID from the command line, 73 00:03:50,130 --> 00:03:53,700 that's a little bit challenging, but it should be doable. 74 00:03:53,700 --> 00:03:55,073 Look, if you use blkid, 75 00:03:56,130 --> 00:03:59,160 first I need to isolate the UUID, right? 76 00:03:59,160 --> 00:04:03,210 So, if i grab sdb 6, 77 00:04:03,210 --> 00:04:05,073 we can do that in a more elegant way, 78 00:04:06,002 --> 00:04:08,310 but this is okay with me. 79 00:04:08,310 --> 00:04:10,439 Awk, print, 80 00:04:10,439 --> 00:04:12,363 dollar, 2, 81 00:04:13,320 --> 00:04:14,793 for the second field. 82 00:04:17,100 --> 00:04:19,518 And there we go, we have the UUID. 83 00:04:19,518 --> 00:04:24,511 Hey, that should be possible to do it this way as well, 84 00:04:24,511 --> 00:04:27,483 for lines containing. 85 00:04:29,730 --> 00:04:30,780 And that's also working. 86 00:04:30,780 --> 00:04:32,070 This is more elegant, isn't it? 87 00:04:32,070 --> 00:04:34,020 Grep and awk in the same command. 88 00:04:34,020 --> 00:04:35,970 Hey, why would you wanna do that 89 00:04:35,970 --> 00:04:38,070 if you can do it in one command? 90 00:04:38,070 --> 00:04:42,000 Good, so now I need to mount this UUID 91 00:04:42,000 --> 00:04:46,590 and obviously I'm not going to copy that manually. 92 00:04:46,590 --> 00:04:50,749 I am going to use good old command substitution 93 00:04:50,749 --> 00:04:53,790 which is, dollar, parenthesis, 94 00:04:53,790 --> 00:04:57,210 and we put this entire command between parenthesis, 95 00:04:57,210 --> 00:04:59,760 because you should be able to use mount UUID 96 00:04:59,760 --> 00:05:02,760 equals UUID, and slash mnt. 97 00:05:02,760 --> 00:05:06,390 I'm okay putting it in slash mnt, just to see if it works. 98 00:05:06,390 --> 00:05:07,680 Well, that works. 99 00:05:07,680 --> 00:05:09,660 Well, as this works, 100 00:05:09,660 --> 00:05:13,694 it almost looks as if it was a copy paste error. 101 00:05:13,694 --> 00:05:14,883 But, 102 00:05:16,800 --> 00:05:18,003 based on this, 103 00:05:19,050 --> 00:05:22,246 I think it's a good idea to 104 00:05:22,246 --> 00:05:27,246 redirect the output of this fine command into etc fstab. 105 00:05:28,650 --> 00:05:29,640 There we go. 106 00:05:29,640 --> 00:05:30,690 Let's fix. 107 00:05:30,690 --> 00:05:32,373 Etc fstab again. 108 00:05:33,990 --> 00:05:37,180 And there we have the UUID 109 00:05:39,118 --> 00:05:40,201 and the UUID. 110 00:05:41,235 --> 00:05:42,068 (laughing) 111 00:05:42,068 --> 00:05:42,901 Do you see it? 112 00:05:42,901 --> 00:05:43,734 I see it. 113 00:05:43,734 --> 00:05:45,300 You probably see it as well. 114 00:05:45,300 --> 00:05:48,783 Sometimes, it's just a small thing. 115 00:05:49,718 --> 00:05:54,240 Closing quotes for instance, I think we found it, 116 00:05:54,240 --> 00:05:55,157 so we can remove this one. 117 00:05:55,157 --> 00:05:56,610 But hey, 118 00:05:56,610 --> 00:05:58,500 we didn't lose any time in the troubleshooting 119 00:05:58,500 --> 00:06:00,540 because it was cool troubleshooting, wasn't it? 120 00:06:00,540 --> 00:06:03,810 At the same time, lesson 12 lab, do we have that? 121 00:06:03,810 --> 00:06:07,530 Ls and slash is showing lesson 12 lab, 122 00:06:07,530 --> 00:06:09,120 that is doing alright. 123 00:06:09,120 --> 00:06:12,480 And mount minus A, is that working now? 124 00:06:12,480 --> 00:06:13,680 That is working now. 125 00:06:13,680 --> 00:06:15,180 I want to reboot. 126 00:06:15,180 --> 00:06:18,210 I want to see that this is happening the way it should be 127 00:06:18,210 --> 00:06:22,533 happening, and I'm expecting it to be alright at this point. 128 00:06:25,320 --> 00:06:26,153 So there we go. 129 00:06:26,153 --> 00:06:28,860 We already have the GNOME display manager popping up. 130 00:06:28,860 --> 00:06:30,093 So we are good. 131 00:06:33,090 --> 00:06:35,370 There's just one tiny little thing that I still 132 00:06:35,370 --> 00:06:36,220 need to show you. 133 00:06:38,250 --> 00:06:39,780 Not because we need to, 134 00:06:39,780 --> 00:06:42,243 but because you wanna learn cool stuff, right? 135 00:06:50,280 --> 00:06:54,150 So back to the command line interface, 136 00:06:54,150 --> 00:06:58,380 and let's do an f disk on dev, sdb, 137 00:06:58,380 --> 00:07:00,603 and p for print. 138 00:07:04,920 --> 00:07:06,150 And guess what? 139 00:07:06,150 --> 00:07:08,220 Do you see what's happening here? 140 00:07:08,220 --> 00:07:12,390 Suddenly, the previously known as sda has become sdb. 141 00:07:12,390 --> 00:07:14,100 Now, that's a surprise. 142 00:07:14,100 --> 00:07:16,440 Proves the point of device names changing. 143 00:07:16,440 --> 00:07:19,800 So probably, I need to do an f disk on dev sda, 144 00:07:19,800 --> 00:07:21,810 what happened to my old sdb? 145 00:07:21,810 --> 00:07:25,470 This is my old sdb, and what berks me here 146 00:07:25,470 --> 00:07:28,350 is partition table entries are not in disk order, 147 00:07:28,350 --> 00:07:30,660 that is what I want to fix. 148 00:07:30,660 --> 00:07:31,863 How do we fix that? 149 00:07:31,863 --> 00:07:34,950 Well, we have x for expert options, 150 00:07:34,950 --> 00:07:38,100 and in the expert options use m for help. 151 00:07:38,100 --> 00:07:42,750 And you can see that there is f, fix partitions order. 152 00:07:42,750 --> 00:07:44,250 Just have a look at it right now, 153 00:07:44,250 --> 00:07:46,853 we have sda 5 starting at 104, 154 00:07:46,853 --> 00:07:49,380 and sda 6 starting at 83. 155 00:07:49,380 --> 00:07:52,500 I'm using f, and I'm using r to get back 156 00:07:52,500 --> 00:07:54,690 to the main menu, and then I'm using p, 157 00:07:54,690 --> 00:07:57,960 and then we can see the partition order is fixed. 158 00:07:57,960 --> 00:08:01,290 Doesn't that hurt the way how we are starting things? 159 00:08:01,290 --> 00:08:02,520 Well, it shouldn't. 160 00:08:02,520 --> 00:08:04,620 We do need to reboot though, 161 00:08:04,620 --> 00:08:07,260 because in etc fstab, at this point 162 00:08:07,260 --> 00:08:10,593 we should have nothing but device independent naming. 163 00:08:11,790 --> 00:08:13,140 Doesn't that hurt anything? 164 00:08:13,140 --> 00:08:15,720 No, it doesn't, because in etc fstab 165 00:08:15,720 --> 00:08:18,404 we have nothing but persistent naming at the moment. 166 00:08:18,404 --> 00:08:21,990 UUID, and labels, and dev mapper, cs something: 167 00:08:21,990 --> 00:08:22,890 That's LVM. 168 00:08:22,890 --> 00:08:25,110 We'll talk about LVM in the next lesson. 169 00:08:25,110 --> 00:08:26,343 For now, we are done.