OK.
Let's talk about the device-independent naming.
What is the problem?
Well, the problem is that in data center environments,
block device names may change.
We have seen that.
I started with NVMe 0 and 1, and suddenly it
became NVMe 0 and 2.
That can happen any time you change the storage topology.
So if I add a new disk, who knows?
I might end up with NVMe 0 and 3 instead.
So we need a solution for device-persistent naming.
And the solution is the UUID.
A UUID is automatically generated
for each device that contains a file system or anything
similar.
There's also an older option that's
not used very often anymore, which is the label.
When you create a file system, you
can use the option minus uppercase L
to set an arbitrary name for the file system that
can be used while mounting the file system.
Also, unique device names are created in DevDisk.
Don't use them.
Just go for UUID.
Now, in order to find the UUIDs, you
can use the block ID command.
BLK for block ID will show all devices
with their naming attributes.
Also, you can use tune 2FS minus uppercase L
to set a label on an EXE file system,
or XFS underscore admin minus uppercase L
to set a label on an existing XFS file system.
And MKFS whatever minus L allows you to set a label
while creating the file system.
So let me show you how UUIDs can help us fixing the problem that
was created before.
So I'm using block ID.
And what do I see in block ID?
I see this UUID in the second column.
And now, did you see that?
Suddenly, it's NVMe 0 and 1 before again.
Hey, talking about always changing device names.
So this is exactly why we need UUID.
Now, I'm going to do the fancy way.
And the fancy way is a way that also works from the command
line.
Imagine that you need to do troubleshooting
from the command line.
And you figure out that your FS step is wrong.
And you need to get this UUID in your FS step.
How are you ever going to do that in an environment
where your mouse doesn't work?
Well, I am going to block ID, pipe awk.
And what do I want to awk?
Well, I want to look for lines containing N1 P4.
And there, I want to print $2.
And let's see if that works out all right.
Yeah, that is giving me the UUID.
And this UUID is what I want to write to my ETC FS step.
Of course, here, I could have used my mouse.
But that wouldn't be fair.
If on the exam, you get in an environment
where you don't have a graphical user interface,
you can't use the mouse.
And this is going to write the UUID to ETC FS step.
And in this ever-changing environment,
that's absolutely what we need to do.
So I'm going to use A for add to the line.
For the moment, I'm keeping the line with the NVMe 0 and 1 P4.
I want to mount it on slash data.
Let's mount it on slash files, because slash data already
exists.
Then I want to put in my XFS file system.
And I think I do like the no fill option.
And I'm using 0 and 0.
If I may give you a tip, if you are getting stuck on the exam,
really stuck, and you don't know what to do anymore,
and your system always fills while mounting this file
system, replace the file system mount options.
Defaults work with no fill.
At least you can continue booting your system.
You still have a chance that you pass the exam.
So here, we can see how the mount would be working.
And in case you are wondering, the UUID has double quotes.
Does that make a difference?
No, not at all.
With or without the double quotes, it is going to work.
So next, I'm going to reboot.
And we are going to see what is happening.
Again, press Escape while you see the turning wheel,
if you want to see what is going on.
I will later show you how you can make that the default.
But for now, you need to press Escape.
And there's my graphical user interface coming.
So this seems to be all right.
Now, what do you think?
Has my new device been mounted or not?
Well, we are going to find out shortly using LSBOK.
And in LSBOK, we can see that it has been mounted on slash files.
And the fun thing, did we ever create slash files?
Let's do a history, pipe, grab, slash files.
And there we go.
We never created slash files.
Now, that's a good thing of SystemD taking care of it.
SystemD is excellent.
It's taking care of dependencies.
It has seen, oh, we need to mount it
on the slash files directory.
I don't have a slash files directory.
Well, SystemD creates it automatically for you.
Isn't that convenient?
This is how you use UUIDs for mounting.
Use nothing but UUIDs.
There's nothing better.