The standard way to mount partitions and also
logical volumes persistently is through ETCFS step.
So start here if you want to make your mount persistent.
And in ETCFS step, you add a line that looks like this.
So devnvme0n1p4, that's a device that I want to mount.
Slash data, that's a directory where I want to mount it.
Ext4, that would be the file system.
In our case, that's going to be XFS.
Then we have the defaults.
That is the field where you can put mount options
in case your file system needs any specific mount options.
That's not the case right now.
And the last two fields, we'll just always put them to 0, 0
because these are legacy fields that are not really
used anymore.
Now, ETCFS step content is used to generate system demounts.
And that is happening by the systemdfsstep generator.
So what's happening?
When you boot, systemdfsstep generator wakes up.
It reads ETCFS step.
And it mounts your file systems as systemd mounts.
And you know systemd is the manager of everything.
So better make sure that systemd is up to date.
That is also why you need to update systemd mounts
after editing your ETCFS step.
Do so by using systemctl daemon reload.
Now, sometimes it might go wrong if you make an error
while editing ETCFS step.
And what is happening in that case?
Well, your system will drop a troubleshooting cell
while booting.
If that happens on the exam, it's
very bad because you will fail the exam if it does.
That is because your system can't boot normally anymore.
And that means that you can't get sufficient points
to pass the exam.
So make sure that that will never happen.
To avoid getting in trouble, use mount minus A
after adding lines to ETCFS step.
And that will mount all that hasn't been mounted yet.
Alternatively, use findMnt minus minus verify
to verify the syntax of what you've done so far.
Now, let me show you how to put stuff in ETCFS step.
So I'm going to edit ETCFS step.
And I'm going to add my line devnvme0n1p4
on the directory slash data.
I'll tell you about other options to mount device later.
No worries about it.
Then I need to specify the file system, which
is XFS, the mount options, which is default, and 0 and 0
because that's what you normally always use in the end.
Then we are going to do what?
Well, you know what?
I'm going to ignore all of my recommendations.
And I'm going to reboot so that we can find out
what will happen.
Did I create a directory slash data?
Oh, no, I did not.
Well, let's see what is going to happen.
Or did I?
Yeah, I think I did earlier when we talked about permissions.
OK, now we see the turning wheel.
I don't want to see a turning wheel.
Press Escape so that I can see boot messages.
And there I can see, oh, no, failed on something.
That's a VMware VM block fuse mount.
I don't think that is critical.
What I care about is that I see my boot and my repo
and my boot EFI being mounted.
And then it stops.
Well, let's figure out what is going to happen.
And oh, boy, job dev NVMe 0 and 1 before device start running.
Oh, no, what is going on?
Well, what is going on is that I used a device name.
And I made a mistake.
When I started this configuration,
my primary hard disk was NVMe 0 and 1.
Then I added a new hard disk, and suddenly it
became NVMe 0 and 2.
And now because of that, I made an error.
Well, I'm human, and humans make errors.
And the error is that I used NVMe 0 and 1 before in my ETCFS step.
And that device doesn't exist anymore.
Now, what are we going to do about it?
Well, we need to find a device-independent way
of defining the mounts.
So I shouldn't be referring to the device manually.
I should use a UUID.
So what do we see next?
Well, we see you're in emergency mode.
And press Enter to continue.
And starting default target.
And oh, no, we have seen that before.
So what does that mean?
That means that we are in trouble,
and we need to apply troubleshooting procedures
as we have learned before.
So how are we getting access to this system again?
Well, let's figure it out.
So oh, no, what is going on?
Well, the problem is that I don't have a root password.
It wants to boot emergency mode.
And we need a root password in order to enter emergency mode.
So there's only one thing that I can do.
I'm getting out of this boot loop.
And I'm going to restart my virtual machine.
And we are going to do some basic troubleshooting.
Now, as the previous boot did not complete successfully,
here I'm getting access to my group boot menu.
In the group boot menu, I'm pressing E for Edit.
I want to edit the current entry.
And I'm looking for the line that starts with Linux.
This line is wrapped over three lines.
And it ends with rhdb and quiet.
I'm removing the rhdb and quiet.
And I'm adding init is slash bin slash bash.
That is an option that allows you to get into a minimal mode
without having to enter a root password.
So next, I'm using Control-X.
And then we will be booting.
And there you can see on the bottom line
that I'm in a root shell.
Now, this root shell didn't require any root password.
And that is good.
And probably the easiest way to get around of this
is by using passwd.
But hey, if I'm going to use passwd,
there is one little thing.
And that is the following.
Look at this.
I'm using touch HA.
And that's telling me read-only file system.
So I need one thing before.
Mount minus o remount comma rw slash.
That is putting my root file system in read-writable mode.
And now I'm going to edit my etcfs step.
And in etcfs step, I'm going to use dirty trick.
We have just seen that it fails on NVMe 0 and 1P4.
Well, I am going to change this defaults option to no fail.
That means that, OK, if this file system doesn't mount,
well, we are not going to stop the entire boot procedure.
We are just going to continue with it.
Now that I'm ready in my init is bin bash shell,
I need to restart my virtual machine again.
And the easiest way, I will tell you a more sophisticated way
later, the easiest way is to type sync
to make sure that there is no changes pending in cache
anymore.
And use the virtual machine controls to restart.
And that should get us in a better shape.
I still want to see what is happening while booting.
And the good thing is that now I can see my user list again.
So I'm back in business.
I didn't fix the problem.
But in order to fix the problem, we
need to talk about the topic of the next lesson, UUIDs.