1
00:00:00,000 --> 00:00:09,560
In this video, you'll learn about labels and UUIDs.

2
00:00:09,560 --> 00:00:12,840
We already talked about it, so you already know why.

3
00:00:12,840 --> 00:00:15,800
It all has to do with device naming.

4
00:00:15,800 --> 00:00:20,320
Device names are generated by systemd UDFD when the system is booting.

5
00:00:20,320 --> 00:00:24,440
And changes to hardware topology may result in changed device names.

6
00:00:24,440 --> 00:00:25,440
We have seen that.

7
00:00:25,440 --> 00:00:30,600
When I added a couple of NVMe devices and rebooted my system, suddenly the disk previously

8
00:00:30,600 --> 00:00:36,080
known as NVMe0n1 had become NVMe0n3.

9
00:00:36,080 --> 00:00:41,919
So if you have hard-coded device names in your ETCFS step, it will fail dramatically

10
00:00:41,919 --> 00:00:44,080
and you can start troubleshooting.

11
00:00:44,080 --> 00:00:45,520
That's not a good idea.

12
00:00:45,520 --> 00:00:48,959
And that is why you can use UUIDs and labels.

13
00:00:48,959 --> 00:00:53,740
UUIDs are automatically assigned while creating the file system.

14
00:00:53,740 --> 00:00:57,619
If at any time you don't see a UUID, well, the solution is simple.

15
00:00:57,619 --> 00:01:00,900
You haven't created the file system in that case.

16
00:01:00,900 --> 00:01:09,980
You can find block ID, BLKID to be pronounced as block ID to find currently existing UUIDs.

17
00:01:09,980 --> 00:01:15,419
Labels are human understandable labels that are written to the file system.

18
00:01:15,419 --> 00:01:19,540
And you need to create them yourself with the appropriate utilities.

19
00:01:19,540 --> 00:01:24,500
The utility that you are going to use depends on the file system that you want to use.

20
00:01:24,500 --> 00:01:27,459
You use mkfs.whatever.

21
00:01:27,459 --> 00:01:32,660
It works for any file system with the uppercase L option to set a label while creating the

22
00:01:32,660 --> 00:01:34,500
file system.

23
00:01:34,500 --> 00:01:40,739
Or tune 2fs minus uppercase L to set a label on an existing exe file system.

24
00:01:40,739 --> 00:01:46,500
And you can use xfs underscore admin minus uppercase L to set a label on an existing

25
00:01:46,500 --> 00:01:49,379
XFS file system.

26
00:01:49,379 --> 00:01:56,260
Now talking about XFS, you might get in a situation where you have duplicate UUIDs.

27
00:01:56,260 --> 00:01:58,820
This will happen if you clone a device.

28
00:01:58,820 --> 00:02:02,900
Because if you clone a device, you make an exact block-by-block copy of the contents

29
00:02:02,900 --> 00:02:04,260
of your device.

30
00:02:04,260 --> 00:02:06,959
And then the UUIDs are cloned as well.

31
00:02:06,959 --> 00:02:10,380
And the result might be duplicated UUIDs.

32
00:02:10,380 --> 00:02:14,100
And these prevent the file systems to be mounted properly.

33
00:02:14,100 --> 00:02:20,020
Now if you want to deal with that situation, you use the mount option no UUID.

34
00:02:20,020 --> 00:02:25,220
Or you just ignore the UUID and mount the device name by device name or label.

35
00:02:25,220 --> 00:02:27,360
But that's a temporary situation.

36
00:02:27,360 --> 00:02:32,539
The nice situation is to use xfs admin minus uppercase U generate.

37
00:02:32,539 --> 00:02:37,539
That will generate a new UUID on an XFS file system.

38
00:02:37,539 --> 00:02:42,059
Alternatively, there is UUID gen to generate a new UUID.

39
00:02:42,059 --> 00:02:48,339
And tune 2fs minus uppercase U to work with the new generated UUID, which next can be

40
00:02:48,339 --> 00:02:50,619
set on the device.

41
00:02:50,619 --> 00:02:56,259
So UUIDs normally are generated automatically, but you can generate them manually as well,

42
00:02:56,259 --> 00:02:57,940
which can be handy in some cases.

