1 00:00:00,000 --> 00:00:11,400 In this video you'll learn about labels and UUIDs. We already talked about it, so you 2 00:00:11,400 --> 00:00:17,639 already know why. It all has to do with device naming. Device names are generated by SystemD 3 00:00:17,639 --> 00:00:23,040 UDFD when the system is booting. And changes to hardware topology may result in changed 4 00:00:23,040 --> 00:00:29,360 device names. We have seen that. When I added a couple of NVMe devices and rebooted my system, 5 00:00:29,360 --> 00:00:37,360 suddenly the disk previously known as NVMe0n1 had become NVMe0n3. So if you have hard-coded 6 00:00:37,360 --> 00:00:44,080 device names in your ETCFS step, it will fail dramatically and you can start troubleshooting. 7 00:00:44,080 --> 00:00:50,919 That's not a good idea. And that is why you can use UUIDs and labels. UUIDs are automatically 8 00:00:50,919 --> 00:00:56,320 assigned while creating the file system. If at any time you don't see a UUID, well, the 9 00:00:56,320 --> 00:01:03,439 solution is simple. You haven't created the file system in that case. You can find BLKID 10 00:01:03,439 --> 00:01:12,199 to be pronounced as block ID to find currently existing UUIDs. Labels are human understandable 11 00:01:12,199 --> 00:01:17,440 labels that are written to the file system. And you need to create them yourself with 12 00:01:17,440 --> 00:01:22,000 the appropriate utilities. And the utility that you are going to use depends on the file 13 00:01:22,000 --> 00:01:30,000 system that you want to use. You use mkfs.whatever. It works for any file system with the uppercase 14 00:01:30,000 --> 00:01:36,639 L option to set a label while creating the file system. Or tune 2fs minus uppercase L 15 00:01:36,639 --> 00:01:43,440 to set the label on an existing EFC file system. And you can use XFS underscore admin minus 16 00:01:43,440 --> 00:01:51,559 uppercase L to set the label on an existing XFS file system. Now talking about XFS, you 17 00:01:51,559 --> 00:01:58,839 might get in a situation where you have duplicate UUIDs. This will happen if you clone a device. 18 00:01:58,839 --> 00:02:02,919 Because if you clone a device, you make an exact block by block copy of the contents 19 00:02:02,919 --> 00:02:09,080 of your device. And then the UUIDs are cloned as well. And the result might be duplicated 20 00:02:09,080 --> 00:02:16,199 UUIDs. And these prevent the file systems to be mounted properly. Now if you want to deal with 21 00:02:16,199 --> 00:02:22,199 that situation, you use the mount option no UUID. Or you just ignore the UUID and mount 22 00:02:22,199 --> 00:02:28,679 device name by device name or label. But that's a temporary situation. The nice situation is to 23 00:02:28,679 --> 00:02:36,119 use XFS admin minus uppercase U generate. That will generate new UUID on an XFS file system. 24 00:02:37,080 --> 00:02:44,919 Alternatively, there is UUID gen to generate a new UUID. And tune 2fs minus uppercase U to work 25 00:02:44,919 --> 00:02:52,679 with the new generated UUID, which next can be set on the device. So UUIDs normally are generated 26 00:02:52,679 --> 00:02:57,720 automatically, but you can generate them manually as well, which can be handy in some cases.