In this video, I'll tell you about mounting file systems.
So what is this about?
Well, to access a device, like a partition or a USB thumb
drive, it must be connected to a directory.
And that is known as mounting the device.
Once you have mounted the device on the directory,
you will see the contents of the device.
The Linux file system typically uses multiple mounts.
You remember where in lesson one,
we created a server with multiple partitions.
One of them was slash boot.
The other one was slash.
And the other one was slash boot slash EFI.
Well, that's a directory set of partitions are mounted on.
Using mounts is very common in Linux.
And different types of data are typically
on different devices for multiple reasons.
These include security and manageability and the option
to use specific mount options.
If you want to mount a device, you
use mount slash followed by the device name
followed by the directory.
As in mount slash dev slash sdb1 on slash mnt.
Now, the mount command gives an overview of all mounts,
including administrative mounts.
And you can use find mnt to show all the currently mounted
devices and their place in the file system.
I like a lot to use lsblk because lsblk
is giving a pretty clean overview of the real devices
and the location where they are mounted in the directory.
Let me show you.
This is, by the way, also the point
where I'm going to open a root shell
because you will notice from now on, for most of the things
that we want to do, we need root privileges.
Remember my generic comment in the start of this course.
This is RHCSA.
RHCSA is about administration.
And in order to do administration,
you need to be root.
Now, I'm going to use lsblk.
And what do I see in lsblk?
I see my storage devices.
So I have SR0, which is my optical device.
You can see that the type is ROM.
Then I have NVMe0N1, which is my virtual hard disk
with a size of only 20 gigabytes.
And I just inserted the USB thumb drive.
And the USB thumb drive is visible as SDA.
Now, because I'm working in a graphical environment,
as I plugged in the USB thumb drive,
it automatically mounted the SDA1 partition
on a run media student new 02.
Now, it's nice that the graphical environment is
doing that for you.
But on command line only, that won't happen.
So you will need to do it yourself.
And in order to do so, you use mount slash dev slash
name of the device, followed by the mount point, slash mnt.
The directory slash mnt, by the way,
is used for temporary mounts.
The file system hierarchy standard
has created the directory for that reason.
And now, if I use lsl slash mnt, I
can see all of the files in this device.
Now, let me type the mount command for an overview
of all the current mounts.
And you see what's going on here.
The problem that I have is too much information.
Mount is also giving information about administrative mounts.
And there's just too many of them.
So I'd rather use sudo lsblk.
Because lsblk is showing you the device.
And it's showing you exactly where it is currently mounted.
Now, the fun thing is that SDA1 is mounted
at two different locations.
There's nothing against that.
And here, we can see the LVM logical volume.
I'll tell you more about that later.
We can see the boot directory and the boot EFI directory,
all with their different mounts.
You'll get much more details about file systems
and partitions and mounts later in this course.
But every now and then, if you want
to access a temporary device, you need to mount it.
So this is a pretty essential skill.