All right, so for this lab, we need an additional hard disk.
The lab reads 10 gig.
If it's bigger, then that's OK as well.
So we need to create a partition with the size of one
gigabyte formatted with exe4 and mounted persistently
on mounts files using its UUID.
All right, let me start with an mkdir of slash mounts
slash files.
And oops, mkdir minus p, of course,
because slash mounts doesn't exist.
So we need to create the entire path.
And then I'm going to use fdisk on what?
Well, that's not very smart.
Let's use lsblk before.
And there we can see that I have an NVMe 0 and 2
and an NVMe 0 and 3.
And I'm going to use fdisk on dev, NVMe 0 and 2.
And there we can see that it created a new DOS disk label.
I don't like the DOS disk label very much.
So I'm using the M option to show the menu.
And there on the bottom, I can see Create New Label.
The G option will create a new empty GPT partition table.
We want to go for GPT partition table here.
Good.
Now I'm going to use n.
Partition number 1 needs to be 1 gig.
So first sector is 2048.
That is OK.
And last sector plus 1 uppercase G. And by default,
it will create gigabyte and not gigabyte.
So that is what we need.
And then the other one, 512 megabytes swap.
So now that I'm in fdisk, I might as well
do that immediately.
So n again, partition number 2, first sector I'm using,
enter, plus 512 M to set up 512 megabytes of swap.
Then I need to change the partition type for number 2.
And I'm changing it to swap.
On modern Linux, we can fortunately
use an alias instead of the hexadecimal ID.
And that makes it a lot easier.
Before quitting fdisk, I like to do a P to print,
so that I can confirm what we have done is correct
and all of this is looking correct.
So using W to write.
And now we're done.
Good.
Next, we need to format mkfs.exe4,
the dev nvme 0n2p1 partition.
And now I'm going to use blkid.
And blkid is giving me the UUID.
So I want to put this into etcfsstep the fancy way.
Of course, you can also use an editor.
But you never know if you need to troubleshoot and do
this on a system where you don't have a graphical system,
then this command is convenient.
So blkid, pipe, awk.
And what are we awking for?
Well, we are looking for n2p1.
And there, I'm going to print $2.
And before doing anything with the result,
I want to see the result on screen.
And that is looking like the UUID of my n2p1 partition.
And this is what I need in etcfsstep.
And also create a 512 megabyte swap partition.
Well, I would say do the same thing here and mount it
by UUID.
Because if it's a partition, then you
don't have any guarantee that the name of the device
is never going to change.
So better use UUIDs all over.
Now I can get into etcfsstep.
And into etcfsstep, oh, I see something that I don't like.
Do you see that?
Part UUID.
That's not what I want.
And I can tell you why we get that.
We only have a part UUID because we
don't have a file system yet.
So once again, mkswap on dev nvme0 n2p2.
And now we have a UUID.
And now I can repeat my command and print
that UUID in etcfsstep.
So now it's time to open etcfsstep with an editor.
And let's use $ to go to the end of the line
with the UUID.
You can keep the double quotes around the UUID.
That is OK.
That doesn't hurt.
So specify the mount point, specify the file system,
and specify the mount options.
Defaults in 0 and 0 are good enough.
And for the other one, you do the same.
This is swap, so the mount point is null.
The file system is swap.
And we use defaults as well as 0 and 0.
And I do know that mount minus A and swap on minus A
allow you to verify.
But on the exam, really, I want you to reboot.
Because if there's anything where
you have a high risk of creating an error that
will affect the state of your system
and might result in an unbootable system,
it will be now.
You don't want to have an unbootable system.
So boot it.
And if it doesn't boot anymore, you
know that it is because of the partitioning.
And you know what to do for troubleshooting.
Good news is that this system is booting again.
And that means that our mission is accomplished.