Okay, we have just learned how you can mount devices. Now you need to know how these mounts can be made persistent.
That would go through etc. Fstep.
So etc. Fstep is the file that makes mounts persistent and ensures that they get back when you reboot.
On modern systems, this file is used as an input file to create system demounts in
ignore it, because if you just use etc. Fstep, systemd will do the rest for you.
In etc. Fstep, you define your mount in six different columns.
First you refer to the device.
That can be the name of the device or the uuid. And that's exactly what we are going to
do. Because device names may change, UUIDs will never change, and that's what we need for reliable persistent mounts.
Then you need the mount point, which is the directory where you are going to mount your
device. The file system, which is a file system type that you've used for formatting and mount
options, dump support or mount order, which in most cases are not needed at all.
Now it's important that when you are mounting devices in
etc. Fstep, you use UUID and not the device names.
I will show you how to do this from for the device that we have just created.
So the first thing that I need is to find out the UUID for my devices.
Sudo blkid Every device that has a file system has a unique
block id and that is the UUID that we see right here.
And these UUIDs will never change. I'm not so sure about my device names. I was
surprised that my resized disk appeared as NVMe 0n2 and the new disk appears as NVMe
0n1. And I'm not so sure that after a reboot is going to be the same.
So I'm going to use the uuid and then I'm going to open etcfstab
in my editor so that we can add the mount for the uuid.
As you can see in the first column, everything that is
mounted is mounted by uuid. Likewise for my new device.
Now my UUID has double quotes.
You can keep them, there's no need to remove them.
I'm going to mount this on files. That needs to be a unique mount point which I
still need to create. I need to specify the file system and then there is the mount
options and the other options for column 4, 5 and 6 just use defaults 00.
Now once you are done with your etc step, you want to test and in order to test
I would suggest you use sudo mount A MNND A is trying to mount everything in etc fstep
which is not currently mounted and it will complain if there is any errors preventing from doing so,
which is the case here. We can see files. Mount point does not exist. That is correct.
I need sudo mkdir files to create it.
Now I can use my mount A again.
We do see this hint. Feel free to ignore the hint for now. The mount has been
done and I'm going to use sudo reboot to restart my system with the newly mounted partition.
That is the ultimate test that allows me to verify if everything was done the right way.
I've pressed the escape key so that you can see a couple of startup messages.
What I'm looking for is if anything appears in red. But this was so fast. And I
see the GDM login appearing again and. And that probably means that everything is all right.
So let's open the terminal and let's verify
that the mount was indeed successfully performed.
So sudo lsblk.
That's a typo, but let me regenerate the sudo token and then do lsblk again.
And what do we see? Well, we see that it is still NVMe
0n2 and we also see that the new partition is mounted on files.
So if I would use another check mount pipe grab N2 P4 then you
can see that the mount is there and that is what was expected.